How Can I use HourCounter together with EIB and PRESENCE

Begonnen von jussi.peltoniemi, 14 Juli 2015, 13:30:28

Vorheriges Thema - Nächstes Thema


I want to use HourCounter for EIB devices to make statistics and calculation.
I also want to use HourCounter with PRESENCE to make statistics and calculation for example how many hours computer is running or how many hours mobile phone is in home.

Example in wiki is not clear enough.
I do not understand onoff.
EIB and PRESENCE do not have onoff
EIB and PRESENCE have state that should trigger HourCounter.
How can I do that?

For example I have this EIB definition
define Ovi_kosketin_paaovi EIB 1/0/205
define FileLog_Ovi_kosketin_paaovi FileLog ./log/Ovi_kosketin_paaovi-%Y.log Ovi_kosketin_paaovi

I tried these definitions but I do not see any changes in HourCounter countsOverall.
It is always zero.

define Ovi_kosketin_paaovi_counter HourCounter Ovi_kosketin_paaovi:onoff:.on
#define Ovi_kosketin_paaovi_counter HourCounter Ovi_kosketin_paaovi:state:.on
attr Ovi_kosketin_paaovi userReadings onoff {(ReadingsVal("Ovi_kosketin_paaovi","state","on") = "on")?1:0;;}


It's not something I've tried but a search for presence gplot brings up some links that may be useful as a start, at least describing how to get a value from a gplot file
Feel free to follow up in German if you prefer