Hi All,
recently expanded my zigbee network with a number of Xiaomi/Aqara temp sensors and all worked well straight out the box with my Nortek Zigbee/Z-wave Dongle connected to my NUC.
Now i have purchased 4 smart buttons from Xiaomi (Mija Buttons) and i cannot get these to work. It is paired with HA and the battery shows in the devices list. When watching the Zigbee logs i can see the different button pressses being registered but there is no device in my list where i can see this on off. Am i meant to create my own and if so how/where to start? (expected sensor to show)
There is no Xiaomi gateway this is directly connected to HA by ZHA interface so solutions which suggest Smartthings or Gateway push MQTT i cannot work out how to implement.
Pretty sure button presses are going to come as events.
Check out that section on the wireless button.
There is no state to this button. There is no on/off.
If you want to use it as a switch to control a light, you’d have to create a template_light. You would use the light as the state somehow (light sensor would work well, or just guess). Then you could tie the command_on/command_off to the button.
To explain how to handle the events:
- alias: Toggle dining light on single press
trigger:
# When the button is pressed, do something
platform: event
event_type: xiaomi_aqara.click
event_data:
entity_id: binary_sensor.switch_158d000xxxxxc2
click_type: single
action:
# What to do when the button is pressed
service: switch.toggle
entity_id: switch.wall_switch_left_158d000xxxxx01
Thank you very much all, @jocnnor was correct it was the zha_event type I then needed to filter.
However i struggled with identifying what i wanted in HA and the Events tab, once i moved over to Node-Red as suggested it was dead easy to see what i needed to.
Now have 4 of these buttons i can set up and each has options of single/double/triple/quadruple/furious i can set different actions for.
Much appreciated for all the help
Hi there - could I revive this? I’ve just been using ZHA to pair one of these Xiaomi buttons, and I too get a sensor for the battery, but no entities for the button switch itself.
Now, in one sense, this doesn’t matter, because it does generate zha_events, so I can write code to trigger on it.
But an identical button, which I added perhaps a year ago, did get a sensor entity of its own for the button, which means I can use its name in automations, rather than its IEEE ID. So either the functionality has been lost from HA, or perhaps there’s been change in firmware in the button? The two devices look pretty identical from what I can see of model IDs etc. The entries in core.device_registry are identical except for the MAC addresses.
I’m wondering if there’s a way I can give it an entity? Perhaps I should try editing core.entity_registry… but I wondered if there was an official way…
how did you do this? I have a Zigbee remote (Sengled) paired with ZHA and I want to listen and identify the buttons. I’ve installed node-red but i can’t figure out that part…
@ShaneSpina
You don’t have to use NodeRed.
In the Integration-ZHA select the button which gets you to the device page of it.
Click on Automation+ sign and it shows the events, you can easily auto generate an automation from here using the UI.