I moved my HA to a Raspberry Pi 5, after some hardware issues, it seems to be working again. However, my automations don’t seem to be working.
I assumed this was because the device ids have changed, but recreating the automations didn’t solve the problem and the Yaml looks the same before and after.
What is the exact thing you’re trying to send the turn_on to? A switch? If so, I would expect the entity_id to look very different: switch.xxxx. Also, I have not seen device_id passed for this kind of purpose. What integration do the devices (switches, I assume) come from?
corrected “intestine” to “I assume” - lol.
Is that actually the entity_id you see when you look the entity up in Settings?
The automation is controlling an Insteon device(s).
The new automations i created look identical to the old automations, but i assume that HA may have updated the device ids when i reinstalled HA.
I was trying to find the id attached to the device, so i could see if it matched the automation. I obviously didn’t look hard enough. I suspect you are correct that it is a device id issue, as the ‘Then’ statement does not run.
I need to look at the log to see what error I’m getting.
When you use device ids all it does is find the device and then select the entity that is set as the default entity for that device.
You can select the entity id directly and avoid the problems in the future, because if you move hardware again or replace a device you are back to this problem.
device ids can’t be changed on the device. Entity ids can be renamed, so you can just rename the entity to what the old entity was named and everything will work again.
It’s not device ID, I am 99% sure; and I leave the 1% only in case there is some weird legacy thing going on.
If you got to Settings → Devices & services, you’ll find an Entities tab that lists all of your entities (and it’s searchable). Find your entity, click on it, and find the gear icon. There you should find an Entity ID field that you can, if you choose, edit. It will almost certainly be prefixed with “switch.” (and you can’t change that part).
I doubt you should be passing a device_id field but I can’t be certain since I don’t know that vendor’s products.
Once you are sure you’ve got the right entity_id, we should be able to figure out the rest.
It is not a “legacy thing”, it is a device action, which is the action type at the very top of the list when using the visual automation/script editor. They are meant to be easy to use in the visual editor but unfortunately results in near unreadable YAML as they use the hidden hardcoded ids for not only the device but also the entity it really operates on.
The visual editor also allows for creating device triggers and device conditions, with the same intent (ease of use), limitations (no templates) and resulting awful YAML.