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

Feature request: api for open relay for n miliseconds #831

Closed
david-skalka opened this issue Apr 30, 2018 · 5 comments
Closed

Feature request: api for open relay for n miliseconds #831

david-skalka opened this issue Apr 30, 2018 · 5 comments
Labels
Milestone

Comments

@david-skalka
Copy link

I would like use sonoff basic for electric door lock. If I use standard api for relay {root topic}/relay/0/set and call it by complicated central unit (raspberry j2ee) which connected throw not 100% reliable wifi, the system could fall and the lock would remain open.

Best solution should be api(mqtt, web) such as
{root topic}/relay/0/pulse => { 5000}

@wildwiz
Copy link
Contributor

wildwiz commented Apr 30, 2018

maybe you want to use the pulse feature ? on your espurna, go to switches, choose pulse mode normally off and give it a pulse time of, say, 0.3 s ?

@david-skalka
Copy link
Author

eventuelly yes, but api would be more comfortable. Some clients also wont short and long pulse for door lock.

@xoseperez xoseperez added enhancement New feature or request api labels May 2, 2018
@xoseperez xoseperez added this to the 1.12.7 milestone May 2, 2018
@xoseperez xoseperez modified the milestones: 1.12.7, 1.13.0 Jun 4, 2018
@xoseperez
Copy link
Owner

xoseperez commented Jun 12, 2018

Thanks to @mcspr for #902. I've added the HTTP API entry point to his work. Now you can pulse any relay for an arbitrary time. To toggle the relay and toggle it back after 2.5 seconds just send this request (notice times are in milliseconds):

curl "http://192.168.1.123/api/pulse/0?apikey=AABBCCDDEEFF0011&value=2.5"

or using MQTT:

mosquitto_pub -t ESPURNA_001122/pulse/0/set -m 2.5

(edited: units in seconds)

@xoseperez
Copy link
Owner

Staging for release

@namezero
Copy link

namezero commented Nov 4, 2018

it could be a great feature not only in pulse mode, but also in swutch button mode : a timer. you could turn on the light for limited time, then it turn off

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

No branches or pull requests

4 participants