I have an ESP configured to make to make a pin high on boot.
Hardware tab:
Pin mode 12 (D6): Output High
This works fine on boot.
But I would also like to control and report on this pin using MQTT.
Controlling works by enabling the OpenHAB MQTT controller and publishing messages.
But in order to receive state on the switching of the pin (confirmation that the pin is indeed switched) I have configured a switch on the same pin.
Devices tab:
Switch input - Switch led2 ❶ GPIO-12 state: 0
At runtime this works fine, I can send MQTT messages and I receive back state.
But at boot something happens that I cannot explain.
Boot Sequence:
Led is turned on
After about 5 seconds the led is turned off
Bootlog:
6392 : Subscribed to: /ESP_TEST/#
6414 : EVENT: System#Boot
6546 : SW : Switch state 1 Output value 1
6578 : EVENT: led#state=1.00
6758 : SW : Switch state 1 Output value 1
6780 : EVENT: led2#state=1.00
I have also a rule enabled to set output to high on boot.
When I disable the device the pin stays high after boot, but then I dont get feedback on MQTT.
What am I missing here?
Default state is overridden from switch device
Moderators: grovkillen, Stuntteam, TD-er
-
- New user
- Posts: 3
- Joined: 14 Feb 2018, 20:38
-
- Normal user
- Posts: 469
- Joined: 03 Jan 2017, 10:58
- Location: Germany
Re: Default state is overridden from switch device
Is mqtt retain flag set under advanced tab?
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8
-
- New user
- Posts: 3
- Joined: 14 Feb 2018, 20:38
Re: Default state is overridden from switch device
No it is not
-
- New user
- Posts: 3
- Joined: 14 Feb 2018, 20:38
Re: Default state is overridden from switch device
And issue also occurs when the controller is disabled.
-
- Normal user
- Posts: 469
- Joined: 03 Jan 2017, 10:58
- Location: Germany
Re: Default state is overridden from switch device
Try to disable the pull-up resistor for the input switch device.
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8
Who is online
Users browsing this forum: Ahrefs [Bot], Anthropic Claude Bot [bot] and 23 guests