When making automation is one better to use than other
here is an example of 2 different approaches to turn on light just wondering if I should be using one more than the other. especially for speed example when using it based on a trigger of motion detection
Just curious…
It also lets you template the entity_id option for the situation where you need to compute which entity, or entities, will be used.
A recent addition is the Device Action. Device-oriented operations were introduced to allow a user to use the UI to explore a device’s entities and the actions that can be performed with those entities. To achieve all of that, the Device Trigger, Device Condition, and Device Action were developed. All were designed to be used via the UI as opposed to manually, in a text editor. For example, the device_id is not something easily found (it’s located in a hidden file) and even less convenient to type out manually. However, no one expects a user to do that; the UI finds it for them.
Although Device-oriented operations are created via the UI, they are stored as YAML. That’s what you see here:
However, you’re not supposed to modify a Device Trigger/Condition/Action manually. I’ve seen users attempt to add templates to it with predictable results (failure). If you find yourself editing it, you need to use something other than a Device-oriented operation.
As for performance, I doubt there is any meaningful difference.
FWIW, I never use the UI to compose automations or scripts so nothing I have employs Device Trigger/Condition/Action.
Old thread, I know, but a related question around this topic:
I have these 2 automation actions, and they seem do the same thing: to turn on a light switch. I read it somewhere that switching entities is recommended, but why?
Because entities are predictable. If a device fails, you can replace the device and change the new device identity_id to the old one, and your automations, dashboards, history, … all remains unaffected. However, the new device will have a new device_id, and that is impossible to change.