bwp91 / homebridge-ewelink

Homebridge plugin to integrate eWeLink devices into HomeKit.
MIT License
384 stars 126 forks source link

Add support for logical switch backed by physical switches #448

Open robyepez opened 1 year ago

robyepez commented 1 year ago

Hi,

Love your plugin to control my Sonoff DualR3.

I'm actually using it for an interesting config. My wife bought this fancy dimming floor lamp that uses a foot switch. However, it's not automate-able via a standard smart wall plug. It turns out that while it has 3 wires coming from the socket (L, N, G) to the foot switch, it has 4 wires going to the lamp (L1, L2, N, G). L2 is permanently wired to L from the socket and L1 is toggled by the foot switch. A simple tap turns on/off lamp. A press and hold dims the lamp. Fun!

Anyway, I picked up a DualR3 relay and wired it an external electrical box in lieu of the foot switch. Basically, I wired up L2 to channel 2, which I leave always on in order to maintain dim setting, and I wired L1 to channel 1. I declared channel 1 as a momentary switch with inching of 0.5s via the ewelink app. It all works like a champ with HomeKit via your plugin.

However, there is one draw back, because it's a momentary switch, the actual "on" state of the lamp is not reflected in HomeKit.

I was wondering if it might be possible to add the concept of a logical switch that consists of feedback from channel 1 and channel 2 switches. Basically the following:

Would be neat if all of this was configurable (such as channel assignments, power thresholds, etc) via the plugin settings.

What do you think?

bwp91 commented 1 year ago

sorry - catching up - will get to look at this soon!

robyepez commented 1 year ago

No worries. Thanks!Sent from my iPhone. There will be typos. On Mar 10, 2023, at 9:33 PM, Ben @.***> wrote: sorry - catching up - will get to look at this soon!

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

robyepez commented 1 year ago

I forgot to mention that I’ve been using “inchChannels” setting and it seems to be doing most of what I want. However, it can get sometimes out of sync when I tie control of my lamp to a keypad.

Therefore, if we could somehow manage state by referencing power consumption on the other channel, that would ensure that the HK control representing the lamp behaves more absolute.

Thanks!

Sent from my iPhone. There will be typos.

On Mar 11, 2023, at 8:50 AM, Rob Yepez @.***> wrote:

No worries. Thanks!

Sent from my iPhone. There will be typos.

On Mar 10, 2023, at 9:33 PM, Ben @.***> wrote:



sorry - catching up - will get to look at this soon!

— Reply to this email directly, view it on GitHub https://github.com/bwp91/homebridge-ewelink/issues/448#issuecomment-1464832353, or unsubscribe https://github.com/notifications/unsubscribe-auth/A22LL2X6LDTJROGLF4X43HDW3QFCTANCNFSM6AAAAAATZQLMA4. You are receiving this because you authored the thread.