I have a group which consists of the two people in my house. It tracks whether or not we’re home or away.
I’m using it in NodeRED to check if someone is home before making an announcement via my Google Home, but for some reason in this particular flow it returns the value ‘idle’ instead of ‘home’. Here’s the problematic flow:
[{"id":"f7c2b5d6c4d5b85c","type":"api-current-state","z":"98224c63c49e6306","name":"anyone home?","server":"b1fcdc06.6fce2","version":3,"outputs":2,"halt_if":"home","halt_if_type":"str","halt_if_compare":"is","entity_id":"group.people","state_type":"str","blockInputOverrides":false,"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":920,"y":1320,"wires":[["f448f0a7c99cb929"],[]]},{"id":"46a387fc68e78528","type":"api-call-service","z":"98224c63c49e6306","name":"set washing machine to complete","server":"b1fcdc06.6fce2","version":5,"debugenabled":false,"domain":"input_select","service":"select_option","areaId":[],"deviceId":[],"entityId":["input_select.washing_status"],"data":"{\"option\":\"complete\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":660,"y":1320,"wires":[["f7c2b5d6c4d5b85c"]]},{"id":"f448f0a7c99cb929","type":"api-call-service","z":"98224c63c49e6306","name":"voice alert","server":"b1fcdc06.6fce2","version":5,"debugenabled":false,"domain":"media_player","service":"play_media","areaId":[],"deviceId":["d491efc792b60aa480bbc21cb0ec6f6e"],"entityId":[],"data":"{\t \"media_content_id\": \"media-source://tts/google_translate?message=The+washing+is+done\",\t \"media_content_type\": \"provider\"\t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1110,"y":1320,"wires":[[]]},{"id":"8c7e09119cce6823","type":"switch","z":"98224c63c49e6306","name":"washing timer?","property":"payload.entity_id","propertyType":"msg","rules":[{"t":"eq","v":"timer.warm_wash_timer","vt":"str"},{"t":"eq","v":"timer.cold_wash_timer","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":380,"y":1320,"wires":[["46a387fc68e78528"],["46a387fc68e78528"]]},{"id":"0d9bfd915e9cc050","type":"server-events","z":"98224c63c49e6306","name":"","server":"b1fcdc06.6fce2","version":2,"eventType":"timer.finished","exposeToHomeAssistant":false,"eventData":"","haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"waitForRunning":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"$outputData(\"eventData\").event_type","valueType":"jsonata"}],"event_type":"","x":140,"y":1320,"wires":[["8c7e09119cce6823"]]},{"id":"b1fcdc06.6fce2","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30,"areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]
Here’s the beginning of another flow where it works as expected and returns the value ‘home’ if someone is home:
[{"id":"b03fc729cce98930","type":"sun events","z":"3db06f140f6b12ce","testmode":false,"verbose":"N","topic":"","name":"","x":310,"y":200,"wires":[["e21c3c8e3661c46a"],[]]},{"id":"e21c3c8e3661c46a","type":"switch","z":"3db06f140f6b12ce","name":"sunset?","property":"payload.sunevent","propertyType":"msg","rules":[{"t":"eq","v":"sunsetStart","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":480,"y":200,"wires":[["0e4603c2b1dd1913","7ea42a94649ea5d2"]]},{"id":"0e4603c2b1dd1913","type":"api-current-state","z":"3db06f140f6b12ce","name":"someone home?","server":"b1fcdc06.6fce2","version":3,"outputs":2,"halt_if":"home","halt_if_type":"str","halt_if_compare":"is","entity_id":"group.people","state_type":"str","blockInputOverrides":false,"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":650,"y":200,"wires":[["ed40efccbebd5f69","8c51f198d8e8ec35","437bc73a5427ce33","b32161a5fb4e1202","8fc1adaf0c7983ff"],["2a127552d448fde4","30bc4951b40f934b"]]},{"id":"4139b1e4182d2c72","type":"inject","z":"3db06f140f6b12ce","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"7200","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":130,"y":200,"wires":[["b03fc729cce98930"]]},{"id":"b1fcdc06.6fce2","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30,"areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]
Does anyone know why, in the first flow, the entity isn’t behaving as expected? I’ve checked in the entities page of Home Assitant and group.people is definitely set to ‘home’ even when the first example is returning ‘idle’.
Thanks in advance for any advice you can provide.