I have an Electron that reads the data from a temperature sensor. Every 15 minutes, this electronic takes the data and compares it with a variable, if the temperature is below, it sends a JSON to the server.
The routine works, but this variable has a fixed value. My idea would be for that variable to be stored in my ElasticSearch and when the Electron connects, ask the Elastic Via Node what the value of that variable is.
Can you help me on how to do this? is it possible that the Electron will “request” a data directly to my Node without going through an API intermediary?
I’ll explain the case better. The problem comes because the Electron is asleep all the time.
The operator from the web changes the value by which he wants to receive the alert, for example from 20 to 10 degrees.
The Electron has the alert variable set to 20, when the machine rises, it has to ask “somewhere” if there are new variables, and it has occurred to me doing so, that the Electron asks for the new data.
The data is in a table in Elastic, but directly it is not the way, the idea is to make a GET request to NODE and it will return the field.
What do you think about it?
Eduard