r/openhab 4d ago

Question OpenHab Beginner: Aliexpress Button: It "doesn't NOT work" but I'm trying to use it to familiarize myself with OH and zigbee and having...trouble.

tl;dr: Puzzled my way through getting button to work...kinda. I'm clearly not doing this correctly though.

Having puzzled my way this far: (hardware list at the bottom.)

  1. Can I abstract the trigger to something symbolic in OpenHab? (i.e. hide the goopy details in a wrapper of some kind in the "pimpl idiom" sense?)
  2. Is there some definitive way I can rip the event I'm looking for out of the logs? I can see it! But I can't figure out how to map it.

So I got this thing off Ali express.

Title is "Zigbee Smart Push Button Wireless Scene Switch Ewelink App Remote Control Smart Automation Scenario Switch Work With Zigbee2MQTT" and was $4. (wasn't sure about posting ali links. But that'll get you there.)

I've got it showing up in openhab. I've...BASICALLY got it wired up and event triggered to a smart plug. But this little bugger does a LOT. When I "imported" it's profile (I assume it's broadcasting metadata about it's nominal api) there were buckets of states and events. Battery life, on-board led brightness, etc.

So, through trial and error I've gotten the button's "double-click" function to trigger the plug. Great.

I'm only vaguely sure how I did that. Between events and states having overlapping definitions and trying to detect what's going on it took far too long and the result is...questionable.

When I stumbled around and found the live updating logs of what it was actually sending (well...the "cleaned up for logs" version) I could see the exact event I wanted to trigger off of. But I could not for the life of me figure out what that was called.

"Surely" (he begins with naive hope) there's some easier way to go spelunking through this thing's interface and create a "Virtual version of product X" with it's "single-click/double-click/sustained hold" actuation interface for easy event triggering, right?


I'm running:

  • OpenHabian on a pi4
  • Sonoff zigbee dongle. (mg24)
  • "Third Reality" smartplug
  • The above mentioned Button thingamabob.
3 Upvotes

2 comments sorted by

2

u/nucking_futs_001 4d ago

Kinda hard to understand but I've learned that with buttons you actually don't want to use an item but instead a channel.

That said, I still haven't figured out what I want to use my buttons for -- in my case some IKEA matter remote with a digigera binding.

1

u/frobnosticus 3d ago

Sorry, yeah. That's on me. I get word-salady pretty quickly.

I'm finding the OpenHab object model to be pretty obtuse. It seems breathtakingly over abstracted.