In some automations it has
device_id: 91a3256852a8az9ecf3468fb9360
entity_id: light.library_light
When I change the base light.library_light, the device_id changes, but the automations will have the old one.
Does it matter? Since there’s no easy way to search all instances of it.
Seems like it matters, but annoyingly there’s no way to show what is wrong or right. Watchman doesn’t check it.
It shows like it’s working, but if you open the device is empty.
Makes no sense to use 2 things to name an item.
tom_l
April 19, 2023, 2:31am
3
That’s not the only issue with them. Solution: Don’t use device triggers, conditions or actions.
It’s a big problem that you can avoid by not using device triggers, conditions or actions. There are always other triggers conditions and actions you can use instead.
e.g. instead of a device turn on trigger use a state trigger.
If you only ever use entity_ids in your triggers, conditions and actions then when you have to replace the device you can change the new entity id to match the old one in one place and all your automations keep working.
If you use device ids you have to change all of …
1 Like
I see. SO I’ll try to change from
type: turn_on
device_id: 18e1age096bew23404e
entity_id: light.hallway_light
domain: light
brightness_pct: 35
to
service: light.turn_on
data:
brightness_pct: 35
target:
entity_id: light.hallway_light
Everything is via a service then?
And I guess it’s all manual changeover?
I’m interested to know why there are service: .turn_on
rather than just everything.turn_on
tom_l
April 19, 2023, 5:36am
5
There is a service to turn anything on, homeassistant.turn_on
. Likewise for off and toggle. This is handy if you are changing more than one entity and they are from different domains (e.g. a light and a switch).
Is there a service for this?
switch: sensor.smart_knob_living_action
button_rotate_right:
- device_id: 1a039dzsg4bbecb35wab
domain: light
entity_id: light.living_room_light
type: brightness_increase
tbh it doesn’t seem to work well.
tom_l
April 19, 2023, 7:17am
7
- service: light.turn_on
target:
entity_id: light.library_light
data:
brightness_step_pct: 10