#Template (or Blueprint) to make helpers that create virtual button states from generic zha buttons?

1 messages · Page 1 of 1 (latest)

vocal cave
#

I think I'm in the right spot, please correct me if wrong. I'm looking to see if their are templates, scripts, or blueprints that would make it easy for a rookie, like me, to create custom virtual button presses from a simple device? I have a pile of Ikea e1766 (open/close curtain button) and the way they work really only allows for short button presses natively. Looking at other blueprints for other devices, I think there should be a way to set up automations that create a Helper state that has smarter logic (double button press, long presses, etc) and then I can just use that helper in automations. And that template can be copied to set up helpers for each of my buttons.

I am out of my expertise on this. I don't know any coding languages and my only knowledge comes from playing with my Home Assistant over the last couple years. I'm pretty sure this is all possible and would be trivial for most of you. But my capabilities so far have only made it to pretty simple yaml editting, and implementing other's Blueprints.

thin river
#

it really depends on how the button behaves when you press it in HA.

#

if we only get a single event when it's originally clicked, there's not much you can add to make it smart

#

if it supplies a start and an end to the button press, then you can do something

#

if you just have a start, the best you can do is attempt to make double tab and tripple tap automations but it won't be easy

vocal cave
#

So it's not as simple as calculating how many 'starts' there are in a given time period?

thin river
#

You likely have to create an automation or template entity that has a series of wait for triggers

vocal cave
#

The button provides the following:
when pressed once - "Short Press"
when long pressed - "Short Press" immediately, then followed by "Long Release" when you finish the long press.

The problem I've run in to is that the "short press" always fires so any automation that uses "short Press" also get's triggered when you do a long press.

#

The additional headache is that it fires a "stop" event that I can't quite figure out. I think it's got some time logic involved because I can fire "short" presses one after another, but sometimes it tosses in that "stop" event

ex.
press - "short" event
press - "short" event
press - "short" event
(some marginally longer delay between presses)
press - "stop" event
press - "short" event

thin river
#

I'm not sure how you can overcome that issue

#

without waiting for the long release, making the delay in your automations always delayed by the duration of a long release

#

are you sure there isn't options for the device to change that behavior?

vocal cave
#

I'm not sure. How would I check for behaviour changes?

#

This is the first zigbee interaction I've had. Just plugged in and set up my zha dongle this week.

thin river
#

what kind of device is it

#

what integration does it connect through

vocal cave
#

Nabu Casa zbt-1 (ZHA)

#

and it's an ikea e1766

thin river
#

I'm not familiar with ZHA but I would assume there is settings on the device page

#

that z2m, not Zha

vocal cave
#

yeah, I see that it's z2m, but it seems to give me some more understanding into the device itself.

thin river
#

All the info on that page is Z2M behavior not device behavior

vocal cave
#

ah, thanks.

thin river
#

in regards to the click events

vocal cave
#

as for managing the device in zha, I do see a Manage Zigbee device section that has tons of things in it like "clusters", "bindings", and "signature". Is that what you are talking about?

thin river
#

I don't know much about ZHA

#

I use Z2M