Hi,
I’m new to HA, migrating from OpenHAB, I have MQTT and many other integrations working.
Using Nodered (NR) my AC Heater turns on based on Solar panel output value. AC heater is operated via a Tuya IR blaster. Solar output value and AC heating status is stored in MQTT.
The issue is the automation sends a signal to the AC regardless of the AC’s current setting (to be expected). So if AC is ON, solar says it should be ON, it turns is ON (again). This occurs based on the poll interval of the solar output test (currently 1 min.).
The real issue is the AC beeps everytime it receives an IR signal (1 minute) LOL. Houshold is getting annoyed at the regular beeping (no surprise).
How can you check a MQTT topic\value from within a function. I’ve not been able to find any examples of this. e.g.
I fiddled with a boolean function but could not get the correct results for one state. So I’ve reverted to a simple IF to get a solution in, keep the house happy.
Any suggestions would be greatly apprecaited, I’m sure it’s a common problem.
I’ve missed something, as the function just passes the trigger time, and seems to ignore the if statement !
Any suggestions or examples would be very welcome.
You need to use flow.get("variable name") to get a flow variable inside a function node. Is the value of AC_Heater a string or boolean? As you have it, it’s comparing strings.
Many thanks for taking the time to help, it is greatly appreciated.
After the function there is a HA service node that triggers a scene in Tuya to control the AC.
While the function correctly sends on/off based on input. Both service nodes receive input, which causes them to trigger together. As msg.payload always has a value.
How can you set msg.payload to no value/content so there is no output, so it wont trigger both service node.
or is there a better way to do this.