Tasmota - How To Automate A Light Using A Motion Sensor With Rules And Timers
ฝัง
- เผยแพร่เมื่อ 12 ก.ค. 2022
- How to create an automated motion controlled light using Tasmota Rules and Timer commands.
Instructions Click More Below...
New rule as reports previous rule can cause motion loop
RuleTimer2 is a buffer to prevent the light turning off triggering another turn on event.
****************************************************
Rule1 ON System#Boot DO Var1 1 ENDON
Rule2 ON Power1#state=1 DO Backlog0 WebSend [mylight] Power %Var1%; RuleTimer1 20 ENDON
ON Rules#Timer=1 DO Backlog0 Var1 0; WebSend [mylight] Power OFF; RuleTimer2 4 ENDON
ON Rules#Timer=2 DO Var1 1 ENDON
Rule1 1
Rule2 1
****************************************************
Old Rule used in video:
Rule1 ON Power1#state=1 do Backlog WebSend [mylight] Power On; RuleTimer1 20 ENDON ON Rules#Timer=1 DO WebSend [mylight] Power OFF ENDON
Tasmota Device Templates:
templates.blakadder.com/
Accessing device via hostname
mymotionsensor
mymotionsensor.lan
Tasmota Commands:
tasmota.github.io/docs/Commands/
Note: The Tuya motion sensor would need flashing to Tasmota, these devices are not pre flashed.
templates.blakadder.com/CT61W...
How To Flash Motion Sensor With Tasmota - • Tasmota Firmware - Fla... - วิทยาศาสตร์และเทคโนโลยี
I have 20 + Tasmota devices. This was clear to the point and practical. Thanks 👍
Superb explanation. Many thanks
NOTE: The Tuya Motion Sensor device would need flashing to Tasmota, this device does not come pre flashed. The Rule is in the description, expand it / show more.
hi great video, can I make my own sensor motion with ESP and if is possible to create rules with alexa
I've got an issue where when the light goes off, the motion detector senses that as a motion and again turns the bulb on.... it becomes a cycle of on-off-on-off.... any way to rectify this?
Try this remember to enable both rules - Rule1 1 and Rule2 1
Then reboot device.
Rule1
ON System#Boot DO Var1 1 ENDON
Rule2
ON Power1#state=1 DO Backlog0 WebSend [mylight] Power %Var1%; RuleTimer1 20 ENDON
ON Rules#Timer=1 DO Backlog0 Var1 0; WebSend [mylight] Power OFF; RuleTimer2 4 ENDON
ON Rules#Timer=2 DO Var1 1 ENDON
Hi, can you please help me to get mqtt host name with rules?
I've not done much with MQTT but I believe its in Configure > Configure MQTT > Topic to change the name. This video just for direct communicating between devices.
Is it possible to display the rules created on a unit
you mean when you just type Rule1 on the console?, it should be in the output
Where is the automation run on. A node red or pc or a cloud or on the same esp. ?
Doing it this way was just direct Tasmota device to Tasmota device communication using a http request.
I’m currently using 8 relays and one dht22 sensor on same esp32 running tasmota. So will i be able to use that dht22 data to turn on/off a relay in same esp board via console? Thanks
@@dumindujayasinghe For sure. similar concept in this video, using Websend and referencing the devices IP address or hostname, I think chatgpt might be able to draw up the basics of what you need, rule wise
Thanks you very much. I’ll look for it. ❤