dkerr64 / homebridge-yolink

Apache License 2.0
12 stars 2 forks source link

Please add support for YoLink Relay as a garage door controller. #105

Open steveswales opened 1 week ago

steveswales commented 1 week ago

Discussed in https://github.com/dkerr64/homebridge-yolink/discussions/104

Originally posted by **steveswales** September 19, 2024 I have a YoLink Relay which I've attached to my TOPENS gate controller, and would like to pair it with the YoLink Door Sensor to form a garage door pair. Can you add Relay to Finger and Garage Door Controller as a supported type?
dkerr64 commented 1 week ago

Does the relay show up in Homebridge/HomeKit? YoLink does not document a specific API for the Relay device so I am assuming it shows up as a "Switch" but can you confirm please.

Also, how are you using this in the YoLink native app? The Finger and GarageDoor controller devices toggle on/off with one command, they do not retain state like a switch. I assume the Relay is like a switch... can be set on or off and each state is held until the opposite is sent. To integrate this like a GarageDoor or Finger we would need to simulate the toggle... e.g. turn the relay on, then one second later turn it off.

I don't know if this is doable or not, but it will help to understand how you are controlling the gate natively.

Thanks.

steveswales commented 1 week ago

Hi, David,

Yes, it shows as a switch in HomeBridge, but the device type in the YoLink app is “YoLink Relay”.

The relay has two modes. One like a switch, and one like the GarageDoor/Finger, which they call “pulse" mode, where turning it on produces a programmable length pulse (turns on, then off). I’m using that mode to control the gate with a 1 second “pulse".

Thanks,

-steve

On Sep 20, 2024, at 1:00 AM, David Kerr @.***> wrote:

Does the relay show up in Homebridge/HomeKit? YoLink does not document a specific API for the Relay device so I am assuming it shows up as a "Switch" but can you confirm please.

Also, how are you using this in the YoLink native app? The Finger and GarageDoor controller devices toggle on/off with one command, they do not retain state like a switch. I assume the Relay is like a switch... can be set on or off and each state is held until the opposite is sent. To integrate this like a GarageDoor or Finger we would need to simulate the toggle... e.g. turn the relay on, then one second later turn it off.

I don't know if this is doable or not, but it will help to understand how you are controlling the gate natively.

Thanks.

— Reply to this email directly, view it on GitHub https://github.com/dkerr64/homebridge-yolink/issues/105#issuecomment-2363081016, or unsubscribe https://github.com/notifications/unsubscribe-auth/AARATBXCSQEB67JPU4OLUL3ZXPI3LAVCNFSM6AAAAABOQX3P52VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNRTGA4DCMBRGY. You are receiving this because you authored the thread.

dkerr64 commented 1 week ago

As I don't have one of these I'll need your help to figure out how to make it work. Can you please go into the YoLink plugin settings and enable verbose logging. Restart the plugin and the homebridge log will now show messages going to/from YoLink.

What I need is to see if anything is recorded in the log while you use the YoLink app to turn on / off the relay. And specifically if the messages are different when you use the pulse mode. In other words, whether there is a unique command sent for a pulse, or whether it is implemented in the app by sending an "on" followed one second later by an "off".

Right now, for the finger and garage door devices, I do not have to send an "off", they have a unique command which YoLink call "toggle" and I send that. I'm looking to find out if the relay has an equivalent or whether two commands need to be sent one second apart.

thanks.

steveswales commented 1 week ago

WIll do. I appreciate you looking into this. My gut feeling is that pulse mode is a toggle, and there’s a separate command to set the duration, then they just send the same command to turn it on, and you get a pulse of the desired duration. That’s just a gut feeling though. I’ll get the logs.

On Sep 21, 2024, at 2:38 AM, David Kerr @.***> wrote:

As I don't have one of these I'll need your help to figure out how to make it work. Can you please go into the YoLink plugin settings and enable verbose logging. Restart the plugin and the homebridge log will now show messages going to/from YoLink.

What I need is to see if anything is recorded in the log while you use the YoLink app to turn on / off the relay. And specifically if the messages are different when you use the pulse mode. In other words, whether there is a unique command sent for a pulse, or whether it is implemented in the app by sending an "on" followed one second later by an "off".

Right now, for the finger and garage door devices, I do not have to send an "off", they have a unique command which YoLink call "toggle" and I send that. I'm looking to find out if the relay has an equivalent or whether two commands need to be sent one second apart.

thanks.

— Reply to this email directly, view it on GitHub https://github.com/dkerr64/homebridge-yolink/issues/105#issuecomment-2365112908, or unsubscribe https://github.com/notifications/unsubscribe-auth/AARATBSGELWSMOXIE2GBIMDZXU47RAVCNFSM6AAAAABOQX3P52VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNRVGEYTEOJQHA. You are receiving this because you authored the thread.