Check if entity exists

What would be the best method to determine if an entity_id already exists in Home Assistant?

You could probably use the get entities node. Usually NodeRed should autopopulate your HomeAssistant entities anyway.

That is the node I’ve been focusing on. It will return a count value if the entity exists but I can’t figure out the proper payload input format. Looks like it needs an array but everything I’ve tried hasn’t worked.

The entities I’m searching for are dynamically created during runtime so I can’t use the auto-populate feature with hardcoded values in the service call since they don’t exist yet.

try this:

[{"id":"d6363d44.faf07","type":"ha-get-entities","z":"6b8efe0d.bc75e","server":"2fba4297.e4145e","name":"","rules":[{"property":"attributes.friendly_name","logic":"includes","value":"Wohnzimmer","valueType":"str"}],"output_type":"array","output_empty_results":false,"output_location_type":"msg","output_location":"payload","output_results_count":1,"x":770,"y":1720,"wires":[["22bbe09e.b60c8"]]},{"id":"df5ac6fa.e0b928","type":"inject","z":"6b8efe0d.bc75e","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":560,"y":1720,"wires":[["d6363d44.faf07"]]},{"id":"22bbe09e.b60c8","type":"debug","z":"6b8efe0d.bc75e","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":930,"y":1720,"wires":[]},{"id":"2fba4297.e4145e","type":"server","z":"","name":"Home Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true}]