-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Binary Sensor Help Please #725
Comments
you configure the GPIO you connect the sensor to as a switch, and then configure
switchmode and/or switchtopic to give you the results you are looking for.
To wire the sensor, you need to see if they apply power or just close a relay
(there are some of each type), if they apply power, you need to make sure it's
not above 3.3v (and setup a resistor bridge if it is)
If it's a pure relay, you wire it like you would any other switch.
|
Hello @davidelang , Thanks for the response. I do understand I have to define my GPIO14 sensor as a switch, also understand I have to set it to switchmode=2 so that it can send a message to a defined mqtt topic set by myself. I also understand I have to set the switchtopic to what I want to use. But how to do all these is quite confusing I am afraid. I understand I can send command via http requests, web or mqtt, but I don't understand how the syntax come together. Please I just need a clearer way to achieve this, as this is quite new to me. Kind regards |
Don't worry @davidelang thanks and I have gotten it to work now. Many thanks again and I am most grateful. But another different question, is there a command I can send to the sonoff (as I got a couple of them around my home) to let me know its status? |
Read in Wiki Commands topic |
Consider setting up a grouptopic and assigning all (or both in your case) your Sonoffs to it. Send the "status 0" to the grouptopic and all (or in your case, both) devices will respond with their status. Neat! Peter |
That's a great tip, I was looking for a simple way to retrieve the Sonoff
status when my server reboots
Le dim. 13 août 2017 07:19, CommodoreWhite <notifications@github.com> a
écrit :
… Consider setting up a grouptopic and assigning all (or both in your case)
your Sonoffs to it. Send the "status 0" to the grouptopic and all (or in
your case, both) devices will respond with their status. Neat!
Peter
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#725 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AcMo5S2efFzRQGXzGoIEWiGmtyw2HfvWks5sXod2gaJpZM4O1E7p>
.
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem. |
Hello,
Many thanks for your firmware, and it must be great knowing your code helps thousands of ppl like myself to achieve awesome things.
Please a quick question, how can I connect a binary sensor to the sonoff basic. Like PIR or Window/door sensors that are either closed or opened so the status can be sent to an MQTT server?
Regards
The text was updated successfully, but these errors were encountered: