The sensor
node has been renamed to entity
and a new type switch
has been added. Requires the NR custom component version 0.4.x or newer.
Some of the possible uses for the switch entity:
- Start a flow using the service call
nodered.trigger
. This can be used in any place that you can do a service call (e.g. Node-RED, lovelace). When a switch is triggered the output path will depend on if the HA switch is on (top) or off (bottom).
- As a switch node where the condition is if the HA switch is on/off.
Sample Flow using the new switch entity:
[{"id":"b1ddb7a.6547548","type":"inject","z":"56b1c979.b2c618","name":"Toggle Switch","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":182,"y":224,"wires":[["dfb609e7.8f9f38"]]},{"id":"dfb609e7.8f9f38","type":"api-call-service","z":"56b1c979.b2c618","name":"Toggle Switch On/Off","version":1,"debugenabled":false,"service_domain":"switch","service":"toggle","entityId":"switch.nodered_entity_switch","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":388,"y":224,"wires":[[]]},{"id":"ae4f1ef6.1afcf","type":"inject","z":"56b1c979.b2c618","name":"Trigger Switch","topic":"","payload":"{\"data\": {\"entity_id\": \"switch.nodered_entity_switch\"}}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":182,"y":272,"wires":[["9d8bb1d9.47b08"]]},{"id":"9d8bb1d9.47b08","type":"api-call-service","z":"56b1c979.b2c618","name":"nodered.trigger switch no payload","version":1,"debugenabled":false,"service_domain":"nodered","service":"trigger","entityId":"","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":428,"y":272,"wires":[["cdf62164.236c7"]]},{"id":"52ad42c3.813b0c","type":"ha-entity","z":"56b1c979.b2c618","name":"","server":"9c202bd8.b64db8","version":1,"debugenabled":false,"outputs":2,"entityType":"switch","config":[{"property":"name","value":"nodered_entity_switch"},{"property":"device_class","value":""},{"property":"icon","value":"mdi:airplane"},{"property":"unit_of_measurement","value":""}],"state":"payload","stateType":"msg","attributes":[],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":358,"y":160,"wires":[["cd9b188.f1707e8"],["441482ca.d5a8dc"]]},{"id":"cd9b188.f1707e8","type":"debug","z":"56b1c979.b2c618","name":"on","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":514,"y":144,"wires":[]},{"id":"6ef82461.aaf80c","type":"inject","z":"56b1c979.b2c618","name":"Input to Switch","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":192,"y":160,"wires":[["52ad42c3.813b0c"]]},{"id":"441482ca.d5a8dc","type":"debug","z":"56b1c979.b2c618","name":"off","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":514,"y":176,"wires":[]},{"id":"cdf62164.236c7","type":"api-call-service","z":"56b1c979.b2c618","name":"nodered.trigger switch object payload","version":1,"debugenabled":false,"service_domain":"nodered","service":"trigger","entityId":"","data":"{\"payload\": {\"abc\": 123}}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":438,"y":320,"wires":[["ab5d1645.d48538"]]},{"id":"ab5d1645.d48538","type":"api-call-service","z":"56b1c979.b2c618","name":"nodered.trigger switch string payload","version":1,"debugenabled":false,"service_domain":"nodered","service":"trigger","entityId":"","data":"{\"payload\": \"abc\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":438,"y":368,"wires":[["24987085.42514"]]},{"id":"24987085.42514","type":"api-call-service","z":"56b1c979.b2c618","name":"nodered.trigger switch boolean payload","version":1,"debugenabled":false,"service_domain":"nodered","service":"trigger","entityId":"","data":"{\"payload\": true }","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":448,"y":416,"wires":[["beb6e063.28cbb"]]},{"id":"beb6e063.28cbb","type":"api-call-service","z":"56b1c979.b2c618","name":"nodered.trigger switch number payload","version":1,"debugenabled":false,"service_domain":"nodered","service":"trigger","entityId":"","data":"{\"payload\": 123 }","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":438,"y":464,"wires":[[]]}]
Changelog
Features
-
entity: Rename sensor node to entity and add new entity type switch (059c340)
-
wait-until: Entity Id can be a exact match, substring or Regex match (9738bb5)
-
wait-until: Timeout property can be a JSONata expression to allow for dynamic timeout values (9dcbe1a), closes #206
Bug Fixes
- Prior to 0.90.0 is_admin doesn’t exist check for it to exist and not true (3f07f55), closes #207
0.21.1 (2020-02-26)
Bug Fixes
- fix breaking change caused by rebranding hassio (c6dcaac)
0.21.2 (2020-02-28)
Bug Fixes
-
wait-until: use correct entity id for check against current state (f2d47c5), closes #210
0.21.5 (2020-03-09)
Bug Fixes
- Use correct entity type when removing node from integration (f842578), closes #217
For those that enjoy my work.