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.

Support for "states" and not just events

If you have a question or need help, this is the place to be.
Post Reply
Fable
Posts: 3
Joined: Thu Dec 19, 2013 2:24 am

Support for "states" and not just events

Post by Fable »

Hi all,

I'm using EG with Tellstick Duo. I've managed to set up the macros almost the way I want them. Automating my home to awesomeness :P
However I am constantly running into some missing feature in all third party apps I can find (EG, Switchking etc)

What I would like is:

Example macro:

- Action: Turn the heat on (it's a power device in Tellstick Duo)
- Required state: Computer is idle.
- Event trigger: Temperature sensor is below 21C

I don't see how I can get EG to remember that the computer is idle? It is an event and not a state.

I had to modify the Tellstick Duo plugin to trigger Temperature events the way I needed them. Above/Below X degrees instead of a fixed number.
But I am a php developer not a python developer so this is very tricky for me.

It would also be great if you could link events.

If (event.X.on and event.Y.on) then magic()

But that requires EG to remember that event.X.on has happened and the counterpart event.X.off has not happened. (I'm writing these event names a bit silly to improve readability)
kkl
Experienced User
Posts: 317
Joined: Wed May 04, 2011 9:32 pm

Re: Support for "states" and not just events

Post by kkl »

In the default .xml file that is installed with EG, you'll find a Folder called Other Examples. I think that the State Macro Example might point you in the right direction.
Fable
Posts: 3
Joined: Thu Dec 19, 2013 2:24 am

Re: Support for "states" and not just events

Post by Fable »

Wow that was actually exactly what I needed.

I tried looking around in the documentation and googling for it, but no luck.

Thank you kkl!
krambriw
Plugin Developer
Posts: 2570
Joined: Sat Jun 30, 2007 2:51 pm
Location: Stockholm, Sweden
Contact:

Re: Support for "states" and not just events

Post by krambriw »

There are a couple of ways to handle states in EG (and in python), both in runtime as well as making them persistent. One way is what is described in the previous post. Other ways would involve python scripts that are triggered by events. Inside the python code, you can have variables for states, normally in runtime (in memory) but it is also possible to use persistence (eg.PersistentData, pickle, sql, files, etc)

BestR Walter
Post Reply