Basic Maths on iHost

Is it possible to do basic maths on an iHost that I haven’t thought of?

For example the use case is that I have two temperatures (inside and outside) is it possible to say when the temperature outside gets colder than inside and effect some way of letting me know to open the windows.

I’m thinking this as it’s really hot here but still 4°C colder than outside and I keep having to check the temperatures.

I know I could go out into the internet and do it. Did something similar when Apilio was free.

I think for now the Node-Red docker would be the easiest way of doing that. You can read the two temperatures in Node-Red, calculate a difference and and it if over a threshold you can flip a state. And you can easily resend this state as a virtual switch that Node-Red will turn on/off. With that you can build a scene in iHost to perform the required task.

Thanks. I hadn’t thought of node red. I did install it and have a quick play but have never used it properly.

Let me know if you get stuck, I did similar with Node-Red iHost before.

Hi Csongor I got stuck trying to read form the temperature / humidity sensors (SNZB-02D) in node-red, could you point me in the right direction ? Thanks.

I was just playing around with this and I think I got it started. Let me put together a quick video on that.


Check out my video on this:

Let me know if this help understanding my approach to this.

1 Like

Thank you its working now, the latest node-red-contrib-ewelink-cube update (1.1.0) enables the SNZB-02D sensor.

As you mentioned in your video the structure returned by the event-state item is unexpected : payload.payload.temperature.temperature and payload.payload.humidity.humidity that requires a fix (I used a function).