Menu

Send e-mail when light is on for more then x

Help
Ronny
2010-01-31
2012-12-14
  • Ronny

    Ronny - 2010-01-31

    Hi guys,
    I would like to write a rule which sends me an e-mail when I left my house and there is still a light on for several hours/minutes.
    In text the rule would be like:
    When   House_left = true
         and  Light_Garage = On
         and Light_On_Time > 120 mintes
    then send e-mail

    Is such a logic possible? I don't know how I could do it, so if anyone of you has an idea please let me know …
    Thanks for helping & many thanks for creating Linknx & knxweb!

    -Ronny

     
  • JensH

    JensH - 2010-01-31

    Hi Ronny,
    yes it is.
    I have something similar to check for absence and start some automated actions…

    <rule id="Is_Away_2h">
    <condition type="time-counter" threshold="2h">
    <condition type="and">
    <condition type="object" id="1st_Floor_Motion" value="off" trigger="true" />
    <condition type="object" id="2nd_Floor_Motion" value="off" trigger="true" />
    <condition type="object" id="3rd_Floor_Motion" value="off" trigger="true" />
    </condition>
    </condition>
    <actionlist>
    <action type="set-value" id="Status_Away_2h" value="on" />
    </actionlist>
    </rule>

    This sets "Status_Away_2h to on, after not motion was detected over a timeframe of 2 hours.
    You would just need to check for  Light_On_Time = on over the same timespan and make an "and" with House_left and Light_Garage = on…

    If the <condition type="time-counter" threshold="2h">  is not working for you, you might need to get the newest sources from the CVS (at least the rulseserver.* as far as I can remember)

    Best Regards, Jens

     
  • jef2000

    jef2000 - 2010-01-31

    Hi,

    You can use the following condition:

    <condition type="time-counter" threshold="2h" reset-delay="1">
        <condition type="and" />
            <condition type="object" id="House_left" value="true" trigger="true" />
            <condition type="object" id="Light_Garage" value="on" trigger="true" />
        </condition>
    </condition>

    This condition, will become true if the light is on for 2 hours (threshold parameter ) and become false if light is off for 1 second (reset-delay parameter)

     
  • jef2000

    jef2000 - 2010-01-31

    Oups, there's a / too much at end of <condition type="and" />

     
  • Ronny

    Ronny - 2010-02-01

    Thanks a lot to both you you!  I'll try both recommendations to learn more about the logic …

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.