Mehrere Readings bei dummy

Begonnen von Stril, 20 Mai 2015, 18:19:36

Vorheriges Thema - Nächstes Thema

Stril

Hallo!

Kennt ihr irgendeine Möglichkeit, bei einem Dummy mehrere Readings zu nutzen?
Aktuell habe ich immer nur "State", aber ein "Zweit-Reading" wäre schon praktisch.

Gruß und danke
Phil

justme1968

schau dir setreading an.

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

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

Stril


igami

Ich nutze dafür ein notify

Internals:
   CFGFN
   DEF        (cc|d)_.* {
if(($EVENT ~~ / /) and ($EVENT !~ /: /))
  {fhem("sleep 0.001; setreading $NAME $EVENT")}
}
   NAME       ntfy_setreading
   NR         30
   NTFY_ORDER 50-ntfy_setreading
   REGEXP     (cc|d)_.*
   STATE      active
   TYPE       notify

Die Regex muss bei dir wahrscheinlich anders sein, bei mir fangen alle dummy mit cc_ oder d_ an. Soweit ich weiß ist ein triggern auf TYPE=dummy nicht möglich.
Im Dummy nutze ich dann einfach die setList. Zum Beispiel für meine Waschmaschine:

Internals:
   CFGFN
   NAME       d_Waschmaschine
   NR         2496
   STATE      controlMode manual
   TYPE       dummy
   CHANGETIME:
   Helper:
     Dblog:
       Controlmode:
         Dblog:
           TIME       1431946320.12812
           VALUE      manual
       State:
         Dblog:
           TIME       1431946320.00825
           VALUE      controlMode manual
       Stoptime:
         Dblog:
           TIME       1431920869.63159
           VALUE      15:30
   Readings:
     2015-05-18 12:52:00   controlMode     manual
     2015-05-18 12:52:00   state           controlMode manual
     2015-05-18 05:47:49   stopTime        15:30
Attributes:
   alias      Waschmaschine
   room       0.6:Waschkeller
   setList    controlMode:auto,manual stopTime:00:00,00:15,00:30,00:45,01:00,01:15,01:30,01:45,02:00,02:15,02:30,02:45,03:00,03:15,03:30,03:45,04:00,04:15,04:30,04:45,05:00,05:15,05:30,05:45,06:00,06:15,06:30,06:45,07:00,07:15,07:30,07:45,08:00,08:15,08:30,08:45,09:00,09:15,09:30,09:45,10:00,10:15,10:30,10:45,11:00,11:15,11:30,11:45,12:00,12:15,12:30,12:45,13:00,13:15,13:30,13:45,14:00,14:15,14:30,14:45,15:00,15:15,15:30,15:45,16:00,16:15,16:30,16:45,17:00,17:15,17:30,17:45,18:00,18:15,18:30,18:45,19:00,19:15,19:30,19:45,20:00,20:15,20:30,20:45,21:00,21:15,21:30,21:45,22:00,22:15,22:30,22:45,23:00,23:15,23:30,23:45,
   webCmd     stopTime:controlMode

Im Eventmonitor erscheinen dann zwei Events

2015-05-20 18:50:21 dummy d_Waschmaschine stopTime 15:15
2015-05-20 18:50:21 dummy d_Waschmaschine stopTime: 15:15


Vielleicht ist das ja auch nützlich für dich.

Grüße
igami
Pi3 mit fhem.cfg + DbLog/logProxy
Komm vorbei zum FHEM Treffen im Kreis Gütersloh! Das nächste Mal im April 2020.

MAINTAINER: archetype, LuftdatenInfo, monitoring, msgDialog, Nmap, powerMap
ToDo: AVScene, FluxLED

Stril

Hallo igami!

Danke!

Wofür hast Du denn das sleep im  notify drin?

Viele Grüße
Phil

justme1968

sonst löst das setreading in diesem fall kein event aus auf das du in einem weiteren notify reagieren könntest.

gruß
  andre
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

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