hello
I flashed tasmota on a nodemcu. I connected a PIR to this nodemcu.
I would like to use that PIR as a switch.
My PIR updates only the value inside the circle but not the switch icon.
thank you in advance for your kind support and help.
hello
I flashed tasmota on a nodemcu. I connected a PIR to this nodemcu.
I would like to use that PIR as a switch.
My PIR updates only the value inside the circle but not the switch icon.
thank you in advance for your kind support and help.
The PIR is an input. It is a binary sensor not a switch. A switch is an output.
Thank you tom_l,
I connected PIR to the GPIO14 and set it as a Switch, this is why I tried to configure it as a switch.
Is it correct to set as a switch and read it as a binary sensor?
Ok now I begin to understand.
In HA a switch is a control you can use to toggle an associated output device (like a relay) on or off.
In Tasmota a switch is an input you can use to control a relay.
You have no relay connected to the nodemcu, so there should be no switch in HA to control it. Just the binary sensor to read the Tasmota switch (PIR) state.
Did you use discovery or did you write yaml to set up the nodemcu in HA?
By the way, a better option than Tasmota might be esphomeyaml.
It is very simle to flash the device using a Hassio addon:
Sensors are defined using simple yaml code, like the PIR for example:
There are a lot of other devices just as easy to configure:
Thann you,
now I begin to understand too
The PIR is configured as Switch in NodeMCU flashed Tasmota (ok)
The PIR is configured as Binary Sensor in HA, I wrote yaml. Below my configuration:
binary_sensor:
And it works! presence detection works but doesn’t not seem working in real time, it works like a polling.
I tried to move my hand once fast in front of the PIR and the sensor detect but HA doens’t see anything.
Thoughts?
I don’t have any experience with Tasmota on a nodemcu, only on sonoff devices. They react in practically real time.
Watch this, it shows how to use Tasmota with a PIR on nodemcu. Basically, Don’t use switch1 use switch 2.
I really think you’d be better off with esphomeyaml on the nodemcu though.
I’ m watching the same video suggested by you right now
thankl yuo so far, very appreciated!
From the video, I think your problem is that you should be using switch2, not switch1.