Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

Prevent action from beeing executed

If you have a question or need help, this is the place to be.
Post Reply
Lilak
Posts: 36
Joined: Fri Dec 28, 2012 9:06 am
Location: Sweden

Prevent action from beeing executed

Post by Lilak »

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&oid=1')")
</Action>
</Macro>
</EventGhost>

Thanks!

/Jonas
pearbear
Experienced User
Posts: 150
Joined: Mon Apr 02, 2012 10:28 pm
Contact:

Re: Prevent action from beeing executed

Post by pearbear »

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&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".
Last edited by pearbear on Mon Jun 05, 2017 10:02 am, edited 1 time in total.
Lilak
Posts: 36
Joined: Fri Dec 28, 2012 9:06 am
Location: Sweden

Re: Prevent action from beeing executed

Post by Lilak »

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
pearbear
Experienced User
Posts: 150
Joined: Mon Apr 02, 2012 10:28 pm
Contact:

Re: Prevent action from beeing executed

Post by pearbear »

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 114 times
Lilak
Posts: 36
Joined: Fri Dec 28, 2012 9:06 am
Location: Sweden

Re: Prevent action from beeing executed

Post by Lilak »

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
Post Reply