Hi!
I’m new to HA and shelly devices.
I installed shelly switches, conefcted them to WiFi, static IP (192.168.0.201 and 202)
I set Device name in shelly web configuration to “stik201” and “stik202”.
Both have a button (not a switch) connected to them, so I set them to “momentary” type.
Then I started HA.
Configuraton - Devices: I see both stik201 and stik202
Dashboard: I have a card and both switches on the card and it works, I can torn them on/off
In device settings in HA I have
Name: stik201
Entity ID: switch.stik201
and
Name: stik202
Entity ID: light.stik202 # this one is dimmer
Then I try to create automation, so when I do a long press on “stik201Ž” it turns off both.
I start to create automation in UI, then switch to yaml view.
And it works, IF I use:
trigger:
- platform: event
event_type: shelly.click
event_data:
device: shelly1-A4CF12F48A96
channel: 1
click_type: long
condition: []
action:
- type: turn_off
device_id: b6a4f2e720f88661fe7a189525e7566e
entity_id: switch.stikalo201
domain: switch
- type: turn_off
device_id: 4bf1a07157f48a597316321c22f7c130
entity_id: light.stikalo202
domain: light
mode: single
But it is not very “friendly” to have names like “4bf1a07157f48a597316321c22f7c130” and “shelly1-A4CF12F48A96”
I tried with
trigger:
- platform: event
event_type: shelly.click
event_data:
device_id: b6a4f2e720f88661fe7a189525e7566e
But it does not work with:
trigger:
- platform: event
event_type: shelly.click
event_data:
device_id: switch.stik201
Is there a way to write this automations with “stik201” and “stik202” names?
Did I forgot to define something?
Thx Jure