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...
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 16

  • @clairerovic
    @clairerovic ปีที่แล้ว +1

    I have 20 + Tasmota devices. This was clear to the point and practical. Thanks 👍

  • @JC-zw9vs
    @JC-zw9vs ปีที่แล้ว

    Superb explanation. Many thanks

  • @primetechguides3050
    @primetechguides3050  ปีที่แล้ว +1

    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.

  • @vanderleisilvasantos5343
    @vanderleisilvasantos5343 ปีที่แล้ว

    hi great video, can I make my own sensor motion with ESP and if is possible to create rules with alexa

  • @kevinlee3334
    @kevinlee3334 8 หลายเดือนก่อน

    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?

    • @primetechguides3050
      @primetechguides3050  8 หลายเดือนก่อน

      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

  • @navdeepsidhu7178
    @navdeepsidhu7178 ปีที่แล้ว

    Hi, can you please help me to get mqtt host name with rules?

    • @primetechguides3050
      @primetechguides3050  ปีที่แล้ว

      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.

  • @jasonmarriott1058
    @jasonmarriott1058 18 วันที่ผ่านมา

    Is it possible to display the rules created on a unit

    • @primetechguides3050
      @primetechguides3050  17 วันที่ผ่านมา

      you mean when you just type Rule1 on the console?, it should be in the output

  • @dumindujayasinghe
    @dumindujayasinghe หลายเดือนก่อน

    Where is the automation run on. A node red or pc or a cloud or on the same esp. ?

    • @primetechguides3050
      @primetechguides3050  หลายเดือนก่อน +1

      Doing it this way was just direct Tasmota device to Tasmota device communication using a http request.

    • @dumindujayasinghe
      @dumindujayasinghe หลายเดือนก่อน

      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

    • @primetechguides3050
      @primetechguides3050  หลายเดือนก่อน +1

      @@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

    • @dumindujayasinghe
      @dumindujayasinghe หลายเดือนก่อน

      Thanks you very much. I’ll look for it. ❤