So I’ve been playing more with node-red and seeing how is compares to Python when being used for my HA system.

As I mentioned before, I’ve started to get frustrated with writing rules in Openhab, so was looking at using Openhab as the front-end and using something like Python as the decision making back end. I initially played with node-red but could really get it to work because I could only get it to work on the current message and couldn’t do something things like compare the current temperature to the variable desired temperature.

However, after doing a bit more searching, it turns out that it’s easy enough to store global variables! So by storing the different temperatures as global variables, it became trivial to compare them.

Using this I was able to switch the “boiler” on and off with great ease.

So I’m going to play around with node-red a bit more, but so far it seems to be a bit easier than the Python code (which started to get messy very quickly).