[gelöst] Gleiches Template, gleiches Gerät aber unterschiedliche Readings

Begonnen von miche, 16 Oktober 2022, 19:40:34

Vorheriges Thema - Nächstes Thema

miche

Hallo,

ich habe 2 Shells Plus 1PM eingebaut.
MQTT2 Device wurde automatisch angelegt.
Ich bekomme aber nicht die gleichen Readings, nur warum

Hier mal ein List vom Device:

Internals:
   CID        shellyplus1pm_a8032ab20cdc
   DEF        shellyplus1pm_a8032ab20cdc
   FUUID      63406371-f33f-9454-7a9f-2de0a9224a7cc947
   IODev      Mosquitto2
   LASTInputDev Mosquitto2
   MSGCNT     43330
   Mosquitto2_CONN Mosquitto2_192.168.20.164_62411
   Mosquitto2_MSGCNT 43330
   Mosquitto2_TIME 2022-10-16 19:32:00
   NAME       Trockner
   NR         375
   STATE      on
   TYPE       MQTT2_DEVICE
   eventCount 43315
   Helper:
     DBLOG:
       params_switch_0_apower:
         logdb:
           TIME       1665940791.98479
           VALUE      538.9
       temperature:
         logdb:
           TIME       1665941520.03301
           VALUE      57.5
   JSONMAP:
     params_switch_0_temperature_tC temperature
     params_switch_0_temperature_tF 0
     params_wifi_sta_ip ip
     result_in_mode in_mode
     switch_aenergy_total aenergy_total
     switch_apower apower
     switch_state state
     switch_temperature_tC temperature
     switch_temperature_tF 0
   READINGS:
     2022-10-08 04:13:51   IODev           Mosquitto2
     2022-10-16 19:32:00   aenergy_total   9298.225
     2022-10-16 19:32:00   apower          531.4
     2022-10-07 20:10:25   attrTemplateVersion 20220303
     2022-10-16 19:31:59   dst             shellyplus1pm-a8032ab20cdc/events
     2022-10-07 20:10:29   ip              192.168.20.164
     2022-10-16 19:31:59   method          NotifyStatus
     2022-10-08 04:14:04   mqtt_connected  true
     2022-10-08 04:14:04   online          true
     2022-10-16 03:41:23   params_cloud_connected true
     2022-10-07 21:03:12   params_events_1_cfg_rev 11
     2022-10-07 21:03:12   params_events_1_component sys
     2022-10-07 21:03:12   params_events_1_event ota_success
     2022-10-07 21:03:12   params_events_1_msg Update applied, rebooting
     2022-10-07 21:03:11   params_events_1_progress_percent 99
     2022-10-07 21:03:12   params_events_1_restart_required false
     2022-10-07 21:03:12   params_events_1_ts 1665169393.74
     2022-10-08 04:14:04   params_mqtt_connected true
     2022-10-16 19:31:59   params_switch_0_aenergy_by_minute_1 8980.823
     2022-10-16 19:31:59   params_switch_0_aenergy_by_minute_2 8921.856
     2022-10-16 19:31:59   params_switch_0_aenergy_by_minute_3 8973.267
     2022-10-16 19:31:59   params_switch_0_aenergy_minute_ts 1665941518
     2022-10-16 19:31:59   params_switch_0_aenergy_total 9298.225
     2022-10-16 19:19:51   params_switch_0_apower 538.9
     2022-10-16 19:28:09   params_switch_0_current 2.396
     2022-10-16 19:31:59   params_switch_0_id 0
     2022-10-08 04:01:34   params_switch_0_output true
     2022-10-08 04:01:34   params_switch_0_source HTTP
     2022-10-16 18:27:52   params_switch_0_voltage 224.7
     2022-10-13 21:03:10   params_sys_available_updates_beta_version 0.11.3-beta1
     2022-10-15 21:03:06   params_sys_available_updates_stable_version 0.11.3
     2022-10-16 19:31:59   params_ts       1665941520.21
     2022-10-07 20:10:29   params_wifi_rssi -78
     2022-10-07 20:10:29   params_wifi_ssid ABOFALLE
     2022-10-07 20:10:29   params_wifi_status got ip
     2022-10-16 19:31:59   src             shellyplus1pm-a8032ab20cdc
     2022-10-16 19:32:00   statTemperatureDay Min: 55.30 Avg: 55.88 Max: 57.50
     2022-10-15 23:59:55   statTemperatureDayLast Min: 55.40 Avg: 56.36 Max: 58.00
     2022-10-16 19:32:00   statTemperatureMonth Min: 0.00 Avg: 43.94 Max: 58.60
     2022-10-16 19:32:00   statTemperatureYear Min: 0.00 Avg: 35.74 Max: 58.60 (since:  )
     2022-10-16 19:32:00   state           on
     2022-10-16 19:32:00   switch_aenergy_by_minute_1 8980.823
     2022-10-16 19:32:00   switch_aenergy_by_minute_2 8921.856
     2022-10-16 19:32:00   switch_aenergy_by_minute_3 8973.267
     2022-10-16 19:32:00   switch_aenergy_minute_ts 1665941518
     2022-10-16 19:32:00   switch_current  2.415
     2022-10-16 19:32:00   switch_id       0
     2022-10-16 19:32:00   switch_source   HTTP
     2022-10-16 19:32:00   switch_voltage  223.7
     2022-10-13 21:03:10   sys_available_updates_beta_version 0.11.3-beta1
     2022-10-15 21:03:06   sys_available_updates_stable_version 0.11.3
     2022-10-15 21:03:06   sys_cfg_rev     12
     2022-10-15 21:03:06   sys_fs_free     163840
     2022-10-15 21:03:06   sys_fs_size     458752
     2022-10-15 21:03:06   sys_kvs_rev     0
     2022-10-15 21:03:06   sys_mac         A8032AB20CDC
     2022-10-15 21:03:06   sys_ram_free    141600
     2022-10-15 21:03:06   sys_ram_size    249560
     2022-10-15 21:03:06   sys_restart_required false
     2022-10-15 21:03:06   sys_schedule_rev 0
     2022-10-15 21:03:06   sys_time        21:03
     2022-10-15 21:03:06   sys_unixtime    1665860587
     2022-10-15 21:03:06   sys_uptime      691212
     2022-10-15 21:03:06   sys_webhook_rev 0
     2022-10-16 19:32:00   temperature     57.5
     2022-10-07 20:10:25   x_reboot        set
   helper:
     _98_statistics Stromverbrauch
Attributes:
   devStateIcon {my $onl = ReadingsVal($name,'online','false') eq 'false'?'10px-kreis-rot':'10px-kreis-gruen'; $onl = FW_makeImage($onl); my $light = FW_makeImage(ReadingsVal($name,'state','off')); my $cons = ReadingsNum($name,'apower',0); my $total = round(ReadingsNum($name,'aenergy_total',0)/1000,3); my $temp = ReadingsVal($name,'temperature','-100'); my $ip = ReadingsVal($name,'ip','none'); my $reb = ReadingsVal($name,'sys_restart_required','false') eq 'true'?'<a href="/fhem?cmd.dummy=set '.$name.' x_reboot&XHR=1"> ... Notwendigen Reboot durchführen</a>':''; qq(<a href="http://$ip" target="_blank">${onl}</a><a href="/fhem?cmd.dummy=set $name toggle&XHR=1">${light}</a>$reb<div>Verbrauch: $cons W / Total: $total kwh / Temp: $temp °C</div>)}
   devicetopic shellyplus1pm-a8032ab20cdc
   genericDeviceType switch
   getList    in_mode:noArg in_mode $DEVICETOPIC/rpc {"id": 1,"src":"$DEVICETOPIC", "method": "Switch.GetConfig", "params": {"id": 0}}
   icon       message_socket
   jsonMap    switch_state:state switch_aenergy_total:aenergy_total switch_apower:apower switch_temperature_tC:temperature switch_temperature_tF:0 params_wifi_sta_ip:ip params_switch_0_temperature_tC:temperature params_switch_0_temperature_tF:0 result_in_mode:in_mode
   model      shellyPlus_1pm
   readingList $DEVICETOPIC/online:.* online
  $DEVICETOPIC/events/rpc:.* { json2nameValue($EVENT,'',$JSONMAP) }
  $DEVICETOPIC/status/mqtt:.* { json2nameValue($EVENT, 'mqtt_', $JSONMAP) }
  $DEVICETOPIC/status/sys:.* { json2nameValue($EVENT, 'sys_', $JSONMAP) }
  $DEVICETOPIC/status/switch_0:.* { $EVENT =~ s/"output":true/"state":"on"/g; $EVENT =~ s/"output":false/"state":"off"/g; json2nameValue($EVENT, 'switch_', $JSONMAP) }
  $DEVICETOPIC/status/cloud:.* {}
  $DEVICETOPIC/rpc:.* { json2nameValue($EVENT, 'req_', $JSONMAP, 'in_mode')}
  $DEVICETOPIC/status/input_0:.* { json2nameValue($EVENT, 'input_', $JSONMAP) }
  fhem2shelly/rpc:.* {}
   room       HWR,MQTT2_DEVICE
   setList    toggle:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Toggle","params": {"id":0}}
  off:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Set","params": {"id":0,"on":false}}
  on:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Set","params": {"id":0,"on":true}}
  on-for-timer $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Set","params": {"id":0,"on":true,"toggle_after":$EVTPART1}}
  off-for-timer $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Set","params": {"id":0,"on":false,"toggle_after":$EVTPART1}}
  in_mode:toggle,flip,detached {fhem("sleep 0.2; get $NAME in_mode"); my $val = $EVTPART1 ne 'toggle' ? $EVTPART1 : ReadingsVal($NAME,'in_mode','flip') eq 'flip' ? 'detached':'flip'; qq($DEVICETOPIC/rpc {"id":1,"src":"fhem2shelly","method":"Switch.SetConfig","params": {"id":0, "config": {"in_mode": "$val"}}})}
  x_update:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Shelly.Update","params": {"stage":"stable"}}
  x_reboot:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Shelly.Reboot"}
  x_eco:true,false $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Sys.SetConfig","params": {"config": {"device": {"eco_mode": $EVTPART1}}}}
   setStateList on off toggle on-for-timer off-for-timer
   webCmd     :


Internals:
   CID        shellyplus1pm_a8032ab75ba4
   DEF        shellyplus1pm_a8032ab75ba4
   FUUID      6340da86-f33f-9454-9c85-4897dc92dcde3933
   IODev      Mosquitto2
   LASTInputDev Mosquitto2
   MSGCNT     54822
   Mosquitto2_CONN Mosquitto2_192.168.20.162_58874
   Mosquitto2_MSGCNT 54822
   Mosquitto2_TIME 2022-10-16 19:33:00
   NAME       Waschmaschine
   NR         376
   STATE      set_toggle
   TYPE       MQTT2_DEVICE
   eventCount 54842
   Helper:
     DBLOG:
       params_switch_0_apower:
         logdb:
           TIME       1665938116.45516
           VALUE      0.0
       temperature:
         logdb:
           TIME       1665936710.87564
           VALUE      57.93
   JSONMAP:
     params_switch_0_temperature_tC temperature
     params_switch_0_temperature_tF 0
     params_wifi_sta_ip ip
     result_in_mode in_mode
     switch_aenergy_total aenergy_total
     switch_apower apower
     switch_state state
     switch_temperature_tC temperature
     switch_temperature_tF 0
   OLDREADINGS:
   READINGS:
     2022-10-08 04:13:51   IODev           Mosquitto2
     2022-10-08 04:17:46   attrTemplateVersion 20220303
     2022-10-16 19:33:00   dst             shellyplus1pm-a8032ab75ba4/events
     2022-10-16 19:33:00   method          NotifyStatus
     2022-10-16 09:00:20   online          true
     2022-10-16 09:00:22   params_cloud_connected true
     2022-10-16 09:00:20   params_mqtt_connected true
     2022-10-16 19:33:00   params_switch_0_aenergy_by_minute_1 1.012
     2022-10-16 19:33:00   params_switch_0_aenergy_by_minute_2 0.506
     2022-10-16 19:33:00   params_switch_0_aenergy_by_minute_3 0.506
     2022-10-16 19:33:00   params_switch_0_aenergy_minute_ts 1665941578
     2022-10-16 19:33:00   params_switch_0_aenergy_total 8444.972
     2022-10-16 18:35:16   params_switch_0_apower 0.0
     2022-10-16 18:35:14   params_switch_0_current 0.000
     2022-10-16 19:33:00   params_switch_0_id 0
     2022-10-08 04:20:28   params_switch_0_output true
     2022-10-08 04:20:28   params_switch_0_source MQTT
     2022-10-16 14:43:44   params_switch_0_voltage 227.7
     2022-10-14 04:19:42   params_sys_available_updates_beta_version 0.11.3-beta1
     2022-10-16 04:19:39   params_sys_available_updates_stable_version 0.11.3
     2022-10-16 19:33:00   params_ts       1665941580.85
     2022-10-08 04:19:41   rpc_dst         shellyplus1pm-a8032ab75ba5/events
     2022-10-08 04:19:41   rpc_method      NotifyStatus
     2022-10-08 04:19:41   rpc_params_events_1_cfg_rev 18
     2022-10-08 04:19:41   rpc_params_events_1_component mqtt
     2022-10-08 04:19:41   rpc_params_events_1_event config_changed
     2022-10-08 04:19:41   rpc_params_events_1_restart_required true
     2022-10-08 04:19:41   rpc_params_events_1_ts 1665195582.14
     2022-10-08 04:19:23   rpc_params_switch_0_aenergy_by_minute_1 0.506
     2022-10-08 04:19:23   rpc_params_switch_0_aenergy_by_minute_2 0.506
     2022-10-08 04:19:23   rpc_params_switch_0_aenergy_by_minute_3 1.012
     2022-10-08 04:19:23   rpc_params_switch_0_aenergy_minute_ts 1665195538
     2022-10-08 04:19:23   rpc_params_switch_0_aenergy_total 7.595
     2022-10-08 04:19:09   rpc_params_switch_0_apower 0
     2022-10-08 04:19:09   rpc_params_switch_0_current 0
     2022-10-08 04:19:23   rpc_params_switch_0_id 0
     2022-10-08 04:19:10   rpc_params_switch_0_output true
     2022-10-08 04:19:10   rpc_params_switch_0_source HTTP
     2022-10-08 04:19:41   rpc_params_sys_cfg_rev 18
     2022-10-08 04:19:41   rpc_params_sys_restart_required true
     2022-10-08 04:19:41   rpc_params_ts   1665195582.14
     2022-10-08 04:19:41   rpc_src         shellyplus1pm-a8032ab75ba4
     2022-10-16 19:33:00   src             shellyplus1pm-a8032ab75ba4
     2022-10-08 14:20:23   statStateDay    on: 00:00:14 on_Count: 1 set_toggle: 11:58:11 set_toggle_Count: 1 (since: 2022-10-08_02:21:58)
     2022-10-08 14:20:23   statStateMonth  on: 00:00:14 on_Count: 1 set_toggle: 11:58:11 set_toggle_Count: 1 (since: 2022-10-08_02:21:58)
     2022-10-08 14:20:23   statStateYear   on: 00:00:14 on_Count: 1 set_toggle: 11:58:11 set_toggle_Count: 1 (since: 2022-10-08_02:21:58)
     2022-10-16 19:33:00   statTemperatureDay Min: 52.83 Avg: 53.98 Max: 73.03
     2022-10-15 23:59:55   statTemperatureDayLast Min: 52.83 Avg: 57.60 Max: 83.31
     2022-10-16 19:33:00   statTemperatureMonth Min: 0.00 Avg: 44.77 Max: 83.31
     2022-10-16 19:33:00   statTemperatureYear Min: 0.00 Avg: 37.28 Max: 83.31 (since:  )
     2022-10-08 04:20:28   state           set_toggle
     2022-10-16 18:11:50   temperature     57.93
     2022-10-08 04:17:45   x_reboot        set
   helper:
     _98_statistics Stromverbrauch
Attributes:
   devStateIcon {my $onl = ReadingsVal($name,'online','false') eq 'false'?'10px-kreis-rot':'10px-kreis-gruen'; $onl = FW_makeImage($onl); my $light = FW_makeImage(ReadingsVal($name,'state','off')); my $cons = ReadingsNum($name,'apower',0); my $total = round(ReadingsNum($name,'aenergy_total',0)/1000,3); my $temp = ReadingsVal($name,'temperature','-100'); my $ip = ReadingsVal($name,'ip','none'); my $reb = ReadingsVal($name,'sys_restart_required','false') eq 'true'?'<a href="/fhem?cmd.dummy=set '.$name.' x_reboot&XHR=1"> ... Notwendigen Reboot durchführen</a>':''; qq(<a href="http://$ip" target="_blank">${onl}</a><a href="/fhem?cmd.dummy=set $name toggle&XHR=1">${light}</a>$reb<div>Verbrauch: $cons W / Total: $total kwh / Temp: $temp °C</div>)}
   devicetopic shellyplus1pm-a8032ab75ba4
   genericDeviceType switch
   getList    in_mode:noArg in_mode $DEVICETOPIC/rpc {"id": 1,"src":"$DEVICETOPIC", "method": "Switch.GetConfig", "params": {"id": 0}}
   icon       message_socket
   jsonMap    switch_state:state switch_aenergy_total:aenergy_total switch_apower:apower switch_temperature_tC:temperature switch_temperature_tF:0 params_wifi_sta_ip:ip params_switch_0_temperature_tC:temperature params_switch_0_temperature_tF:0 result_in_mode:in_mode
   model      shellyPlus_1pm
   readingList $DEVICETOPIC/online:.* online
  $DEVICETOPIC/events/rpc:.* { json2nameValue($EVENT,'',$JSONMAP) }
  $DEVICETOPIC/status/mqtt:.* { json2nameValue($EVENT, 'mqtt_', $JSONMAP) }
  $DEVICETOPIC/status/sys:.* { json2nameValue($EVENT, 'sys_', $JSONMAP) }
  $DEVICETOPIC/status/switch_0:.* { $EVENT =~ s/"output":true/"state":"on"/g; $EVENT =~ s/"output":false/"state":"off"/g; json2nameValue($EVENT, 'switch_', $JSONMAP) }
  $DEVICETOPIC/status/cloud:.* {}
  $DEVICETOPIC/rpc:.* { json2nameValue($EVENT, 'req_', $JSONMAP, 'in_mode')}
  $DEVICETOPIC/status/input_0:.* { json2nameValue($EVENT, 'input_', $JSONMAP) }
  fhem2shelly/rpc:.* {}
shellyplus1pm_a8032ab75ba4:shellyplus1pm-a8032ab75ba5/events/rpc:.* { json2nameValue($EVENT, 'rpc_', $JSONMAP) }
   room       HWR,MQTT2_DEVICE
   setList    toggle:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Toggle","params": {"id":0}}
  off:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Set","params": {"id":0,"on":false}}
  on:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Set","params": {"id":0,"on":true}}
  on-for-timer $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Set","params": {"id":0,"on":true,"toggle_after":$EVTPART1}}
  off-for-timer $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Set","params": {"id":0,"on":false,"toggle_after":$EVTPART1}}
  in_mode:toggle,flip,detached {fhem("sleep 0.2; get $NAME in_mode"); my $val = $EVTPART1 ne 'toggle' ? $EVTPART1 : ReadingsVal($NAME,'in_mode','flip') eq 'flip' ? 'detached':'flip'; qq($DEVICETOPIC/rpc {"id":1,"src":"fhem2shelly","method":"Switch.SetConfig","params": {"id":0, "config": {"in_mode": "$val"}}})}
  x_update:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Shelly.Update","params": {"stage":"stable"}}
  x_reboot:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Shelly.Reboot"}
  x_eco:true,false $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Sys.SetConfig","params": {"config": {"device": {"eco_mode": $EVTPART1}}}}
   setStateList on off toggle on-for-timer off-for-timer
   webCmd


Beim zweiten Device steht auch was von old Readings, wie kommt so was?
Ein Device ging beim State immer on oder off an, das andere geht auf toggle, sollte aber auch gleich sein.

Gruß und Danke

rudolfkoenig

ZitatBeim zweiten Device steht auch was von old Readings, wie kommt so was?
Weil bei dieser Instanz temporaer das Attribut oldreadings gesetzt wurde.
Sollte nach einem FHEM-Neustart verschwinden.

Beta-User

Möglicherweise hilft es auch, den 2. ESP mal neu zu starten, da steht was von "requires reboot".
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: ZigBee2mqtt, MiLight@ESP-GW, BT@OpenMQTTGw | ZWave | SIGNALduino | MapleCUN | RHASSPY
svn: u.a Weekday-&RandomTimer, Twilight,  div. attrTemplate-files, MySensors

miche

FHEM und die Geräte mal neu gestartet.
Brachte leider keinen Erfolg.
Ist schon komisch dass bei zwei gleichen Geräten mit dem gleichen Template unterschiedliche Readings bzw. Unterschiedliches Verhalten rauskommt


Beta-User

Ich habe dir dafür im Moment auch keine Erklärung, und um es zu verstehen, müßte man den MQTT-Verkehr von und zu den Geräten sehen. Falls du da also die Unterschiede rausarbeiten kannst: Gerne.
Auf Heisenbergsche Spontanreaktionen auf der FHEM-Seite würde ich es jedenfalls nicht schieben. Das behandelt alles nach dem voreingestellten Schema (wie hier per attrTemplate soweit erkennbar identisch festgelegt).
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: ZigBee2mqtt, MiLight@ESP-GW, BT@OpenMQTTGw | ZWave | SIGNALduino | MapleCUN | RHASSPY
svn: u.a Weekday-&RandomTimer, Twilight,  div. attrTemplate-files, MySensors

miche

So, Fehler gefunden.
Bei einem Gerät war die Funktion Generic status update over MQTT nicht eingeschaltet. Das war der Unterschied für die gesendeten Daten bei MQTT