ESP8266 and Switch ?
Moderators: grovkillen, Stuntteam, TD-er
-
- Normal user
- Posts: 19
- Joined: 06 Aug 2021, 12:52
ESP8266 and Switch ?
Hello!
Would like to ask what the settings for a switch are?
Switch on ESP8266 a closed to Gnd, means vom Pin to switch to Gnd, correct?
Possible to send (Mqtt) the opposit, ON = OFF vice versa ?
THX
Would like to ask what the settings for a switch are?
Switch on ESP8266 a closed to Gnd, means vom Pin to switch to Gnd, correct?
Possible to send (Mqtt) the opposit, ON = OFF vice versa ?
THX
Re: ESP8266 and Switch ?
Please check out the documentation for Switch, the blue (i) button at the top of the Device Configuration screen: https://espeasy.readthedocs.io/en/lates ... /P001.html and https://espeasy.readthedocs.io/en/lates ... witch-page
You'll want to enable the 'Inversed Logic' checkbox for that
You'll want to enable the 'Inversed Logic' checkbox for that

/Ton (PayPal.me)
-
- Normal user
- Posts: 19
- Joined: 06 Aug 2021, 12:52
Re: ESP8266 and Switch ?
THX, will do my best.
-
- Normal user
- Posts: 19
- Joined: 06 Aug 2021, 12:52
Re: ESP8266 and Switch ?
What controller are you using?
For Domoticz (both HTTP and MQTT) the IDX needs to be set, for other controllers, the Controller Publish field should contain %tskname% and %valname% to send unique topics to the MQTT controller.
For Domoticz (both HTTP and MQTT) the IDX needs to be set, for other controllers, the Controller Publish field should contain %tskname% and %valname% to send unique topics to the MQTT controller.
/Ton (PayPal.me)
-
- Normal user
- Posts: 19
- Joined: 06 Aug 2021, 12:52
Re: ESP8266 and Switch ?
Home Assist (openHub) Mqtt
%sysname%/%tskname%/%valname%
%sysname%/%tskname%/%valname%
Re: ESP8266 and Switch ?
It is good practice not to short a pin directly to Vcc or GND, but rather use some resistor to pull the logic level "up" or "down".
For example what if the pin is pulled down or up in the software, but it is shorted to Vcc or GND.
Then the GPIO may have a higher current flowing than allowed.
Another thing to keep in mind is that you must have some pins in a very specific state during boot.
See: https://espeasy.readthedocs.io/en/lates ... on-esp8266
For example what if the pin is pulled down or up in the software, but it is shorted to Vcc or GND.
Then the GPIO may have a higher current flowing than allowed.
Another thing to keep in mind is that you must have some pins in a very specific state during boot.
See: https://espeasy.readthedocs.io/en/lates ... on-esp8266
-
- Normal user
- Posts: 19
- Joined: 06 Aug 2021, 12:52
Re: ESP8266 and Switch ?
I know, but works fine.
What I need is the info sent via Mqtt, actually nothing is getting out from the State of the Switch.
What I need is the info sent via Mqtt, actually nothing is getting out from the State of the Switch.
Re: ESP8266 and Switch ?
Do you have a switch task, which can send the state to a connected controller?
Another option is to activate monitoring of a specific pin using the "monitor" command in the rules.
This will generate an event when the pin state changes and this can be used in the rules to trigger some action, like sending a message to the MQTT broker via the "publish" command.
Some docs links:
https://espeasy.readthedocs.io/en/lates ... tem-events
https://espeasy.readthedocs.io/en/lates ... r#commands
Another option is to activate monitoring of a specific pin using the "monitor" command in the rules.
This will generate an event when the pin state changes and this can be used in the rules to trigger some action, like sending a message to the MQTT broker via the "publish" command.
Some docs links:
https://espeasy.readthedocs.io/en/lates ... tem-events
https://espeasy.readthedocs.io/en/lates ... r#commands
-
- Normal user
- Posts: 19
- Joined: 06 Aug 2021, 12:52
Re: ESP8266 and Switch ?
Switch is set as Device
Home Assist for Mqtt connection to ioBroker (Adapter Sonnos)
only the SHT31 is sent to ioBroker.
(are inputs and outputs to sent via Wifi not the Basic function....?)
Home Assist for Mqtt connection to ioBroker (Adapter Sonnos)
only the SHT31 is sent to ioBroker.
(are inputs and outputs to sent via Wifi not the Basic function....?)
- Attachments
-
- Bildschirmfoto 2021-08-07 um 09.03.55.png (92.49 KiB) Viewed 9186 times
-
- Bildschirmfoto 2021-08-07 um 09.00.11.png (184.84 KiB) Viewed 9187 times
Re: ESP8266 and Switch ?
Can you also show a screenshot of the Switch SW1 settings and the Controller settings (details)?
/Ton (PayPal.me)
-
- Normal user
- Posts: 19
- Joined: 06 Aug 2021, 12:52
Re: ESP8266 and Switch ?
here we go
- Attachments
-
- screenshot-192.168.0.151-2021.08.07-15_41_34 (1).png (539.93 KiB) Viewed 9171 times
-
- screenshot-192.168.0.151-2021.08.07-15_41_07.png (456.89 KiB) Viewed 9171 times
Re: ESP8266 and Switch ?
Ok, that looks nearly standard. Can't see anything really strange yet...
I'm a bit puzzled by port 1886 on the MQTT broker, the usual default for that is 1883
I'm a bit puzzled by port 1886 on the MQTT broker, the usual default for that is 1883
/Ton (PayPal.me)
-
- Normal user
- Posts: 19
- Joined: 06 Aug 2021, 12:52
Re: ESP8266 and Switch ?
1883 is already in use, so I took an other number, should not be the problem
Is it possible to analyse the Mqtt, maybe the Status is transferred and ioBroker does not show it?
Is it possible to analyse the Mqtt, maybe the Status is transferred and ioBroker does not show it?
Re: ESP8266 and Switch ?
There are GUI-tools available for most OS's to monitor the MQTT message flow, there you could just subscribe to # or your esp %sysname%/# to see all messages. Be aware that MQTT is case-sensitive (and ESPEasy is not, except in MQTT topics...).
/Ton (PayPal.me)
Who is online
Users browsing this forum: No registered users and 13 guests