Trigger flow from entity's state attribute

I learn something new in node-red every day. My flow is vastly simplified now. I added in a few additional outputs to this trigger for future usage. Thanks @Mikefila!

Here is the flow for anyone who might want to use it for a homekit connected ecobee and any entity they want to control with it…

[{"id":"858850f8.d94488","type":"tab","label":"ECOBEE","disabled":false,"info":""},{"id":"5b5b9e4378990062","type":"group","z":"858850f8.d94488","name":"HVAC - Return Air Booster On/Off","style":{"label":true,"stroke":"#000000","fill":"#e3f3d3","color":"#000000"},"nodes":["d96505bee79ed87d","27cc7b22e27e5b4f","08432ba0f098e0d5","3e79441a5f0bc67c","860150cd3b6861e8","41bcd6ed56311ab1"],"x":28,"y":39,"w":738,"h":348},{"id":"860150cd3b6861e8","type":"group","z":"858850f8.d94488","g":"5b5b9e4378990062","name":"Run Manually","style":{"stroke":"#000000","fill":"#bfbfbf","label":true,"color":"#000000"},"nodes":["6f81d9184d2ba8ea","4f572e574d20a12e","280e2412f951d649"],"x":54,"y":199,"w":232,"h":162},{"id":"6f81d9184d2ba8ea","type":"inject","z":"858850f8.d94488","g":"860150cd3b6861e8","name":"Send \"cooling\"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"cooling","payloadType":"str","x":180,"y":280,"wires":[["27cc7b22e27e5b4f"]]},{"id":"d96505bee79ed87d","type":"debug","z":"858850f8.d94488","g":"5b5b9e4378990062","name":"hvac action?","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":610,"y":80,"wires":[]},{"id":"27cc7b22e27e5b4f","type":"api-call-service","z":"858850f8.d94488","g":"5b5b9e4378990062","name":"ON - Return Booster","server":"39dd3b2a.d5a744","version":5,"debugenabled":false,"domain":"fan","service":"turn_on","areaId":[],"deviceId":["43128e40993b123d0d8546b1302ccc5d"],"entityId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":640,"y":200,"wires":[[]]},{"id":"08432ba0f098e0d5","type":"api-call-service","z":"858850f8.d94488","g":"5b5b9e4378990062","name":"OFF - Return Booster","server":"39dd3b2a.d5a744","version":5,"debugenabled":false,"domain":"fan","service":"turn_off","areaId":[],"deviceId":["43128e40993b123d0d8546b1302ccc5d"],"entityId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":640,"y":260,"wires":[[]]},{"id":"4f572e574d20a12e","type":"inject","z":"858850f8.d94488","g":"860150cd3b6861e8","name":"Send \"idle\"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"idle","payloadType":"str","x":190,"y":320,"wires":[["08432ba0f098e0d5"]]},{"id":"3e79441a5f0bc67c","type":"trigger-state","z":"858850f8.d94488","g":"5b5b9e4378990062","name":"Ecobee (hvac_action) - Conditional","server":"39dd3b2a.d5a744","version":4,"inputs":0,"outputs":7,"exposeAsEntityConfig":"","entityId":"climate.thermostat_temp_ecobee_2","entityIdType":"exact","debugEnabled":false,"constraints":[{"targetType":"this_entity","targetValue":"","propertyType":"property","propertyValue":"new_state.attributes.hvac_action","comparatorType":"is_not","comparatorValueDatatype":"prevEntity","comparatorValue":"attributes.hvac_action"},{"targetType":"this_entity","targetValue":"","propertyType":"current_state","propertyValue":"new_state.state","comparatorType":"includes","comparatorValueDatatype":"str","comparatorValue":"heat,cool,off"}],"customOutputs":[{"messageType":"payload","messageValue":"heating","messageValueType":"str","comparatorPropertyType":"property","comparatorPropertyValue":"new_state.attributes.hvac_action","comparatorType":"is","comparatorValue":"heating","comparatorValueDataType":"str"},{"messageType":"payload","messageValue":"cooling","messageValueType":"str","comparatorPropertyType":"property","comparatorPropertyValue":"new_state.attributes.hvac_action","comparatorType":"is","comparatorValue":"cooling","comparatorValueDataType":"str"},{"messageType":"payload","messageValue":"idle","messageValueType":"str","comparatorPropertyType":"property","comparatorPropertyValue":"new_state.attributes.hvac_action","comparatorType":"is","comparatorValue":"idle","comparatorValueDataType":"str"},{"messageType":"payload","messageValue":"off","messageValueType":"str","comparatorPropertyType":"current_state","comparatorPropertyValue":"new_state.state","comparatorType":"is","comparatorValue":"off","comparatorValueDataType":"str"},{"messageType":"payload","messageValue":"on","messageValueType":"str","comparatorPropertyType":"current_state","comparatorPropertyValue":"new_state.state","comparatorType":"includes","comparatorValue":"heat,cool","comparatorValueDataType":"str"}],"outputInitially":false,"stateType":"str","enableInput":false,"x":200,"y":120,"wires":[[],[],["27cc7b22e27e5b4f","d96505bee79ed87d"],["27cc7b22e27e5b4f","d96505bee79ed87d"],["08432ba0f098e0d5","d96505bee79ed87d"],["41bcd6ed56311ab1"],["41bcd6ed56311ab1"]],"outputLabels":["","","heating","cooling","idle","off","on"]},{"id":"280e2412f951d649","type":"inject","z":"858850f8.d94488","g":"860150cd3b6861e8","name":"Send \"heating\"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"heating","payloadType":"str","x":180,"y":240,"wires":[["27cc7b22e27e5b4f"]]},{"id":"41bcd6ed56311ab1","type":"debug","z":"858850f8.d94488","g":"5b5b9e4378990062","name":"hvac on/off?","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":610,"y":120,"wires":[]},{"id":"39dd3b2a.d5a744","type":"server","name":"Home Assistant","addon":true}]
1 Like