device neues reading per notify setzen

Begonnen von Hackstall, 07 März 2018, 20:35:44

Vorheriges Thema - Nächstes Thema

Hackstall

Hallo ich bin etwas am verzweifeln. Vielleicht kann mir jemand weiterhelfen.

Ich möchte einem Device ein neues Reading zufügen und dieses dann aus einem notify heraus setzen können und dann auch in der DBLog speichern.
Es schein auch zu funktionieren jedoch taucht hier mein Reading "running" nicht in der DB auf.

Bitte beachten current, energy, power,voltage sind default readings vom device
running hätte ich gern zugefügt und in die DB bei Änderungen eingefügt (siehe notify).

Kann mir jemand weiterhelfen. Danke.

Mein Code is folgendermassen:


define KE_Waschmaschine_Miele_1764 ZWave xyz
attr KE_Waschmaschine_Miele_1764 DbLogExclude .*
attr KE_Waschmaschine_Miele_1764 DbLogInclude current,energy,power,voltage,running,state
attr KE_Waschmaschine_Miele_1764 IODev ZWDongle_1
attr KE_Waschmaschine_Miele_1764 classes ZWAVEPLUS_INFO MANUFACTURER_SPECIFIC VERSION ASSOCIATION ASSOCIATION_GRP_INFO DEVICE_RESET_LOCALLY POWERLEVEL CONFIGURATION SWITCH_BINARY SWITCH_ALL ALARM METER BASIC
attr KE_Waschmaschine_Miele_1764 group WallPlug
attr KE_Waschmaschine_Miele_1764 icon scene_laundry_room_fem
attr KE_Waschmaschine_Miele_1764 room 3.1_UG_WaschKeller,ZWave
attr KE_Waschmaschine_Miele_1764 sortby 1
attr KE_Waschmaschine_Miele_1764 vclasses ALARM:8 ASSOCIATION:2 ASSOCIATION_GRP_INFO:1 BASIC:1 CONFIGURATION:1 DEVICE_RESET_LOCALLY:1 MANUFACTURER_SPECIFIC:2 METER:4 POWERLEVEL:1 SWITCH_ALL:1 SWITCH_BINARY:1 VERSION:2 ZWAVEPLUS_INFO:2


define ntfy_KE_Waschmaschine_Miele_1764_start notify KE_Waschmaschine_Miele_1764:power:.* {\
     if ($EVTPART1 > 10.0 && ReadingsVal("KE_Waschmaschine_Miele_1764", "running", "off") eq "off")\
    {\
          fhem("setreading KE_Waschmaschine_Miele_1764 running on");;\
        };;\
     if ($EVTPART1 < 2.0 && ReadingsVal("KE_Waschmaschine_Miele_1764", "running", "off") eq "on")\
    {\
          fhem("setreading KE_Waschmaschine_Miele_1764 running off");;\
        };;\
}


CoolTux

Schau in den Eventmonitor ob dort das setzen deines Readings auf taucht
Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net

Hackstall

Danke für die Antwort aber ich habe bereits im Room nach den Readings geschaut und dort taucht der entsprechende Reading "running"
aktualisiert auf. Also wenn die Waschmaschine läuft wird running auf "on" gesetzt und wenn sie nicht läuft auf "off".



CoolTux

Es ist ein Unterschied ob ein Reading gesetzt wird oder ob das setzen ein Event auslöst.
Aber du scheinst das Problem ja gelöst zu haben.


Grüße
Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net

Hackstall

Sorry aber das Problem existiert weiterhin.
Ein event wurde anscheinend nicht ausgelöst.
Lediglich das setzen aus dem notify fand wohl statt.

Bitte noch ein Gedankenanstoss.
Würde mein Problem gerne lösen.

Habe kein userreading angelegt. Lediglich den set Befehl im notify implementiert.
kann das funktionieren?

Danke AK

CoolTux

Du siehst also für
KE_Waschmaschine_Miele_1764 running off

kein Event im Eventmonitor, richtig? Eigentlich sollte aber ein Event kommen. Dein Notify springt aber an? Wird also getriggert?

Bitte gebe ein list von
KE_Waschmaschine_Miele_1764
ntfy_KE_Waschmaschine_Miele_1764_start
und des dbLog Devices

Der Befehl heißt "list"
Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net

Hackstall

Hallo,

ja der notify springt an und setzt mir den richtigen zustand on,off
ich habe auchmal on in on1 und off in off2 geändert und dieses wird angezeigt.

der list. Befehl ergab folgendes:

Internals:
   DEF        KU_Spuelmaschine:power:.* {
     if ($EVTPART1 > 10.0 && ReadingsVal("KU_Spuelmaschine", "running", "off") eq "off")
    {
fhem("setreading KU_Spuelmaschine running on");
        }
     if ($EVTPART1 < 2.0 && ReadingsVal("KU_Spuelmaschine", "running", "off") eq "on")
    {
          fhem("setreading KU_Spuelmaschine running off");
        }
}
   NAME       ntfy_KU_Spuelmaschine_start
   NOTIFYDEV  KU_Spuelmaschine
   NR         795
   NTFY_ORDER 50-ntfy_KU_Spuelmaschine_start
   REGEXP     KU_Spuelmaschine:power:.*
   STATE      active
   TYPE       notify
   READINGS:
     2018-03-08 20:14:52   state           active
Attributes:

CoolTux

Zitat von: CoolTux am 08 März 2018, 06:18:37
Bitte gebe ein list von
KE_Waschmaschine_Miele_1764
ntfy_KE_Waschmaschine_Miele_1764_start
und des dbLog Devices
Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net

Hackstall

Hallo und danke dass Du mir hilfst.

List Antworten siehe nachfolgend:

list KE_Waschmaschine_Miele_1764


Internals:
   DEF        d6b4118c 2
   IODev      ZWDongle_1
   LASTInputDev ZWDongle_1
   MSGCNT     35
   NAME       KE_Waschmaschine_Miele_1764
   NR         799
   STATE      on
   TYPE       ZWave
   ZWDongle_1_MSGCNT 35
   ZWDongle_1_RAWMSG 000400020a3202a14a0000012d0000
   ZWDongle_1_TIME 2018-03-08 20:57:06
   ZWaveSubDevice no
   homeId     d6b4118c
   isWakeUp   
   nodeIdHex  02
   Helper:
     DBLOG:
       current:
         DBLogging:
           TIME       1520539026.24613
           VALUE      0
       energy:
         DBLogging:
           TIME       1520539024.13341
           VALUE      2.49
       power:
         DBLogging:
           TIME       1520538723.22323
           VALUE      0
       voltage:
         DBLogging:
           TIME       1520539025.24815
           VALUE      234.34
   READINGS:
     2018-03-08 20:57:06   current          0 A previous: 0 delta_time: 301 s
     2018-03-08 20:57:04   energy           2.49 kWh previous: 2.49 delta_time: 301 s
     2018-03-08 20:52:03   power            0 W previous: 0 delta_time: 301 s
     2018-03-07 19:05:42   running         off
     2018-03-04 10:59:22   state           on
     2018-03-04 10:59:22   timeToAck       0.159
     2018-03-04 10:59:22   transmit        OK
     2018-03-08 20:57:05   voltage          234.34 V previous: 234.55 delta_time: 301 s
Attributes:
   DbLogExclude .*
   DbLogInclude current,energy,power,voltage,running,state
   IODev      ZWDongle_1
   classes    ZWAVEPLUS_INFO MANUFACTURER_SPECIFIC VERSION ASSOCIATION ASSOCIATION_GRP_INFO DEVICE_RESET_LOCALLY POWERLEVEL CONFIGURATION SWITCH_BINARY SWITCH_ALL ALARM METER BASIC
   group      WallPlug
   icon       scene_laundry_room_fem
   room       3.1_UG_WaschKeller,ZWave
   sortby     1
   vclasses   ALARM:8 ASSOCIATION:2 ASSOCIATION_GRP_INFO:1 BASIC:1 CONFIGURATION:1 DEVICE_RESET_LOCALLY:1 MANUFACTURER_SPECIFIC:2 METER:4 POWERLEVEL:1 SWITCH_ALL:1 SWITCH_BINARY:1 VERSION:2 ZWAVEPLUS_INFO:2


list ntfy_KE_Waschmaschine_Miele_1764_start


   DEF        KE_Waschmaschine_Miele_1764:power:.* {
     if ($EVTPART1 > 10.0 && ReadingsVal("KE_Waschmaschine_Miele_1764", "running", "off") eq "off")
    {
          fhem("setreading KE_Waschmaschine_Miele_1764 running on");
        };
     if ($EVTPART1 < 2.0 && ReadingsVal("KE_Waschmaschine_Miele_1764", "running", "off") eq "on")
    {
          fhem("setreading KE_Waschmaschine_Miele_1764 running off");
        };
}
   NAME       ntfy_KE_Waschmaschine_Miele_1764_start
   NOTIFYDEV  KE_Waschmaschine_Miele_1764
   NR         806
   NTFY_ORDER 50-ntfy_KE_Waschmaschine_Miele_1764_start
   REGEXP     KE_Waschmaschine_Miele_1764:power:.*
   STATE      2018-03-08 21:02:04
   TYPE       notify
   READINGS:
     2018-03-08 20:14:52   state           active
Attributes:


list debugging


Internals:
   COLUMNS    field length used for Device: 64, Type: 64, Event: 512, Reading: 64, Value: 128, Unit: 32
   CONFIGURATION /opt/fhem/contrib/dblog/db.conf
   DEF        /opt/fhem/contrib/dblog/db.conf .*:.*
   MODE       asynchronous
   MODEL      MYSQL
   NAME       DBLogging
   NR         142
   NTFY_ORDER 50-DBLogging
   PID        8
   REGEXP     .*:.*
   STATE      connected
   TYPE       DbLog
   UTF8       0
   VERSION    3.8.6
   dbconn     mysql:database=fhem;host=192.168.0.30;port=3306
   dbuser     fhemuser
   HELPER:
     COLSET     1
     DEVICECOL  64
     EVENTCOL   512
     OLDSTATE   connected
     READINGCOL 64
     TYPECOL    64
     UNITCOL    32
     VALUECOL   128
   READINGS:
     2018-03-08 21:04:52   CacheUsage      17
     2018-03-08 21:04:52   NextSync        2018-03-08 21:05:07 or if CacheUsage 100 reached
     2018-03-08 03:00:00   reduceLogState  reduceLogNbl finished. Rows processed: 0, deleted: 0, updated: 0, time: 0.00sec
     2018-03-08 21:04:52   state           connected
   cache:
     index      1040
Attributes:
   DbLogExclude .*
   DbLogSelectionMode Include
   DbLogType  Current/History
   alias      Database-Log
   asyncMode  1
   cacheLimit 100
   group      Logging
   icon       system_backup
   room       9.7_Logging
   syncInterval 15

CoolTux

Ich kann da jetzt nicht wirklich ein Problem erkennen.
Eigentlich sollte das setzen des Readings running ein Event auslösen.
Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net

Hackstall

Schade,
Nur mein Logging funktioniert nicht.
Wenn ich den Setreading von Hand gebe
funktionierts.

Gibt es eine Alternativ-Implementierung?
Dsnke AK



CoolTux

Wenn du also in FHEMWEB oben in der Kommandozeile eingibst
setreading DEVICE READING VALUE
das geht das?

Aber über Deine notify geht es nicht?

Du könntest die Routine direkt aufrufen

CommandSetReading(undef,'DEVICE READING VALUE');


Bezweifel aber das es dadurch besser wird.
Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net

Hackstall

Hallo, danke
Ja manuelles kommandieren fuehrt zu logging.
Ich habe mal gegoogelt. Da wird von einem
Sleep erzaehlt.
Koennte das helfen und wenn ja wo muesste das dleeo
Hin?
Danke A. Krause

CoolTux


fhem("sleep 2; setreading KE_Waschmaschine_Miele_1764 running off");
Du musst nicht wissen wie es geht! Du musst nur wissen wo es steht, wie es geht.
Support me to buy new test hardware for development: https://www.paypal.com/paypalme/MOldenburg
My FHEM Git: https://git.cooltux.net/FHEM/
Das TuxNet Wiki:
https://www.cooltux.net