I’m loosing the will to home automate and have a bag full of frustration…
Setup since a few weeks (out of interest and tinkering):
External Zigbee antenna device (plugged in via ethernet)
Mosquitto Proxmox LXC
Zigbee2MQTT Proxmox LXC
Home Assistant OS Proxmox VM with MQTT integration
When I have time and are in the mood I move devices from my old ZHA RaspberryPi to my new setup and so far it worked fine and is fun to interact a bit more with the underlying protocol.
Today I moved my Hue switch v2 (the first “action” device) and the light bulbs in the bedroom - so far so good.
But the automation drives me crazy and I dont get a hold on the MQTT actions at all!
Can anyone shove me in the right direction on how to implement for example double-click and long-click - besides the normal click - to activate a scene?
I dont mind putting time and effort in to write these things, since I want to understand it and thus don’t use blueprints. But at the moment I feel hard stuck.
Any advice is appreciated.
Please help a fella in need before his girlfriend comes back from vacation
It’s a little more work to parse the JSON payload, however if you use the same type of switch throughout your place parsing the JSON is a one time task.
It also means that you don’t have to worry about device support - if the device sends the message you get it / can handle it.
Yesterday morning I spend 10 minutes with a fresh mind at it and almost immediately worked out the solution - and more importantly the syntax - for the direct MQTT action approach. Which once more shows if you get in a bad state you should call it quits and get back to it with a fresh head.
I didnt get to read the post 123 linked but I will do so the next days.
What do you mean with “It’s a little more work to parse the JSON payload”?
Atleast for the one-click actions I just went with:
I guess where you are heading is my next question with the double-press and long-press?
The idea with the wait_for_trigger and timeout is interesting and I’m wondering if there is an already bullet proof solution out there to handly e.g. exactly a double-press in 0.5 seconds or a long-press with atleast 1 second.
Look in the Blueprint Exchange section of the forum. There are several available for Philips Hue dimmer switches. Review their descriptions and select whichever one meets your needs best (ensure it supports “Z2M” → Zigbee2MQTT).
They all use some variation of the technique I had described above to detect multi-press and long-press button events.
Worst case, pick the closest fit and then modify it.
NOTE
If you’re unfamiliar with the concept of blueprints, review this documentation.