The first “push” event on a newly imported push button does trigger the correct event; but subsequent ones (including double tap and hold) only trigger a lastPushed event, not a pushed one… Makes the button a little useless… See image for a newly imported device; first push returns all the correct information; second one just the lastPushed update.
What’s the device? I’m not seeing this behavior with the buttons I imported from z2m.
Yeah, when you use MQTT export app with a button, it just shows the press event on Home Assistant but no pressable button entity. I got around this by having Gemini create my own virtual button device which creates a proper button in HA. I can post the code later if you like, I don't have GitHub set up yet.
I was able to work around that by relying on HADB and writing my own HADB driver, yes - that after enabling a couple of event-related things on the z2m side. But that’s a different story; this is about the Hubitat mqtt integration - no HA involved.
Here is the image with the z2m setting I had to enable to make HA deal with the button properly (under Settings > HA Integration).
If the driver doesn't use isStateChange: true in sendEvent, it will not send the event if the attribute already has the value being sent.
sendEvent(name: "yourAttribute", value: "yourValue", isStateChange: true)
If you have access to the driver code, you can add that to the sendEvent.
I wish I had access to the mqtt drivers Hubitat mqtt import creates/relies on…


