Default state is overridden from switch device

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
ymoona
New user
Posts: 3
Joined: 14 Feb 2018, 20:38

Default state is overridden from switch device

#1 Post by ymoona » 14 Feb 2018, 20:49

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?

User avatar
toffel969
Normal user
Posts: 469
Joined: 03 Jan 2017, 10:58
Location: Germany

Re: Default state is overridden from switch device

#2 Post by toffel969 » 15 Feb 2018, 10:17

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

ymoona
New user
Posts: 3
Joined: 14 Feb 2018, 20:38

Re: Default state is overridden from switch device

#3 Post by ymoona » 15 Feb 2018, 12:24

No it is not

ymoona
New user
Posts: 3
Joined: 14 Feb 2018, 20:38

Re: Default state is overridden from switch device

#4 Post by ymoona » 15 Feb 2018, 12:35

And issue also occurs when the controller is disabled.

User avatar
toffel969
Normal user
Posts: 469
Joined: 03 Jan 2017, 10:58
Location: Germany

Re: Default state is overridden from switch device

#5 Post by toffel969 » 16 Feb 2018, 07:41

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

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests