Getting a state node to look at a input.number helper

Simplified examples…

As seen below, I edited the state node so that when the garage temp sensor reports a temp < 55, the garage heater turns on. This is great and it works.

My “problem” is, I would like to be able to change the number (55 at the moment) through the HA dashboard and not have to go into Node red to do it.

I’ve created a input.number helper (input_number.garage_heater_turn_on_temp). Is there anyway to get the state node to base its decision off whatever number is in that helper?

Heres my flow:

[{"id":"e0c3fb3f542c1353","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"818f49e561419590","type":"server-state-changed","z":"e0c3fb3f542c1353","name":"Temp under 55?","server":"ab3e2c53.e3491","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.temperature_garage","entityidfiltertype":"exact","outputinitially":false,"state_type":"num","haltifstate":"55","halt_if_type":"num","halt_if_compare":"lt","outputs":2,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":737,"y":288,"wires":[["be3d760b3ba5a7f4"],[]]},{"id":"be3d760b3ba5a7f4","type":"api-call-service","z":"e0c3fb3f542c1353","name":"ON: Garage heater","server":"ab3e2c53.e3491","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.garage_heater","data":"","dataType":"jsonata","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":999,"y":288,"wires":[[]]},{"id":"ab3e2c53.e3491","type":"server","name":"AvilaSmartHome","version":1,"legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]

Set the if state value type to j expression and use $entities("input_number.garage_heater_turn_on_temp").state

1 Like