To add - if I select “RUN” within the automation, the light goes on and off as desired, so it looks like it is a communication / integration / hardware issue and not a coding problem. But how to determine what needs fixing?
I’m guessing you are puzzled because there is no state information for your ‘switch’ in the device info?
What you have is technically a momentary button. It doesn’t have a state - it’s not on or off. It does fire events though - which is why the automation works.
This is different to, say, a light switch which typically toggles on and off and stays in the on or off position. Because of this such a switch will have a state.
Thanks @templeton_nash - I understand what you are saying, but the automation only works if I select (ie click on) “RUN” - it does not work if I press the button. So there is a lack of communication between the button and HA, but this is the first time I have used Zigbee or ZHA, and can’t work out why
Thanks again, @templeton_nash . I dug a bit deeper and saw that the button was “Offline”, so took the back off & re-paired it, and it now works perfectly. And now even the battery state shows up - Double Plus Good.
I can see that these Aqara switches are going to become quite addictive too!
I paired my Aqara Mini Switch with Zigbee2MQTT and imported the blueprint. When I try to create an automation, however, the pulldown menu for Device is empty so I cannot assign this to a button.
I’m a little new on HA using ZHA and have setup a lot of aqara door and motion sensors on Alarmo and it all works fine. When I pair the Aqara Mini Switch only see Battery (as a lot of people). I imported your Blueprint from github and that all went well. I see it on my Blueprint list in UI. I clicked on create animation for it and filled out the form with the button device. Wasn’t sure how to fill out the Action. I selected Event and saved. Went to dev tools events and looked for zha event. Pressed the button and see no event. I’m sure I messed something up. Can you help on this? Thanks
Update: Found solution, use the aqara_zigbee_button.yaml blueprint!
For me it worked, if I don’t try to setup an automation starting from the blueprint, but from the device itself.
So go to the device page and click in the automations tile on the “+”. There you can select the event and assign an action to it. Nothing needs to be setup in the blueprint at all.