one way
[{"id":"1fe782c63331b065","type":"api-current-state","z":"7bfa7ff525ace8b1","name":"roof_heat_cable_temp_set_point","server":"","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_number.roof_heat_cable_temp_set_point","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"max_temp","propertyType":"msg","value":"","valueType":"entityState"}],"for":0,"forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":332,"y":256,"wires":[["fadc38404acaf3fd"]]},{"id":"e37ff9189d495d4b","type":"inject","z":"7bfa7ff525ace8b1","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":106,"y":256,"wires":[["1fe782c63331b065"]]},{"id":"fadc38404acaf3fd","type":"api-current-state","z":"7bfa7ff525ace8b1","name":"stratford_temperature","server":"","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.stratford_temperature","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"temp","propertyType":"msg","value":"","valueType":"entityState"}],"for":0,"forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":596,"y":256,"wires":[["30252d2c67bee55f"]]},{"id":"30252d2c67bee55f","type":"api-current-state","z":"7bfa7ff525ace8b1","name":"enable_roof_heating","server":"","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_boolean.enable_roof_heating","state_type":"str","blockInputOverrides":false,"outputProperties":[],"for":0,"forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":820,"y":256,"wires":[["de7350e27869509f"],["8434fbf69d954a5a"]]},{"id":"8434fbf69d954a5a","type":"debug","z":"7bfa7ff525ace8b1","name":"false","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1138,"y":304,"wires":[]},{"id":"de7350e27869509f","type":"switch","z":"7bfa7ff525ace8b1","name":"","property":"temp","propertyType":"msg","rules":[{"t":"lte","v":"max_temp","vt":"msg"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":1010,"y":256,"wires":[["36656b7c88541b10"],["8434fbf69d954a5a"]]},{"id":"36656b7c88541b10","type":"debug","z":"7bfa7ff525ace8b1","name":"true","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1138,"y":256,"wires":[]}]
second way
[{"id":"a06ab39bae300f05","type":"inject","z":"7bfa7ff525ace8b1","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":108,"y":384,"wires":[["9e299a3fab7c3090"]]},{"id":"9e299a3fab7c3090","type":"api-current-state","z":"7bfa7ff525ace8b1","name":"roof_heat_cable_temp_set_point","server":"","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_number.roof_heat_cable_temp_set_point","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"(\t $max_temp := $number($entity().state);\t $temp := $number($entities(\"sensor.stratford_temperature\").state);\t $enabled := $entities(\"input_boolean.enable_roof_heating\").state;\t\t temp <= max_temp and $enabled = \"on\"\t)","valueType":"jsonata"}],"for":0,"forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":332,"y":384,"wires":[["7de3b7886530a1bd"]]},{"id":"7de3b7886530a1bd","type":"debug","z":"7bfa7ff525ace8b1","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":566,"y":384,"wires":[]}]
https://zachowj.github.io/node-red-contrib-home-assistant-websocket/guide/jsonata.html