I am racking my brain to understand why I cannot obtain the friendly name of a device. Below is part of a flow that I am building that will eventually use presence faker to turn on a random light.
I would like the ability to receive a notification when presence faker turns on the light, but would like the notification to display the friendly name of the light (as opposed to the entity_id).
[{"id":"76cba0a83a45b40c","type":"debug","z":"122694966b64ef3b","name":"Show Light State","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"data.attributes.friendly_name","targetType":"msg","statusVal":"","statusType":"auto","x":950,"y":660,"wires":[]},{"id":"e27019e1d4ea223c","type":"api-current-state","z":"122694966b64ef3b","name":"Get Light State","server":"6e751b1b.8f17c4","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"{{entity_id}}","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":750,"y":660,"wires":[["76cba0a83a45b40c"]]},{"id":"1ea3ab6485400042","type":"change","z":"122694966b64ef3b","name":"Set Entity ID","rules":[{"t":"set","p":"entity_id","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":660,"wires":[["e27019e1d4ea223c"]]},{"id":"7d195e77844705b8","type":"api-call-service","z":"122694966b64ef3b","name":"Turn On Light","server":"6e751b1b.8f17c4","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["{{payload}}"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"{{payload}}","valueType":"str"}],"queue":"none","x":350,"y":660,"wires":[["1ea3ab6485400042"]]},{"id":"81556aca9e5634db","type":"inject","z":"122694966b64ef3b","name":"Inject Random Light","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"light.kitchen_island_lights_2","payloadType":"str","x":150,"y":660,"wires":[["7d195e77844705b8"]]},{"id":"6e751b1b.8f17c4","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}]
I would think I could pass the entity_id into the get state node and retrieve all the information, but that does not seem to work.
Any thoughts?