Hoje estou no PC.
Criei um auxiliar e dei o seguinte nome: input_number.valor_kwh_ligar_resistencia_1
Uso este auxiliar para definir o valor, a partir do qual, pretendo que a resistência se ligue. Tenho exposto no lovelace.
Vou partilhar o flow do NR (já passei o flow no Scrubber - https://zachowj.github.io/node-red-contrib-home-assistant-websocket/scrubber/):
[{"id":"4a2f69dbe60798af","type":"trigger-state","z":"695d2e761986ef56","name":"Kwh > XX Valor definido 1","server":"","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"sensor.saldo_injecao_consumo_15_em_15_minutos","entityidfiltertype":"exact","debugenabled":false,"constraints":[{"targetType":"this_entity","targetValue":"","propertyType":"current_state","comparatorType":">","comparatorValueDatatype":"jsonata","comparatorValue":"$entities(\"input_number.valor_kwh_ligar_resistencia_1\").state","propertyValue":"new_state.state"},{"targetType":"this_entity","targetValue":"","propertyType":"previous_state","comparatorType":"<=","comparatorValueDatatype":"jsonata","comparatorValue":"$entities(\"input_number.valor_kwh_ligar_resistencia_1\").state","propertyValue":"old_state.state"}],"inputs":1,"outputs":2,"customoutputs":[],"outputinitially":false,"state_type":"str","enableInput":true,"x":150,"y":100,"wires":[["8f5bf7dd619a5d81"],[]]},{"id":"8f5bf7dd619a5d81","type":"api-current-state","z":"695d2e761986ef56","name":"Ainda Ligada?","server":"","version":2,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"switch.aqs_resistencia_acumulador","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"x":380,"y":100,"wires":[[],["059c647acb7496d0"]]},{"id":"059c647acb7496d0","type":"api-call-service","z":"695d2e761986ef56","name":"Ligar Resistência Acumulador","server":"","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.aqs_resistencia_acumulador","data":"","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"data"}],"queue":"none","x":650,"y":100,"wires":[[]]},{"id":"5debddfe79e45f47","type":"trigger-state","z":"695d2e761986ef56","name":"Kwh = 0","server":"","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"sensor.saldo_injecao_consumo_15_em_15_minutos","entityidfiltertype":"exact","debugenabled":false,"constraints":[{"targetType":"this_entity","targetValue":"","propertyType":"previous_state","comparatorType":">","comparatorValueDatatype":"num","comparatorValue":"0","propertyValue":"old_state.state"},{"targetType":"this_entity","targetValue":"","propertyType":"current_state","comparatorType":"<=","comparatorValueDatatype":"num","comparatorValue":"0","propertyValue":"new_state.state"}],"inputs":1,"outputs":2,"customoutputs":[],"outputinitially":false,"state_type":"str","enableInput":true,"x":100,"y":180,"wires":[["7be007d140d7a7ce"],[]]},{"id":"7be007d140d7a7ce","type":"api-call-service","z":"695d2e761986ef56","name":"Desligar Resistência Acumulador","server":"","version":3,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.aqs_resistencia_acumulador","data":"","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"data"}],"queue":"none","x":400,"y":180,"wires":[[]]}]