Hubitat's button implementation

Just use a Contact Sensor with external wiring connections. Problem solved.

@mike.maxwell beat me to it! :wink:

1 Like

I understood this in the first place. My question was mere curiosity since it was all about how it was possible that the firmware could be designed like this while it had to have a 0 and 1 states of its digital port being read when pressed and released (hence the mock C code in my post above).

Okay. I understand now. Yes, the firmware of the device is simply watching a digital input and then applying some timing logic. If the input goes high and low in less than the 'heldThresholdTime', then send 'pushed', else send 'Held'.

My Arduino Code with HubDuino does exactly this in order to support both 'pushed' and 'held' button events. If you're curious, the code is available in my ST_Anything github repository as the IS_Button.cpp file.

That's what I did but it's bulky. I was hopping for a more elegant and easy to implement solution. For years I had a contact sensor doing this using my app "Thermostat manager" but I find it awfully ugly and far too binary which results in false positives due to the weight of the mattress. Also tried

Another solution, which has been working for a couple days has been to use a resistive film pressure sensor on a 30"*30" aluminum plate (from an old 3D printer) with a couple layers of foam tape strong enough to push the plate back against the bed but soft enough to receive pressure from body weight. It works but... 30x30... It's big... :slight_smile:

1 Like

Oh, don't get me wrong, I've been using and abusing your libraries for years @ogiewon! You're a star to me!

1 Like

Have you looked at the Withings device for the bed? The following is a pretty new integration that eliminates IFTTT, which folks had been using.

1 Like

Hi everybody,
Am I missing something or is there something missing in this implementation? I can't call for hasCapability() or hasCommand() for any of my buttons... Smartthings buttons. Is this normal?

buttonPause.hasCapability("PushableButton") or any other capability throws this error message:

ava.lang.IllegalArgumentException: Command 'hasCapability' is not supported by device

indent preformatted text by 4 spaces

Are you sure that 'buttonPause' is a device, singular? If you used multiple:true, try this

buttonPause[0].hasCapability("PushableButton")

Otherwise, what driver are you using?

1 Like

Oh my god! LOL What a bytos am I (french pun... that I won't translate...)

I only know that because I've made the same mistake.

1 Like

I have made it so often! Don't know why I didn't think about it this time though. Thanks a lot.

How do I re-trigger a RM4.1 rule based on a button push event from my driver?

With capability "PushableButton", my device driver is sending an event:

sendEvent(name:"pushed", value:1)

This is triggering a Rule Machine 4.1 rule fine for the first time, but subsequent "pushed" event of the same button number doesn't trigger the rule. If I send another button as a pushed event (say, button 2), then send pushed event button 1 again, the rule will re-trigger. I don't know what I'm doing wrong. I also tried adding ReleasableButton capability and sending a "released" event immediately following the "pushed", but the next "pushed" event still doesn't re-trigger the rule.

I don't know if I'm missing something. As a test of Rule Machine, I used a Minimote with the built-in drivers and I can press the same button repeatedly to retrigger the rule over and over. I have a another test rule that triggers on "pushed" and "released" events and it doesn't seem like the Minimote is sending release events. So, it feels like calling my driver repeatedly calling sendEvent() with the same button # doesn't actually cause an event to be sent??

@kleung1: So, it feels like calling my driver repeatedly calling sendEvent() with the same button # doesn't actually cause an event to be sent??

Here's how I do it:

sendEvent(name: "pushed", value: number, isStateChange: true)

2 Likes

@tomw: Thank you! That's exactly what I was missing!

2 Likes

I'm having trouble adapting this button driver
I already replaced "button" to capability "PushableButton"
But i don't know how to continue modifying the driver
I would like to ask help with this modification. Please

https://raw.githubusercontent.com/jorgespneto/Hubitat-Jorge/main/Zemismart%20Button%206

Watched a YouTube review the other day, for an Inovelli brand in-wall paddle switch that allowed you to program some crazy number of taps, I believe up to six?!

Enough to choke any button implementation on the spot. :stuck_out_tongue_winking_eye:

"Honey, to turn the kitchen lights on, tap 4 times, and to turn on the dining room, tap 5 times. Got it?"

3 Likes

"Dear, I tapped nine times and neither the kitchen or dining room came on. Isn't four taps and five taps, nine taps?"

2 Likes

tap tap tap, hold hold hold, tap tap tap...
or something like that...

4 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.