Prevent action from beeing executed

If you have a question or need help, this is the place to be.

Prevent action from beeing executed

Postby Lilak » Wed Dec 21, 2016 1:02 pm

Hi, and Merry Christmas!

I hope I can make you understand, english is not my cop of tea.

I have a macro named, "Kamera". In "Kamera" I have the action, "EventGhost.PythonCommand(u"urllib.urlopen('http://localhost:65109/bringonline?ot=2&oid=1')")".
The action is triggered by the event, "TellStickDuo.RörelseSensor.ON". No problem so far, everything works great.

Here's what I need help to accomplish. If the event, "TellStickDuo.Dörr Knapp 1.ON", occurs within 5 seconds of the event, "TellStickDuo.RörelseSensor.ON",
I don't want the action to be run.

How do I do this?

<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1640">
<Macro Name="Kamera" Expanded="True">
<Event Name="TellStickDuo.RörelseSensor.ON" />
<Event Name="TellStickDuo.Dörr Knapp 1.ON" />
<Action>
EventGhost.PythonCommand(u"urllib.urlopen('http://localhost:65109/bringonline?ot=2&amp;oid=1')")
</Action>
</Macro>
</EventGhost>

Thanks!

/Jonas
Lilak
 
Posts: 8
Joined: Fri Dec 28, 2012 9:06 am
Location: Sweden

Re: Prevent action from beeing executed

Postby pearbear » Thu Dec 22, 2016 10:07 pm

This will disable the action for 5 seconds after "TellStickDuo.Dörr Knapp 1.ON" but I don't know if that's exactly the behavior you're looking for.
Code: Select all
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1640">
    <Macro Name="Kamera" id="2" Expanded="True">
        <Event Name="TellStickDuo.RörelseSensor.ON" />
        <Action>
            EventGhost.PythonCommand(u"urllib.urlopen('http://localhost:65109/bringonline?ot=2&amp;oid=1')")
        </Action>
    </Macro>
    <Macro Name="Disable: Kamera" Expanded="True">
        <Event Name="TellStickDuo.Dörr Knapp 1.ON" />
        <Action>
            EventGhost.DisableItem(XmlIdLink(2))
        </Action>
        <Action>
            EventGhost.TriggerEvent(u'enableKamera', 5.0)
        </Action>
    </Macro>
    <Macro Name="Enable: Kamera" Expanded="True">
        <Event Name="Main.enableKamera" />
        <Action>
            EventGhost.EnableItem(XmlIdLink(2))
        </Action>
    </Macro>
</EventGhost>

If that's not what you're going for then give me more details of what you mean by "within 5 seconds of the event".
Attachments
Clipboard01.png
Clipboard01.png (10.92 KiB) Viewed 334 times
pearbear
Experienced User
 
Posts: 102
Joined: Mon Apr 02, 2012 10:28 pm

Re: Prevent action from beeing executed

Postby Lilak » Fri Jan 06, 2017 2:52 am

Hello!

Thank you for your help! Sorry to say that, what you suggested didn't do what I want.

When I enter my apartment there is motion detector (=RörelseSensor), and a button (=Dörr Knapp 1).

The motion detector, detects movement and starts my security camera (=urllib.urlopen('http://localhost:65109/bringonline?ot=2&oid=1').

What I want is: If I press the button less than 5 seconds after the motion has been detected, I don't
want the camera to start.

Did that make it understandable?

Best regards

Jonas
Lilak
 
Posts: 8
Joined: Fri Dec 28, 2012 9:06 am
Location: Sweden

Re: Prevent action from beeing executed

Postby pearbear » Fri Jan 06, 2017 5:17 am

OK, the attached file should do it.

By the way, 0.4.0.r1640 is a pretty ancient version of EventGhost.
Attachments
Clipboard01.png
Lilak.xml
(1.01 KiB) Downloaded 18 times
pearbear
Experienced User
 
Posts: 102
Joined: Mon Apr 02, 2012 10:28 pm

Re: Prevent action from beeing executed

Postby Lilak » Mon Jan 16, 2017 6:43 pm

Thank you very much for your help. Now it works perfectly!

Thanks for notice my old version of EG, will fix it asap.

Best regards

Jonas
Lilak
 
Posts: 8
Joined: Fri Dec 28, 2012 9:06 am
Location: Sweden


Return to General Support

Who is online

Users browsing this forum: Bing [Bot] and 4 guests