Help with periodicaly update entity values for using AND function

Hi Guys i’m really new to NR

After reboot of NR or HA the function for switching off the heater doesn’t work properly because the value is not set yet.

how can i periodically update the states of these input

if either 1 thermostat is on the heater needs to be on and if both thermostats are off the heater need to be on
on = OR function
off = AND function

thanks a lot

I think you can use the inject node to periodically inject into a current state node and get the values updated. Try the below inject node which will start automatically after NR deploy or Restart.

[{"id":"8e5d1f15.36cd2","type":"inject","z":"51045e07.bbf87","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"1800","crontab":"","once":true,"onceDelay":"30","topic":"","payload":"Started!","payloadType":"str","x":200,"y":2400,"wires":[["cf644c9.7df87b","da48e0aa.6d9ba"]]},{"id":"cf644c9.7df87b","type":"api-current-state","z":"51045e07.bbf87","name":"input boolean","server":"d177950.2a5aa68","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":380,"y":2380,"wires":[[]]},{"id":"da48e0aa.6d9ba","type":"api-current-state","z":"51045e07.bbf87","name":"input boolean","server":"d177950.2a5aa68","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":380,"y":2440,"wires":[[]]},{"id":"d177950.2a5aa68","type":"server","name":"Home Assistant","legacy":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]

image

For and or function why cant you set an automation in HA. It can be easily done with the AND OR condition in automations.

Enabling “Output on Connect” in your event: states nodes may solve your problem.

1 Like

Thnx mbonani

this did the trick,
how easy some things can be

@ sheminasalam
thnx for this idea, wil use this for other automations

you guys rock !

it seemed that if the burner was running during a reboot of HA the burner proceeded to run.
and thermostats were off becease of the standard settings of the thermostats.
and entity ID’s are not updated in NR after complete reboot …

Soo I ended up using a combination .

if either one thermostat is on the burner starts
if both are off it will switch off with a backup interval timer

I also had the same issue that is why I had to shift to the method that I advised.

same issue occured with switching on if needed.
so i added current state nodes for the on function as well