Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for logical switch backed by physical switches #448

Open
robyepez opened this issue Jan 12, 2023 · 3 comments
Open

Add support for logical switch backed by physical switches #448

robyepez opened this issue Jan 12, 2023 · 3 comments

Comments

@robyepez
Copy link

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:

  • On action: Issue channel 1 ON command
  • Off action: Issue channel 1 ON command
  • Is On: Look at power consumption of channel 2 (> 5W)
  • Is Off: Look at power consumption of channel 2 (<1.5 W)

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
Copy link
Owner

bwp91 commented Mar 11, 2023

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

@robyepez
Copy link
Author

robyepez commented Mar 11, 2023 via email

@robyepez
Copy link
Author

robyepez commented Mar 15, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants