Skip to content

Is it possible to react with Pyscript to a long press at a switch? #529

Answered by JacobLChrzanowski
wrfz asked this question in Q&A
Discussion options

You must be logged in to vote

You can but you need to know what events your device is firing first. What's your event provider? Is it Zigbee HomeAssistant (zha)?

In my case I was able to look at the event types coming from zha_event on this endpoint, http://homeassistant.local:8123/developer-tools/event and have my pyscript service fire on every event, then filter out the events I don't care about, and action on those I do care about.
This image shows the event fired from an Ikea Tradfri E1810 5 button remote.
I correlate remote to zha_event event via the device_id field, and the type of event (button up/down/press/hold) via a combination of command+args fields.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@wrfz
Comment options

@JacobLChrzanowski
Comment options

@JacobLChrzanowski
Comment options

Answer selected by wrfz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants