I have a wemos d1 mini flashed with tasmota Version 5.14.0-2_3_0. I have flashed it with this version as I can't get it to connect to my wifi if I flash the latest version.
I wish to connect a PIR sensor, but the sensor I am using goes high on the signal pin when motion is detected, the opposite of what a switch or button does.
Whilst experimenting with switchmode, I came across the following odd behaviour. I don't know if it is intended or not.
I have set GPIO14 to 09 Switch 1
I have a 100k resistor pulling GPIO14 to ground, and a button which, when pressed, connects GPIO14 to 3.3v. I am trying to replicate the PIR sensor.
Immediately after flashing, pressing the button produces the following MQTT messages:
06:20:23 MQT: stat/test_wemos/RESULT = {"POWER":"OFF"}
06:20:23 MQT: stat/test_wemos/POWER = OFF
Releasing the button produces:
06:20:23 MQT: stat/test_wemos/RESULT = {"POWER":"ON"}
06:20:23 MQT: stat/test_wemos/POWER = ON
This is the behaviour I expected, but not what I wanted.
If I then:
1) issue the command Switchmode1 3
2) press and release the button once
3) issue the command Switchmode1 0
I get the opposite behaviour. Pressing the button results in POWER = ON and releasing it results in POWER = OFF
This is the behaviour I want for the PIR sensor.
I don't know if this behaviour is intended, but it is useful.