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

can Gpio switch not direct action? #84

Closed
hamwong opened this issue Feb 19, 2017 · 6 comments
Closed

can Gpio switch not direct action? #84

hamwong opened this issue Feb 19, 2017 · 6 comments

Comments

@hamwong
Copy link

hamwong commented Feb 19, 2017

can Gpio switch not direct perform relay action and publish status to MQTT?

@davidelang
Copy link
Collaborator

I think it does that if it's not able to reach a mqtt server

@hamwong
Copy link
Author

hamwong commented Feb 19, 2017

on my test environment, I got MQTT online, only result is switch direct turn on/off relay and post MQTT,
I wish there is an option don't switch relay and post MQTT, let server - openhab decide on or off,

@davidelang
Copy link
Collaborator

davidelang commented Feb 19, 2017 via email

@hamwong
Copy link
Author

hamwong commented Feb 20, 2017

Thanks @davidelang, as too many commands, and not much description on command usage, I didn't aware switchtopic for this usage, another issue come, is this is a bug or limit as if I got 2 gpio set for same function(switch). only one of gpio will work, other one won't function,

I set as below:
{"GPIO3":9 (Switch), "GPIO4":0 (None), "GPIO14":9 (Switch)}
than only GPIO14 works, GPIO3 no response, or the other way around.

I like to set itworks as below condition, GPIO14 connect to HC-SR501 PIR and work with MQTT (openhab), and GPIO3 work with wall switch (direct control), so that user may manually overide on/off and not from PC/mobile.

as far as I test, I only may work out as switch + DHT22 on GPIO 3,14, but not both switch.

@Nayar
Copy link

Nayar commented Feb 20, 2017

arendst/Sonoff-MQTT-OTA-Arduino#158

I injected some codes into the firmware that read the GPIO then published on /stats/sonoff/GPIO topic. Then I could implement this: https://nayarweb.com/blog/2017/iot-series-smart-lightsensors-in-the-kitchen/

I need to rewrite the patch and maybe merge it upstream

@hamwong
Copy link
Author

hamwong commented Feb 21, 2017

Hi @Nayar
Thanks, I am so excite that this feature will come, I look at #158, does that mean I can assign GPIO14 connect to HC-SR501 PIR and work with MQTT (openhab), and GPIO3 work with wall switch (direct control)?

arendst added a commit that referenced this issue Feb 24, 2017
3.9.21 20170224
* Add ajax to web root page and web console (#79)
* Add commands SwitchMode1..4 and enable user switches 2, 3 and 4 (#84,
#88)
* Fix MQTT upgrade when webserver is active
@hamwong hamwong closed this as completed Feb 28, 2017
curzon01 pushed a commit to curzon01/Tasmota that referenced this issue Sep 6, 2018
3.9.21 20170224
* Add ajax to web root page and web console (arendst#79)
* Add commands SwitchMode1..4 and enable user switches 2, 3 and 4 (arendst#84,
arendst#88)
* Fix MQTT upgrade when webserver is active
vicfergar pushed a commit to vicfergar/Sonoff-Tasmota that referenced this issue Mar 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants