Esp-homekit-devices: Relay Trigger Question

Created on 4 Oct 2018  路  15Comments  路  Source: RavenSystem/esp-homekit-devices

Hello everyone, I have flashed esp12, everything works fine, but there is a question, is it possible to make the relay work for a couple of seconds and turn off? I want to insert these devices into the TV into the projector and so on, but there are buttons that are pressed and released. Thank you

wontfix

Most helpful comment

I figured out a hardware way to do this. I flashed ravencore on a Wemos D1 mini and attached a 5v relay to pin 7 which is presumably GPIO 13. pressing the switch in the home app triggers the relay on and off with every one press. So in other words it works as a momentary switch ie. press and release. The home app works perfectly and reads the state correctly as though it is on or off. This should also work on a Sonoff basic except you will just need to attach the relay pins to the led light contacts on the Sonoff as the LED is attached to GPIO 13. Some clever solder work should make this a breeze and it will meet your requirements. The above is possible as @RavenSystem has designed RavenCore to toggle the LED with every press of the button whereas on the stock firmware or Tasmota the LED follows the state of the relay. Give it a try and let me know what you guys think.

All 15 comments

This is my question, too! :)

Sorry, I only incorporate features supported by HomeKit, and there is not any service like a push button, only switches.

Idea for push button.
Switch will turn off automatically after invoke Timeout.

Setup Option
Push Button: on/off
Time for turn off: 0,5 - 10sec

See GPIO-PushButton-Service @ https://www.npmjs.com/package/homebridge-gpio-services

https://github.com/spobel/homebridge-gpio-services/blob/master/lib/accessories/pushbutton.js

@homkittoby That is a workaround to use a normal switch as a push button, not a real HomeKit push button. You can do that using a normal switch and a simple automation. When switch A set to on -> Set switch A to off.

@RavenSystem

right = compromise solution
can you integrate this into your firmware?
with two setup switches?
one to activate and one for the reset time?

I think many users would be happy about it

@remobil
@gpeter62

@gpeter62 That push button functionality is included in device type 3, so you can use a Sonoff Basic, S20, S22 or TH, and configure it as "Socket + Button":
https://github.com/RavenSystem/esp-homekit-devices/wiki/Sonoff-RavenCore#3-socket--button

This is another way to get extra functions using automations, like I mentioned above.

@gpeter62

thanks for the link

I'm looking for exactly the opposite.

push button in the homekit software, and in the hardware relay which switches on when pressed and automatically switches off after 1 sec.

Homkittoby

I'm about the same

@homkittoby

push button in the homekit software, and in the hardware relay which switches on when pressed and automatically switches off after 1 sec.

You can do that with HomeKit automatizations, or using a Water Valve device type, but I'm not going to develop a non HomeKit featured to do something that is covered in other way. Even with third party Apps like Smart Home, you can customize time with a wide range. If anyone wants to folks this repo and develop by self, of course that it's possible, this is open source under Apache License 2.0, but I'm not going to include non HomeKit features.

@RavenSystem

Thanks for the answer and ideas.
Unfortunately, the Water Valve option does not work.
On time must be less than a second.
Dimmers / Eltako are to be controlled in an installation. https://www.eltako.com/fileadmin/downloads/en/_bedienung/EUD61NPN_61100801-3_gb.pdf
It does not work reliably with HomeKit automatizations ...
Water Valve with switch or light symbol and a time of 0.1 - 10 seconds would be perfect!
A pity that you do not include the function in a software option :-( Because this is a big gap in the HomeKit world.

I figured out a hardware way to do this. I flashed ravencore on a Wemos D1 mini and attached a 5v relay to pin 7 which is presumably GPIO 13. pressing the switch in the home app triggers the relay on and off with every one press. So in other words it works as a momentary switch ie. press and release. The home app works perfectly and reads the state correctly as though it is on or off. This should also work on a Sonoff basic except you will just need to attach the relay pins to the led light contacts on the Sonoff as the LED is attached to GPIO 13. Some clever solder work should make this a breeze and it will meet your requirements. The above is possible as @RavenSystem has designed RavenCore to toggle the LED with every press of the button whereas on the stock firmware or Tasmota the LED follows the state of the relay. Give it a try and let me know what you guys think.

Excellent. Thanks. Tomorrow I'll try.

also I see now that the latest firmware has made it possible for GPIO 14 to work as a momentary switch

it works, only after a reboot, the LED starts flashing and this leads to an uncontrolled relay operation, after loading everything is fine

Was this page helpful?
0 / 5 - 0 ratings

Related issues

arturodiazad1 picture arturodiazad1  路  5Comments

Codi878 picture Codi878  路  4Comments

i3laze picture i3laze  路  3Comments

fluppie picture fluppie  路  5Comments

maciekfreak picture maciekfreak  路  4Comments