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.

2 events trigger 1 macro

If you have a question or need help, this is the place to be.
Post Reply
Pliind
Experienced User
Posts: 50
Joined: Tue Dec 31, 2013 7:40 pm

2 events trigger 1 macro

Post by Pliind »

Hello!

I'm quite new at this whole thing with eventghost, and what I'm really having issues with is Python. I've checked the forums already but i can't make sense of Pythin solutions being mixed with normal writing.
So I was just wondering if I could get som help.

So i want a macro to be triggered when both me and my girlfriend are not at home.
I've come so far that I've installed pvar.
And our "home" and "gone" statuses are termined my ping's.

When I leave, the variable is set to Adminhome = False and when my girl leaves it is set to Girlfriendhome=False.

So when both these are false i want event "Main.gone" to be triggerd.

If it is possible i would be soooo happy if i could have a python-script for this so i can use it for other things aswell (chopping up and modifying code has always been my thing :P)

Thanks in advance!
Dragon470
Experienced User
Posts: 205
Joined: Thu Feb 10, 2011 2:16 am

Re: 2 events trigger 1 macro

Post by Dragon470 »

You can use 2 eg.globals variables and do something like this:
dual variable testing.jpg
This is setup so when ever both are True the TriggerEvent BothTrue is called within the checker script. The checker is called each time one of the variables are triggered to be True.
Attachments
dual variable testing.xml
(1.96 KiB) Downloaded 234 times
blaher
Experienced User
Posts: 487
Joined: Thu Nov 17, 2011 1:27 am

Re: 2 events trigger 1 macro

Post by blaher »

I had a go too :)
Attachments
away.xml
(2.58 KiB) Downloaded 213 times
Capture.PNG
Pliind
Experienced User
Posts: 50
Joined: Tue Dec 31, 2013 7:40 pm

Re: 2 events trigger 1 macro

Post by Pliind »

WOW! Thanks guys! did'nt need that much python as i thought at all there!

HUGE thanks to the both of you! :)

Think i got this mother all up and running now! :D
Pliind
Experienced User
Posts: 50
Joined: Tue Dec 31, 2013 7:40 pm

Re: 2 events trigger 1 macro

Post by Pliind »

A quick follow up.

My router's been a bitch lately and I'd have to restart it at some times. (damn you RT-ac66u!)

So my problem is that while the router is restarting we both loose connection and yeah, here wo go "nightmode away" :P So is there a way to delay "away" mode for 2 mins? without chocking up the EG que.
blaher
Experienced User
Posts: 487
Joined: Thu Nov 17, 2011 1:27 am

Re: 2 events trigger 1 macro

Post by blaher »

You're welcome, and thanks to Dragon470 too; I learnt something new.
Pliind wrote:So is there a way to delay "away" mode for 2 mins? without chocking up the EG que.
The 'Timer' plugin. It comes with EG and won't choke the queue.
Pliind
Experienced User
Posts: 50
Joined: Tue Dec 31, 2013 7:40 pm

Re: 2 events trigger 1 macro

Post by Pliind »

Thanks the timer-plugin works like a charm, I like how timers with the same name cancels each other out!

The ping's are not realy accurate, noticed that my gf's phone drops her connection at times and this has made our life a living hell! :P (until i added loads of "enable" and "disable" macro's)
(I had a macro go off that switched from away to home mode on the lights) so her phone told EG that she was home, and eventghost proceeded to turn on all lights :P)
So that's sorted out but i want to get rid of all excessive code, because i don't know what's what anymore :P

Anyway to send a message over http to EG? I've tried autoremote but it bugged out on me when i switched rom on my phone, and the gf acceptance factor has to be high :P
We both have Tasker so anything that tasker could do to send a simple message?
piert
Experienced User
Posts: 321
Joined: Tue Jun 14, 2011 2:53 pm

Re: 2 events trigger 1 macro

Post by piert »

Anyway to send a message over http to EG? I've tried autoremote but it bugged out on me when i switched rom on my phone, and the gf acceptance factor has to be high :P
We both have Tasker so anything that tasker could do to send a simple message?
viewtopic.php?f=9&t=3859&hilit=terremote
Henrik4223
Posts: 47
Joined: Fri Mar 04, 2016 10:18 am

Re: 2 events trigger 1 macro

Post by Henrik4223 »

I have desperately tried to copy/paste this into my Eventghost tree but with no luck - nothing happens.....

Anyone have an idea on how I add these macroes? :shock:
Post Reply