multiple trigger

Begonnen von hplus, 17 Dezember 2015, 18:24:31

Vorheriges Thema - Nächstes Thema

hplus

Hi,

I am new to fhem, but this software seems really powerfull.
I have a problem with my notify command. It triggers several time because here's  how my events looks like:

2015-12-17 18:17:42 SWAP SWAP_24 0C.0-Temperature: 027E
2015-12-17 18:17:42 SWAP SWAP_24 0C.1-Humidity: 02B1
2015-12-17 18:17:42 SWAP SWAP_24 temperature: 13.8
2015-12-17 18:17:42 SWAP SWAP_24 humidity: 68.9
2015-12-17 18:17:43 SWAP SWAP_24 0B-Voltage: 0B46
2015-12-17 18:17:43 SWAP SWAP_24 voltage: 2.886

and my notify is:
define panstamp24 notify SWAP_24 {  my $temp = ReadingsVal("SWAP_24", "temperature", "");; my $hum = ReadingsVal("SWAP_24", "humidity", "");; system("/home/cubie/temphum.py 674 $temp $hum") }

it works and does the jobs, but it  triggers 6 times...

is there a solution for this ? how should i match the device and event properly?

Thank you for your help

Hplus

justme1968

you have to tell the notify on what exactly it should trigger. something like this:define panstamp24 notify SWAP_24:temperature.* {  my $temp = ReadingsVal("SWAP_24", "temperature", "");; my $hum = ReadingsVal("SWAP_24", "humidity", "");; system("/home/cubie/temphum.py 674 $temp $hum") }


you don't need to call ReadingsVal for the value of the current event:define panstamp24 notify SWAP_24:temperature.* {  my $hum = ReadingsVal("SWAP_24", "humidity", "");; system("/home/cubie/temphum.py 674 $EVTPART1 $hum") }


regards
  andre
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

https://github.com/sponsors/justme-1968

hplus

Thanks a lot it works.

Cheers