ESPHap icon indicating copy to clipboard operation
ESPHap copied to clipboard

Momentary Button/Switch possible?

Open chrwh opened this issue 3 years ago • 3 comments

Hi, Is it possible to make a momentary button? I need this to increment a value in the other end :-) and since I can't read the current value out of the thing I'm controlling, I just need to increment it, and then have another momentary button to decrement it. Best regards, Christian

Note. I just tested the latest release, and it seems to be much more stable now - THANK you SO MUCH :-)

chrwh avatar Mar 07 '21 17:03 chrwh

Hi, thanks for feedback. You mentioned more stabel. means some instability still exists ?

About your question and momentary button, I do not completelly understand your task generally. Maybe you can explain and it will be easy to propose some solution. Any how library is limmited for Apple possibilities. All accessories and charachteristic you can see there https://developer.apple.com/support/homekit-accessory-protocol/ . Means everything which is supported by Apple can be implemented

Yurik72 avatar Mar 08 '21 07:03 Yurik72

It has been running for a couple of days now. Sometimes when you open the phone or ipad, is says no connection, but after a few seconds it will be ok again. What I'm looking for is like a tactile switch but on the screen, so not an on/off switch, but a push and release switch. I have somewhat solved it, by creating an automation in the home app, so when the switch is turned on, it will be turn off again right away. By doing that I can use it to increment a variable in another system.

chrwh avatar Mar 09 '21 22:03 chrwh

Ok, I will check next few days what can be solution

Existing accessory switch is designed like external button , I have examples on my folder for that. But means you can’t simple press on to this Switch on iOS

On of the “stupid” solution is implement normal on/off switch which you are rejected, BUT keep his state always ON. For instance when you press the button on iOS it signals OFF to my library

You did what you want…. and then notify iOS that state is changed to ON, from user point of view when he is pressed button, it will keep OFF a few second and then back to on state…

From: chrwh [email protected] Sent: Wednesday, March 10, 2021 12:46 AM To: Yurik72/ESPHap [email protected] Cc: Yurik72 [email protected]; Comment [email protected] Subject: Re: [Yurik72/ESPHap] Momentary Button/Switch possible? (#74)

It has been running for a couple of days now. Sometimes when you open the phone or ipad, is says no connection, but after a few seconds it will be ok again. What I'm looking for is like a tactile switch but on the screen, so not an on/off switch, but a push and release switch. I have somewhat solved it, by creating an automation in the home app, so when the switch is turned on, it will be turn off again right away. By doing that I can use it to increment a variable in another system.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Yurik72/ESPHap/issues/74#issuecomment-794559852 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AKDREXNFQAE2NK2JAQADOQDTC2QJDANCNFSM4YYBSDSQ . https://github.com/notifications/beacon/AKDREXPYORIKWPKCRA7SUUTTC2QJDA5CNFSM4YYBSDS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOF5OAK3A.gif

Yurik72 avatar Mar 10 '21 14:03 Yurik72