I am new to HA. I got 23 shelly devices loaded in HA after some time. Now I want to do the next project.
The I tried to get an automation for the shelly button to activate a non shelly device. But I get no actions after setting up clicks for 1,2,3,long press.
The shelly button is probably using the event bus of HA and not the state machine.
This means you need to open up the developer tools in HA and click on the event tab.
On the event page you then enter * in the listening field to listen for EVERYTHING.
Click the listen button and then the shelly button and quite quickly the listen button again to stop the listening.
Now you will have a list of events and you need to find those for the Shelly button
Once you found it then you can replace the * with something from the captured shelly button event to filter everything else out.
With the captured events you can use an event trigger in your automations.
Wally
Thanks for responding. I followed the instructions and got some events from scripts.
I waited five minutes. Checked the button was triggering the lites but the only scripts I got were the following for the lites going on/off. Nothing about press once/twice or button clicks.
Stuff about sun.sun. other lights, device tracker. Are the clicks in this script or am I missing something?
But nothing in the 30 events about the Shelly button I was pressing.
Any suggestions I what I try next?
Ash
=========== Extracted Script ====================
event_type: state_changed
data:
entity_id: switch.travel_photos
old_state:
entity_id: switch.travel_photos
state: “on”
attributes:
friendly_name: Travel Photos
last_changed: “2024-01-18T07:05:05.556609+00:00”
last_updated: “2024-01-18T07:05:05.556609+00:00”
context:
id: 01HMDP6FRMVZGS5Q5NR5E9NTJ2
parent_id: null
user_id: null
new_state:
entity_id: switch.travel_photos
state: “off”
attributes:
friendly_name: Travel Photos
last_changed: “2024-01-18T07:05:38.553511+00:00”
last_updated: “2024-01-18T07:05:38.553511+00:00”
context:
id: 01HMDP7FZS1V1BY80VFVS32FRJ
parent_id: null
user_id: null
origin: LOCAL
time_fired: “2024-01-18T07:05:38.553511+00:00”
context:
id: 01HMDP7FZS1V1BY80VFVS32FRJ
parent_id: null
user_id: null
30 events only in 5 minutes?
Sound like HA is cutting the list off.
The button press should be pretty much instantaneously, so click the button and stop the listening and then look through the list again.
From the post you link to in the beginning it looks like the event you should listen for is shelly.click, so try to put that in the listening field instead of *
Have you restart HA after adding the shelly button?
If you have then the page where you enter * in the listening field should have a shelly.click listed in the list to the right.
Shelly button was loaded over a week ago. It has the the four automations set up with basic turn light on/off. But nothing works when I press the buttons.
The list to the right in the events active listeners shows shelly.click (3 listeners). But when you click on it nothing happens. After a minute i get the following (see image).
I tried that as you can see in the image below… But it will not let me start listeneing until I enter * in the Listen to field. Then it show no click events and gives me other events eg as shown, sun.sun etc. No click events.
What shoud happen?
What can I do to make that happen as the automations are in HA but on clicking the button, the lites do not turn off/on.
I did find this in the log book (see ist iomage and from the listening I found these entries for the travel lites. But no mention of the laundry lite, which is my other lite for testing.
Why it is rebooting is a mystery to me. The lite goes off/on in google home and in the shelly app.
I am at a loss to why you can not see the events.
It is quite normal for it to become unavailable all the time. It is done to save power. You can change that on the button setup, but it will quickly kill the battery.