I have an entity (heat pump status) that switches "on"off"hwc"
I need to make it turn on for me only when it switches from "off to hwc" or from "off to on", not from "hwc to on" or "on to hwc".
Now I have it like this, but it switches for me depending on which variant is switched on and not what it is switched from.
Below in the attachment is what I want to achieve. This is how I do it in HA.
[{"id":"35ec9f061d204c93","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"13ca4d4e3b1b77d2","type":"group","z":"35ec9f061d204c93","name":"Odmrazování","style":{"fill":"#3f3f3f","label":true,"color":"#bfbfbf"},"nodes":["d38a8641b14cad79","5f2259d1e3d424b2","b1b79c95d8ba264d","db26b61e1de2762e","5438415f78a69d63","44614fcde780393f","bb5b2ab93421437c","b69ce32c1ac61c8d","a21b95738d2134d4","a223bae68e510617","3f6fc09706236aa6","e639b11297b575a5","ecd1f55c7efc0da0","3e2252e93f18ac84","a916a6e6d5b3c0f7","01d0399cab79118b","e36fd8199f9188ee"],"x":34,"y":119,"w":1012,"h":362},{"id":"d38a8641b14cad79","type":"api-current-state","z":"35ec9f061d204c93","g":"13ca4d4e3b1b77d2","name":"Teplota pod 2 st","server":"c3890858.1f2358","version":3,"outputs":2,"halt_if":"2","halt_if_type":"num","halt_if_compare":"lt","entity_id":"sensor.weather_station_outdoor_module_teplota","state_type":"num","blockInputOverrides":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":440,"y":160,"wires":[["5f2259d1e3d424b2"],[]]},{"id":"5f2259d1e3d424b2","type":"api-call-service","z":"35ec9f061d204c93","g":"13ca4d4e3b1b77d2","name":"Kouřza","server":"c3890858.1f2358","version":7,"debugenabled":false,"action":"automation.turn_on","floorId":[],"areaId":[],"deviceId":[],"entityId":["automation.kourza"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":true,"domain":"automation","service":"turn_on","x":620,"y":160,"wires":[["b1b79c95d8ba264d"]]},{"id":"b1b79c95d8ba264d","type":"delay","z":"35ec9f061d204c93","g":"13ca4d4e3b1b77d2","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":790,"y":160,"wires":[["db26b61e1de2762e"]]},{"id":"db26b61e1de2762e","type":"api-call-service","z":"35ec9f061d204c93","g":"13ca4d4e3b1b77d2","name":"Kouřza1","server":"c3890858.1f2358","version":7,"debugenabled":false,"action":"automation.turn_on","floorId":[],"areaId":[],"deviceId":[],"entityId":["automation.kourza1"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":true,"domain":"automation","service":"turn_on","x":960,"y":160,"wires":[["5438415f78a69d63"]]},{"id":"5438415f78a69d63","type":"delay","z":"35ec9f061d204c93","g":"13ca4d4e3b1b77d2","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":450,"y":240,"wires":[["44614fcde780393f"]]},{"id":"44614fcde780393f","type":"api-call-service","z":"35ec9f061d204c93","g":"13ca4d4e3b1b77d2","name":"Kouřza","server":"c3890858.1f2358","version":7,"debugenabled":false,"action":"automation.turn_off","floorId":[],"areaId":[],"deviceId":[],"entityId":["automation.kourza"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":true,"domain":"automation","service":"turn_off","x":620,"y":240,"wires":[["b69ce32c1ac61c8d"]]},{"id":"bb5b2ab93421437c","type":"api-call-service","z":"35ec9f061d204c93","g":"13ca4d4e3b1b77d2","name":"Kouřza1","server":"c3890858.1f2358","version":7,"debugenabled":false,"action":"automation.turn_off","floorId":[],"areaId":[],"deviceId":[],"entityId":["automation.kourza1"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":true,"domain":"automation","service":"turn_off","x":960,"y":240,"wires":[["a21b95738d2134d4"]]},{"id":"b69ce32c1ac61c8d","type":"delay","z":"35ec9f061d204c93","g":"13ca4d4e3b1b77d2","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":790,"y":240,"wires":[["bb5b2ab93421437c"]]},{"id":"a21b95738d2134d4","type":"delay","z":"35ec9f061d204c93","g":"13ca4d4e3b1b77d2","name":"","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":450,"y":320,"wires":[["ecd1f55c7efc0da0"]]},{"id":"a223bae68e510617","type":"api-call-service","z":"35ec9f061d204c93","g":"13ca4d4e3b1b77d2","name":"Kouřpřed","server":"c3890858.1f2358","version":7,"debugenabled":false,"action":"automation.turn_on","floorId":[],"areaId":[],"deviceId":[],"entityId":["automation.kourpred"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":true,"domain":"automation","service":"turn_on","x":520,"y":440,"wires":[["e639b11297b575a5"]]},{"id":"3f6fc09706236aa6","type":"api-call-service","z":"35ec9f061d204c93","g":"13ca4d4e3b1b77d2","name":"Kouřpred","server":"c3890858.1f2358","version":7,"debugenabled":false,"action":"automation.turn_off","floorId":[],"areaId":[],"deviceId":[],"entityId":["automation.kourpred"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":true,"domain":"automation","service":"turn_off","x":860,"y":440,"wires":[[]]},{"id":"e639b11297b575a5","type":"delay","z":"35ec9f061d204c93","g":"13ca4d4e3b1b77d2","name":"","pauseType":"delay","timeout":"10","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":700,"y":440,"wires":[["3f6fc09706236aa6"]]},{"id":"ecd1f55c7efc0da0","type":"api-current-state","z":"35ec9f061d204c93","g":"13ca4d4e3b1b77d2","name":"off","server":"c3890858.1f2358","version":3,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.ebusd_hmu_status01_pumpstate","state_type":"str","blockInputOverrides":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"","forType":"num","forUnits":"seconds","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":250,"y":160,"wires":[["d38a8641b14cad79"],[]]},{"id":"3e2252e93f18ac84","type":"api-current-state","z":"35ec9f061d204c93","g":"13ca4d4e3b1b77d2","name":"on","server":"c3890858.1f2358","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.ebusd_hmu_status01_pumpstate","state_type":"str","blockInputOverrides":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"","forType":"num","forUnits":"seconds","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":250,"y":220,"wires":[["01d0399cab79118b"],[]]},{"id":"a916a6e6d5b3c0f7","type":"api-current-state","z":"35ec9f061d204c93","g":"13ca4d4e3b1b77d2","name":"hwc","server":"c3890858.1f2358","version":3,"outputs":2,"halt_if":"hwc","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.ebusd_hmu_status01_pumpstate","state_type":"str","blockInputOverrides":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":250,"y":280,"wires":[["01d0399cab79118b"],[]]},{"id":"01d0399cab79118b","type":"api-current-state","z":"35ec9f061d204c93","g":"13ca4d4e3b1b77d2","name":"Teplota pod 2 st","server":"c3890858.1f2358","version":3,"outputs":2,"halt_if":"2","halt_if_type":"num","halt_if_compare":"lt","entity_id":"sensor.weather_station_outdoor_module_teplota","state_type":"num","blockInputOverrides":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":340,"y":440,"wires":[["a223bae68e510617"],[]]},{"id":"e36fd8199f9188ee","type":"server-state-changed","z":"35ec9f061d204c93","g":"13ca4d4e3b1b77d2","name":"test","server":"c3890858.1f2358","version":6,"outputs":1,"exposeAsEntityConfig":"","entities":{"entity":["sensor.ebusd_hmu_status01_pumpstate"],"substring":[],"regex":[]},"outputInitially":false,"stateType":"str","ifState":"","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"","forType":"num","forUnits":"seconds","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":110,"y":220,"wires":[["ecd1f55c7efc0da0","a916a6e6d5b3c0f7","3e2252e93f18ac84"]]},{"id":"c3890858.1f2358","type":"server","name":"Home Assistant","addon":true}]