#erledigt# Shelly pro4pm per MQTT2 gleiche Werte auf 3 Kanälen

Begonnen von Helmi55, 01 Mai 2022, 19:36:34

Vorheriges Thema - Nächstes Thema

Helmi55

N#abend
stehe im Moment vor einem Rätsel (wahrscheinlich sitzt das Rätsel vor dem Monitor  ;D)
Habe einen pro4pm per MQTT2 an FHEM angebunden und das attrTemplate dafür ausgewählt.
Dann habe ich, da nur der erste Kanal die devStateIcon hatte, diese auf alle weiteren 3 Kanäle "kopiert2.
{my $onl = ReadingsVal($name,'online','false') eq 'false'?'10px-kreis-rot': ReadingsVal($name,'new_fw','false') eq 'true' ? '10px-kreis-gelb' : '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,1); my $temp = ReadingsVal($name,'temperature_tC','-100'); my $ip = ReadingsVal($name,'ip','none'); qq(<a href="http://$ip" target="_blank">${onl}</a><a href="/fhem?cmd.dummy=set $name toggle&XHR=1">${light}</a><div>Verbrauch: $cons W / Total: $total kwh / Temp: $temp °C</div>)}
Ich konnte mir nix spezielles würden Kanal erkennen?

Dann habe ich noch für die Berechnung das userReadings auf alle Kanäle kopiert
aenergy_total_kWh:aenergy_total.* monotonic {ReadingsNum($NAME,"aenergy_total",0)/1000.0}, Kosten:aenergy_total_kWh.* { sprintf("%.2f",(ReadingsNum($NAME,"aenergy_total_kWh",0) + 0.0)*.2);;}

Nun muss ich feststellen das "Energy_total_kWh" bis auf Kanal 1 überall gleich ist.
Obwohl hier noch keine Last angelegt war.

List Kanal1:
Internals:
   CID        shellypro4pm_083af27b3304
   DEF        shellypro4pm_083af27b3304
   FUUID      626e755f-f33f-b033-6ad3-98cf3994bf96291e
   IODev      myBroker
   LASTInputDev myBroker
   MSGCNT     3578
   NAME       MQTT2_shellypro4pm_083af27b3304
   NR         549
   STATE      off
   TYPE       MQTT2_DEVICE
   myBroker_CONN myBroker_10.0.0.186_54067
   myBroker_MSGCNT 3578
   myBroker_TIME 2022-05-01 19:34:01
   JSONMAP:
     params_switch_0_aenergy_total aenergy_total
     params_switch_0_apower apower
     params_switch_0_state state
     params_switch_0_temperature_tC temperature
     params_switch_0_temperature_tF 0
     params_wifi_sta_ip ip
   READINGS:
     2022-05-01 15:09:59   IODev           myBroker
     2022-05-01 19:33:38   Kosten          0.24
     2022-05-01 19:34:01   aenergy_by_minute_1 0.000
     2022-05-01 19:34:01   aenergy_by_minute_2 0.000
     2022-05-01 19:34:01   aenergy_by_minute_3 0.000
     2022-05-01 19:34:01   aenergy_minute_ts 1651426439
     2022-05-01 19:34:01   aenergy_total   0.000
     2022-05-01 19:34:01   aenergy_total_kWh 1.202302
     2022-05-01 19:34:01   apower          0.0
     2022-05-01 13:58:00   associatedWith  MQTT2_shellypro4pm_083af27b3304_CH2,MQTT2_shellypro4pm_083af27b3304_CH3,MQTT2_shellypro4pm_083af27b3304_CH4
     2022-05-01 13:58:00   attrTemplateVersion 20220115
     2022-05-01 13:58:21   cfg_rev         10
     2022-05-01 15:10:27   connected       true
     2022-05-01 19:34:01   current         0.000
     2022-05-01 19:34:01   dst             shellypro4pm-083af27b3304/events
     2022-05-01 13:58:21   fs_free         282624
     2022-05-01 13:58:21   fs_size         524288
     2022-05-01 19:34:01   id              3
     2022-05-01 13:58:21   mac             083AF27B3304
     2022-05-01 19:34:01   method          NotifyStatus
     2022-05-01 15:10:27   online          true
     2022-05-01 19:34:01   output          false
     2022-05-01 15:10:27   params_mqtt_connected true
     2022-05-01 19:34:01   params_switch_0_aenergy_by_minute_1 0.000
     2022-05-01 19:34:01   params_switch_0_aenergy_by_minute_2 0.000
     2022-05-01 19:34:01   params_switch_0_aenergy_by_minute_3 0.000
     2022-05-01 19:34:01   params_switch_0_aenergy_minute_ts 1651426439
     2022-05-01 15:53:06   params_switch_0_current 0
     2022-05-01 19:34:01   params_switch_0_id 0
     2022-05-01 15:53:06   params_switch_0_pf 0
     2022-05-01 15:53:06   params_switch_0_source MQTT
     2022-05-01 19:34:01   params_ts       1651426440.50
     2022-05-01 19:34:01   pf              0.00
     2022-05-01 13:58:21   ram_free        152000
     2022-05-01 13:58:21   ram_size        238236
     2022-05-01 13:58:21   restart_required false
     2022-05-01 19:34:01   source          MQTT
     2022-05-01 19:34:01   src             shellypro4pm-083af27b3304
     2022-05-01 15:53:06   state           off
     2022-05-01 16:10:35   temperature     25.52
     2022-05-01 19:34:01   temperature_tC  25.4
     2022-05-01 19:34:01   temperature_tF  77.8
     2022-05-01 13:58:21   time            13:58
     2022-05-01 13:58:21   unixtime        1651406301
     2022-05-01 13:58:21   uptime          18
     2022-05-01 19:34:01   voltage         232.3
     2022-05-01 13:57:59   x_reboot        set
Attributes:
   comment    Channel 1 for MQTT2_shellypro4pm_083af27b3304, see also MQTT2_shellypro4pm_083af27b3304_CH2, MQTT2_shellypro4pm_083af27b3304_CH3 and MQTT2_shellypro4pm_083af27b3304_CH4
   devStateIcon {my $onl = ReadingsVal($name,'online','false') eq 'false'?'10px-kreis-rot': ReadingsVal($name,'new_fw','false') eq 'true' ? '10px-kreis-gelb' : '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,1); my $temp = ReadingsVal($name,'temperature_tC','-100'); my $ip = ReadingsVal($name,'ip','none'); qq(<a href="http://$ip" target="_blank">${onl}</a><a href="/fhem?cmd.dummy=set $name toggle&XHR=1">${light}</a><div>Verbrauch: $cons W / Total: $total kwh / Temp: $temp °C</div>)}
   devicetopic shellypro4pm-083af27b3304
   event-on-change-reading .*
   getList    in_mode:noArg in_mode $DEVICETOPIC/rpc {"id": 1,"src":"$DEVICETOPIC", "method": "Switch.GetConfig", "params": {"id": 0}}
   icon       message_socket
   jsonMap    params_switch_0_state:state params_switch_0_aenergy_total:aenergy_total params_switch_0_apower:apower params_switch_0_temperature_tC:temperature params_switch_0_temperature_tF:0 params_wifi_sta_ip:ip
   model      shellypro4pm
   readingList $DEVICETOPIC/online:.* online
  $DEVICETOPIC/events/rpc:.* { return if $EVENT =~ m{switch:[1-3]}; $EVENT =~ s/"output":true/"state":"on"/g; $EVENT =~ s/"output":false/"state":"off"/g; json2nameValue($EVENT,'',$JSONMAP) }
  fhem2shelly/rpc:.* {}
shellypro4pm_083af27b3304:shellypro4pm-083af27b3304/status/switch_2:.* { json2nameValue($EVENT) }
shellypro4pm_083af27b3304:shellypro4pm-083af27b3304/status/switch_3:.* { json2nameValue($EVENT) }
shellypro4pm_083af27b3304:shellypro4pm-083af27b3304/status/mqtt:.* { json2nameValue($EVENT) }
shellypro4pm_083af27b3304:shellypro4pm-083af27b3304/status/sys:.* { json2nameValue($EVENT) }
shellypro4pm_083af27b3304:shellypro4pm-083af27b3304/status/switch_0:.* { json2nameValue($EVENT) }
shellypro4pm_083af27b3304:shellypro4pm-083af27b3304/status/switch_1:.* { json2nameValue($EVENT) }
   room       MQTT2_DEVICE
   setList    toggle:noArg $DEVICETOPIC/rpc {"id":1,"src":"fhem2shelly","method":"Switch.Toggle","params": {"id":0}}
  off:noArg $DEVICETOPIC/rpc {"id":1,"src":"fhem2shelly","method":"Switch.Set","params": {"id":0,"on":false}}
  on:noArg $DEVICETOPIC/rpc {"id":1,"src":"fhem2shelly","method":"Switch.Set","params": {"id":0,"on":true}}
  on-for-timer $DEVICETOPIC/rpc {"id":1,"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}}
  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"}
   setStateList on off toggle on-for-timer off-for-timer
   userReadings aenergy_total_kWh:aenergy_total.* monotonic {ReadingsNum($NAME,"aenergy_total",0)/1000.0}, Kosten:aenergy_total_kWh.* { sprintf("%.2f",(ReadingsNum($NAME,"aenergy_total_kWh",0) + 0.0)*.2);;}
   webCmd     :


List Kanal 2
Internals:
   CID        MQTT2_shellypro4pm_083af27b3304_CH2
   DEF        MQTT2_shellypro4pm_083af27b3304_CH2
   FUUID      626e75c7-f33f-b033-2873-daf56128de32a82e
   IODev      myBroker
   LASTInputDev myBroker
   MSGCNT     3588
   NAME       MQTT2_shellypro4pm_083af27b3304_CH2
   NR         551
   STATE      off
   TYPE       MQTT2_DEVICE
   myBroker_CONN myBroker_10.0.0.186_54067
   myBroker_MSGCNT 3588
   myBroker_TIME 2022-05-01 19:35:00
   JSONMAP:
     params_switch_1_aenergy_total aenergy_total
     params_switch_1_apower apower
     params_switch_1_state state
     params_switch_1_temperature_tC temperature
     params_switch_1_temperature_tF 0
   READINGS:
     2022-05-01 15:09:59   IODev           myBroker
     2022-05-01 19:35:00   Kosten          0.17
     2022-05-01 19:35:00   aenergy_by_minute_1 0.000
     2022-05-01 19:35:00   aenergy_by_minute_2 0.000
     2022-05-01 19:35:00   aenergy_by_minute_3 0.000
     2022-05-01 19:35:00   aenergy_minute_ts 1651426499
     2022-05-01 19:35:00   aenergy_total   0.000
     2022-05-01 19:35:00   aenergy_total_kWh 0.867210000000004
     2022-05-01 19:35:00   apower          0.0
     2022-05-01 13:58:00   associatedWith  MQTT2_shellypro4pm_083af27b3304,MQTT2_shellypro4pm_083af27b3304_CH3,MQTT2_shellypro4pm_083af27b3304_CH4
     2022-05-01 13:58:00   attrTemplateVersion 20220115
     2022-05-01 13:58:21   cfg_rev         10
     2022-05-01 15:10:27   connected       true
     2022-05-01 19:35:00   current         0.000
     2022-05-01 19:35:00   dst             shellypro4pm-083af27b3304/events
     2022-05-01 13:58:21   fs_free         282624
     2022-05-01 13:58:21   fs_size         524288
     2022-05-01 19:35:00   id              1
     2022-05-01 13:58:21   mac             083AF27B3304
     2022-05-01 19:35:00   method          NotifyStatus
     2022-05-01 19:35:00   output          false
     2022-05-01 19:35:00   params_switch_1_aenergy_by_minute_1 0.000
     2022-05-01 19:35:00   params_switch_1_aenergy_by_minute_2 0.000
     2022-05-01 19:35:00   params_switch_1_aenergy_by_minute_3 0.000
     2022-05-01 19:35:00   params_switch_1_aenergy_minute_ts 1651426499
     2022-05-01 15:09:17   params_switch_1_current 0
     2022-05-01 19:35:00   params_switch_1_id 1
     2022-05-01 15:09:17   params_switch_1_pf 0
     2022-05-01 15:09:17   params_switch_1_source MQTT
     2022-05-01 19:35:00   params_ts       1651426500.05
     2022-05-01 19:35:00   pf              0.00
     2022-05-01 13:58:21   ram_free        152000
     2022-05-01 13:58:21   ram_size        238236
     2022-05-01 13:58:21   restart_required false
     2022-05-01 19:35:00   source          MQTT
     2022-05-01 19:35:00   src             shellypro4pm-083af27b3304
     2022-05-01 15:09:17   state           off
     2022-05-01 16:10:35   temperature     25.52
     2022-05-01 19:35:00   temperature_tC  25.5
     2022-05-01 19:35:00   temperature_tF  78.0
     2022-05-01 13:58:21   time            13:58
     2022-05-01 13:58:21   unixtime        1651406301
     2022-05-01 13:58:21   uptime          18
     2022-05-01 19:35:00   voltage         230.2
Attributes:
   comment    Channel 2 for MQTT2_shellypro4pm_083af27b3304, see also MQTT2_shellypro4pm_083af27b3304, MQTT2_shellypro4pm_083af27b3304_CH3 and MQTT2_shellypro4pm_083af27b3304_CH4
   devStateIcon {my $onl = ReadingsVal($name,'online','false') eq 'false'?'10px-kreis-rot': ReadingsVal($name,'new_fw','false') eq 'true' ? '10px-kreis-gelb' : '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,1); my $temp = ReadingsVal($name,'temperature_tC','-100'); my $ip = ReadingsVal($name,'ip','none'); qq(<a href="http://$ip" target="_blank">${onl}</a><a href="/fhem?cmd.dummy=set $name toggle&XHR=1">${light}</a><div>Verbrauch: $cons W / Total: $total kwh / Temp: $temp °C</div>)}
   devicetopic shellypro4pm-083af27b3304
   event-on-change-reading .*
   getList    in_mode:noArg in_mode $DEVICETOPIC/rpc {"id": 1,"src":"$DEVICETOPIC", "method": "Switch.GetConfig", "params": {"id": 0}}
   icon       message_socket
   jsonMap    params_switch_1_state:state params_switch_1_aenergy_total:aenergy_total params_switch_1_apower:apower params_switch_1_temperature_tC:temperature params_switch_1_temperature_tF:0
   model      shellypro4pm
   readingList $DEVICETOPIC/events/rpc:.* { return if $EVENT !~ m{switch:1}; $EVENT =~ s/"output":true/"state":"on"/g; $EVENT =~ s/"output":false/"state":"off"/g; json2nameValue($EVENT,'',$JSONMAP) }
shellypro4pm_083af27b3304:shellypro4pm-083af27b3304/status/switch_2:.* { json2nameValue($EVENT) }
shellypro4pm_083af27b3304:shellypro4pm-083af27b3304/status/switch_3:.* { json2nameValue($EVENT) }
shellypro4pm_083af27b3304:shellypro4pm-083af27b3304/status/mqtt:.* { json2nameValue($EVENT) }
shellypro4pm_083af27b3304:shellypro4pm-083af27b3304/status/sys:.* { json2nameValue($EVENT) }
shellypro4pm_083af27b3304:shellypro4pm-083af27b3304/status/switch_0:.* { json2nameValue($EVENT) }
shellypro4pm_083af27b3304:shellypro4pm-083af27b3304/status/switch_1:.* { json2nameValue($EVENT) }
   room       MQTT2_DEVICE
   setList    toggle:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Toggle","params": {"id":1}}
  off:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Set","params": {"id":1,"on":false}}
  on:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Set","params": {"id":1,"on":true}}
  on-for-timer $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Set","params": {"id":1,"on":true,"toggle_after":$EVTPART1}}
  off-for-timer $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Set","params": {"id":1,"on":false,"toggle_after":$EVTPART1}}
   setStateList on off toggle on-for-timer off-for-timer
   userReadings aenergy_total_kWh:aenergy_total.* monotonic {ReadingsNum($NAME,"aenergy_total",0)/1000.0}, Kosten:aenergy_total_kWh.* { sprintf("%.2f",(ReadingsNum($NAME,"aenergy_total_kWh",0) + 0.0)*.2);;}
   webCmd     :


List Kanal3
Internals:
   CID        MQTT2_shellypro4pm_083af27b3304_CH3
   DEF        MQTT2_shellypro4pm_083af27b3304_CH3
   FUUID      626e75c7-f33f-b033-9013-629c8040c5769a42
   IODev      myBroker
   LASTInputDev myBroker
   MSGCNT     3592
   NAME       MQTT2_shellypro4pm_083af27b3304_CH3
   NR         552
   STATE      off
   TYPE       MQTT2_DEVICE
   myBroker_CONN myBroker_10.0.0.186_54067
   myBroker_MSGCNT 3592
   myBroker_TIME 2022-05-01 19:35:38
   JSONMAP:
     params_switch_2_aenergy_total aenergy_total
     params_switch_2_apower apower
     params_switch_2_state state
     params_switch_2_temperature_tC temperature
     params_switch_2_temperature_tF 0
   READINGS:
     2022-05-01 15:09:59   IODev           myBroker
     2022-05-01 19:35:00   Kosten          0.17
     2022-05-01 19:35:00   aenergy_by_minute_1 0.000
     2022-05-01 19:35:00   aenergy_by_minute_2 0.000
     2022-05-01 19:35:00   aenergy_by_minute_3 0.000
     2022-05-01 19:35:00   aenergy_minute_ts 1651426499
     2022-05-01 19:35:38   aenergy_total   0.000
     2022-05-01 19:35:00   aenergy_total_kWh 0.867210000000004
     2022-05-01 19:35:00   apower          0.0
     2022-05-01 13:58:00   associatedWith  MQTT2_shellypro4pm_083af27b3304,MQTT2_shellypro4pm_083af27b3304_CH2,MQTT2_shellypro4pm_083af27b3304_CH4
     2022-05-01 13:58:00   attrTemplateVersion 20220115
     2022-05-01 13:58:21   cfg_rev         10
     2022-05-01 15:10:27   connected       true
     2022-05-01 19:35:00   current         0.000
     2022-05-01 19:35:38   dst             shellypro4pm-083af27b3304/events
     2022-05-01 13:58:21   fs_free         282624
     2022-05-01 13:58:21   fs_size         524288
     2022-05-01 19:35:00   id              1
     2022-05-01 13:58:21   mac             083AF27B3304
     2022-05-01 19:35:38   method          NotifyStatus
     2022-05-01 19:35:00   output          false
     2022-05-01 19:35:38   params_switch_2_aenergy_by_minute_1 0.000
     2022-05-01 19:35:38   params_switch_2_aenergy_by_minute_2 0.000
     2022-05-01 19:35:38   params_switch_2_aenergy_by_minute_3 0.000
     2022-05-01 19:35:38   params_switch_2_aenergy_minute_ts 1651426498
     2022-05-01 15:09:16   params_switch_2_current 0
     2022-05-01 19:35:38   params_switch_2_id 2
     2022-05-01 15:09:16   params_switch_2_pf 0
     2022-05-01 15:09:16   params_switch_2_source MQTT
     2022-05-01 19:35:38   params_ts       1651426500.02
     2022-05-01 19:35:00   pf              0.00
     2022-05-01 13:58:21   ram_free        152000
     2022-05-01 13:58:21   ram_size        238236
     2022-05-01 13:58:21   restart_required false
     2022-05-01 19:35:00   source          MQTT
     2022-05-01 19:35:38   src             shellypro4pm-083af27b3304
     2022-05-01 15:09:16   state           off
     2022-05-01 16:10:35   temperature     25.52
     2022-05-01 19:35:00   temperature_tC  25.5
     2022-05-01 19:35:00   temperature_tF  78.0
     2022-05-01 13:58:21   time            13:58
     2022-05-01 13:58:21   unixtime        1651406301
     2022-05-01 13:58:21   uptime          18
     2022-05-01 19:35:00   voltage         230.2
Attributes:
   comment    Channel 3 for MQTT2_shellypro4pm_083af27b3304, see also MQTT2_shellypro4pm_083af27b3304, MQTT2_shellypro4pm_083af27b3304_CH2 and MQTT2_shellypro4pm_083af27b3304_CH4
   devStateIcon {my $onl = ReadingsVal($name,'online','false') eq 'false'?'10px-kreis-rot': ReadingsVal($name,'new_fw','false') eq 'true' ? '10px-kreis-gelb' : '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,1); my $temp = ReadingsVal($name,'temperature_tC','-100'); my $ip = ReadingsVal($name,'ip','none'); qq(<a href="http://$ip" target="_blank">${onl}</a><a href="/fhem?cmd.dummy=set $name toggle&XHR=1">${light}</a><div>Verbrauch: $cons W / Total: $total kwh / Temp: $temp °C</div>)}
   devicetopic shellypro4pm-083af27b3304
   event-on-change-reading .*
   getList    in_mode:noArg in_mode $DEVICETOPIC/rpc {"id": 1,"src":"$DEVICETOPIC", "method": "Switch.GetConfig", "params": {"id": 0}}
   icon       message_socket
   jsonMap    params_switch_2_state:state params_switch_2_aenergy_total:aenergy_total params_switch_2_apower:apower params_switch_2_temperature_tC:temperature params_switch_2_temperature_tF:0
   model      shellypro4pm
   readingList $DEVICETOPIC/events/rpc:.* { return if $EVENT !~ m{switch:2}; $EVENT =~ s/"output":true/"state":"on"/g; $EVENT =~ s/"output":false/"state":"off"/g; json2nameValue($EVENT,'',$JSONMAP) }
shellypro4pm_083af27b3304:shellypro4pm-083af27b3304/status/switch_2:.* { json2nameValue($EVENT) }
shellypro4pm_083af27b3304:shellypro4pm-083af27b3304/status/switch_3:.* { json2nameValue($EVENT) }
shellypro4pm_083af27b3304:shellypro4pm-083af27b3304/status/mqtt:.* { json2nameValue($EVENT) }
shellypro4pm_083af27b3304:shellypro4pm-083af27b3304/status/sys:.* { json2nameValue($EVENT) }
shellypro4pm_083af27b3304:shellypro4pm-083af27b3304/status/switch_0:.* { json2nameValue($EVENT) }
shellypro4pm_083af27b3304:shellypro4pm-083af27b3304/status/switch_1:.* { json2nameValue($EVENT) }
   room       MQTT2_DEVICE
   setList    toggle:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Toggle","params": {"id":2}}
  off:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Set","params": {"id":2,"on":false}}
  on:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Set","params": {"id":2,"on":true}}
  on-for-timer $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Set","params": {"id":2,"on":true,"toggle_after":$EVTPART1}}
  off-for-timer $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Set","params": {"id":2,"on":false,"toggle_after":$EVTPART1}}
   setStateList on off toggle on-for-timer off-for-timer
   userReadings aenergy_total_kWh:aenergy_total.* monotonic {ReadingsNum($NAME,"aenergy_total",0)/1000.0}, Kosten:aenergy_total_kWh.* { sprintf("%.2f",(ReadingsNum($NAME,"aenergy_total_kWh",0) + 0.0)*.2);;}
   webCmd     :



Was zum Geier übersehe ich hier?

Danke Gruß
Helmut
System1 fhem 6.1 auf RPi 4B mit 4GB, HMUSBConfig, DS9490R-1Wire, Busware USB 868, Pool-Solarsteuerung mit FHEM. System2 fhem 6.1 auf RPi 4B mit 4GB (Bullseye) mit Busware USB 868 und 433 und HMUARTLGW für Haussteuerung

https://www.flickr.com/photos/canonhelmi/

Beta-User

Hmm, also:
Dass autocreate offenbar alle Instanzen "bedenkt", ist nicht beabsichtigt, offenbar ist CID kein "eq", sondern wird als regex bewertet (muss mal in den Code sehen). Da muss ich also was ändern.

Kannst du mal den MQTT-Verkehr kurze Zeit mitschneiden, damit ich "Spielmaterial" habe (die Teile, die die Verbrauchsdaten betreffen; kann aber von meiner Seite etwas dauern)?
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

Helmi55

Servus - keine Eile. Schwimmbecken wird heute voll und morgen gehen die Pumpen in Betrieb  8) ;D
Hoffe der Shelly verträgt den Einschaltstrom....  mal sehen. Wenn ich ein Relais dazwischen schalte, habe ich wieder keine Messung....

Gut habe jetzt den MQTT Explorer laufen lassen und einstweilen eine Lampe am Kanal 1 geschaltet
Hoffe du kannst mit dem Screenshot was anfangen.
Wenn nein - sag bitte was ich tun soll

Schönen Abend
Helmut
System1 fhem 6.1 auf RPi 4B mit 4GB, HMUSBConfig, DS9490R-1Wire, Busware USB 868, Pool-Solarsteuerung mit FHEM. System2 fhem 6.1 auf RPi 4B mit 4GB (Bullseye) mit Busware USB 868 und 433 und HMUARTLGW für Haussteuerung

https://www.flickr.com/photos/canonhelmi/

Beta-User

Hmm, screenshots sind nicht optimal, damit kann man kaum spielen. Besser die intern seit neuestem vorhandenen Möglichkeiten nutzen: https://forum.fhem.de/index.php/topic,127223.0.html

Weiter sind raw-Listings für mich einfacher zu "verdauen".

Wie dem auch sei, das "Problem" ist auch mit dem sceenshot klarer. Wenn ich das richtig interpretiere, sollte es für Kanal 1 so ausschauen:
shellypro4pm-083af27b3304/status/switch.0:.* { json2nameValue($EVENT, '', $JSONMAP) }

Anleitung:
Zuerst die anderen Devices anfassen und
- DEF ändern (CID löschen)
- die jeweils nicht zu dem Kanal gehörenden status-Meldungen (und die anderen von autocreate erstellten Zeilen, die mit "shellypro4pm_083af27b3304:" beginnen) rausnehmen, wobei du auch den Präfix löschen kannst bei der einen Zeile (zu ändern auf Punkt statt Strich), die dann übrig bleibt

Dann im ersten Kanal im Prinzip dasselbe machen, wobei die weiteren Zeilen stehen bleiben dürfen.
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

Helmi55

Servus ich bin mir nicht sicher ob ich es richtig gemacht habe?
Hier die RAWs der einzelnen Kanäle:
defmod MQTT2_shellypro4pm_083af27b3304 MQTT2_DEVICE shellypro4pm_083af27b3304
attr MQTT2_shellypro4pm_083af27b3304 comment Channel 1 for MQTT2_shellypro4pm_083af27b3304, see also MQTT2_shellypro4pm_083af27b3304_CH2, MQTT2_shellypro4pm_083af27b3304_CH3 and MQTT2_shellypro4pm_083af27b3304_CH4
attr MQTT2_shellypro4pm_083af27b3304 devStateIcon {my $onl = ReadingsVal($name,'online','false') eq 'false'?'10px-kreis-rot': ReadingsVal($name,'new_fw','false') eq 'true' ? '10px-kreis-gelb' : '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,1);; my $temp = ReadingsVal($name,'temperature_tC','-100');; my $ip = ReadingsVal($name,'ip','none');; qq(<a href="http://$ip" target="_blank">${onl}</a><a href="/fhem?cmd.dummy=set $name toggle&XHR=1">${light}</a><div>Verbrauch: $cons W / Total: $total kwh / Temp: $temp °C</div>)}
attr MQTT2_shellypro4pm_083af27b3304 devicetopic shellypro4pm-083af27b3304
attr MQTT2_shellypro4pm_083af27b3304 event-on-change-reading .*
attr MQTT2_shellypro4pm_083af27b3304 getList in_mode:noArg in_mode $DEVICETOPIC/rpc {"id": 1,"src":"$DEVICETOPIC", "method": "Switch.GetConfig", "params": {"id": 0}}
attr MQTT2_shellypro4pm_083af27b3304 icon message_socket
attr MQTT2_shellypro4pm_083af27b3304 jsonMap params_switch_0_state:state params_switch_0_aenergy_total:aenergy_total params_switch_0_apower:apower params_switch_0_temperature_tC:temperature params_switch_0_temperature_tF:0 params_wifi_sta_ip:ip
attr MQTT2_shellypro4pm_083af27b3304 model shellypro4pm
attr MQTT2_shellypro4pm_083af27b3304 readingList $DEVICETOPIC/online:.* online\
  $DEVICETOPIC/events/rpc:.* { return if $EVENT =~ m{switch:[1-3]};; $EVENT =~ s/"output":true/"state":"on"/g;; $EVENT =~ s/"output":false/"state":"off"/g;; json2nameValue($EVENT,'',$JSONMAP) }\
  fhem2shelly/rpc:.* {}\
shellypro4pm-083af27b3304/status/switch.0:.* { json2nameValue($EVENT, '', $JSONMAP) }\
shellypro4pm_083af27b3304:shellypro4pm-083af27b3304/status/switch_1:.* { json2nameValue($EVENT) }\
shellypro4pm_083af27b3304:shellypro4pm-083af27b3304/status/switch_2:.* { json2nameValue($EVENT) }\
shellypro4pm_083af27b3304:shellypro4pm-083af27b3304/status/switch_3:.* { json2nameValue($EVENT) }
attr MQTT2_shellypro4pm_083af27b3304 room MQTT2_DEVICE,Poolsteuerung
attr MQTT2_shellypro4pm_083af27b3304 setList toggle:noArg $DEVICETOPIC/rpc {"id":1,"src":"fhem2shelly","method":"Switch.Toggle","params": {"id":0}}\
  off:noArg $DEVICETOPIC/rpc {"id":1,"src":"fhem2shelly","method":"Switch.Set","params": {"id":0,"on":false}}\
  on:noArg $DEVICETOPIC/rpc {"id":1,"src":"fhem2shelly","method":"Switch.Set","params": {"id":0,"on":true}}\
  on-for-timer $DEVICETOPIC/rpc {"id":1,"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}}\
  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"}
attr MQTT2_shellypro4pm_083af27b3304 setStateList on off toggle on-for-timer off-for-timer
attr MQTT2_shellypro4pm_083af27b3304 userReadings aenergy_total_kWh:aenergy_total.* monotonic {ReadingsNum($NAME,"aenergy_total",0)/1000.0}, Kosten:aenergy_total_kWh.* { sprintf("%.2f",(ReadingsNum($NAME,"aenergy_total_kWh",0) + 0.0)*.2);;;;}
attr MQTT2_shellypro4pm_083af27b3304 webCmd :


Kanal 2
defmod MQTT2_shellypro4pm_083af27b3304_CH2 MQTT2_DEVICE
attr MQTT2_shellypro4pm_083af27b3304_CH2 comment Channel 2 for MQTT2_shellypro4pm_083af27b3304, see also MQTT2_shellypro4pm_083af27b3304, MQTT2_shellypro4pm_083af27b3304_CH3 and MQTT2_shellypro4pm_083af27b3304_CH4
attr MQTT2_shellypro4pm_083af27b3304_CH2 devStateIcon {my $onl = ReadingsVal($name,'online','false') eq 'false'?'10px-kreis-rot': ReadingsVal($name,'new_fw','false') eq 'true' ? '10px-kreis-gelb' : '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,1);; my $temp = ReadingsVal($name,'temperature_tC','-100');; my $ip = ReadingsVal($name,'ip','none');; qq(<a href="http://$ip" target="_blank">${onl}</a><a href="/fhem?cmd.dummy=set $name toggle&XHR=1">${light}</a><div>Verbrauch: $cons W / Total: $total kwh / Temp: $temp °C</div>)}
attr MQTT2_shellypro4pm_083af27b3304_CH2 devicetopic shellypro4pm-083af27b3304
attr MQTT2_shellypro4pm_083af27b3304_CH2 event-on-change-reading .*
attr MQTT2_shellypro4pm_083af27b3304_CH2 getList in_mode:noArg in_mode $DEVICETOPIC/rpc {"id": 1,"src":"$DEVICETOPIC", "method": "Switch.GetConfig", "params": {"id": 0}}
attr MQTT2_shellypro4pm_083af27b3304_CH2 icon message_socket
attr MQTT2_shellypro4pm_083af27b3304_CH2 jsonMap params_switch_1_state:state params_switch_1_aenergy_total:aenergy_total params_switch_1_apower:apower params_switch_1_temperature_tC:temperature params_switch_1_temperature_tF:0
attr MQTT2_shellypro4pm_083af27b3304_CH2 model shellypro4pm
attr MQTT2_shellypro4pm_083af27b3304_CH2 readingList $DEVICETOPIC/events/rpc:.* { return if $EVENT !~ m{switch:1};; $EVENT =~ s/"output":true/"state":"on"/g;; $EVENT =~ s/"output":false/"state":"off"/g;; json2nameValue($EVENT,'',$JSONMAP) }\

attr MQTT2_shellypro4pm_083af27b3304_CH2 room MQTT2_DEVICE
attr MQTT2_shellypro4pm_083af27b3304_CH2 setList toggle:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Toggle","params": {"id":1}}\
  off:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Set","params": {"id":1,"on":false}}\
  on:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Set","params": {"id":1,"on":true}}\
  on-for-timer $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Set","params": {"id":1,"on":true,"toggle_after":$EVTPART1}}\
  off-for-timer $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Set","params": {"id":1,"on":false,"toggle_after":$EVTPART1}}
attr MQTT2_shellypro4pm_083af27b3304_CH2 setStateList on off toggle on-for-timer off-for-timer
attr MQTT2_shellypro4pm_083af27b3304_CH2 userReadings aenergy_total_kWh:aenergy_total.* monotonic {ReadingsNum($NAME,"aenergy_total",0)/1000.0}, Kosten:aenergy_total_kWh.* { sprintf("%.2f",(ReadingsNum($NAME,"aenergy_total_kWh",0) + 0.0)*.2);;;;}
attr MQTT2_shellypro4pm_083af27b3304_CH2 webCmd :


Kanal3:
defmod MQTT2_shellypro4pm_083af27b3304_CH3 MQTT2_DEVICE
attr MQTT2_shellypro4pm_083af27b3304_CH3 comment Channel 3 for MQTT2_shellypro4pm_083af27b3304, see also MQTT2_shellypro4pm_083af27b3304, MQTT2_shellypro4pm_083af27b3304_CH2 and MQTT2_shellypro4pm_083af27b3304_CH4
attr MQTT2_shellypro4pm_083af27b3304_CH3 devStateIcon {my $onl = ReadingsVal($name,'online','false') eq 'false'?'10px-kreis-rot': ReadingsVal($name,'new_fw','false') eq 'true' ? '10px-kreis-gelb' : '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,1);; my $temp = ReadingsVal($name,'temperature_tC','-100');; my $ip = ReadingsVal($name,'ip','none');; qq(<a href="http://$ip" target="_blank">${onl}</a><a href="/fhem?cmd.dummy=set $name toggle&XHR=1">${light}</a><div>Verbrauch: $cons W / Total: $total kwh / Temp: $temp °C</div>)}
attr MQTT2_shellypro4pm_083af27b3304_CH3 devicetopic shellypro4pm-083af27b3304
attr MQTT2_shellypro4pm_083af27b3304_CH3 event-on-change-reading .*
attr MQTT2_shellypro4pm_083af27b3304_CH3 getList in_mode:noArg in_mode $DEVICETOPIC/rpc {"id": 1,"src":"$DEVICETOPIC", "method": "Switch.GetConfig", "params": {"id": 0}}
attr MQTT2_shellypro4pm_083af27b3304_CH3 icon message_socket
attr MQTT2_shellypro4pm_083af27b3304_CH3 jsonMap params_switch_2_state:state params_switch_2_aenergy_total:aenergy_total params_switch_2_apower:apower params_switch_2_temperature_tC:temperature params_switch_2_temperature_tF:0
attr MQTT2_shellypro4pm_083af27b3304_CH3 model shellypro4pm
attr MQTT2_shellypro4pm_083af27b3304_CH3 readingList $DEVICETOPIC/events/rpc:.* { return if $EVENT !~ m{switch:2};; $EVENT =~ s/"output":true/"state":"on"/g;; $EVENT =~ s/"output":false/"state":"off"/g;; json2nameValue($EVENT,'',$JSONMAP) }\

attr MQTT2_shellypro4pm_083af27b3304_CH3 room MQTT2_DEVICE
attr MQTT2_shellypro4pm_083af27b3304_CH3 setList toggle:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Toggle","params": {"id":2}}\
  off:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Set","params": {"id":2,"on":false}}\
  on:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Set","params": {"id":2,"on":true}}\
  on-for-timer $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Set","params": {"id":2,"on":true,"toggle_after":$EVTPART1}}\
  off-for-timer $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Set","params": {"id":2,"on":false,"toggle_after":$EVTPART1}}
attr MQTT2_shellypro4pm_083af27b3304_CH3 setStateList on off toggle on-for-timer off-for-timer
attr MQTT2_shellypro4pm_083af27b3304_CH3 userReadings aenergy_total_kWh:aenergy_total.* monotonic {ReadingsNum($NAME,"aenergy_total",0)/1000.0}, Kosten:aenergy_total_kWh.* { sprintf("%.2f",(ReadingsNum($NAME,"aenergy_total_kWh",0) + 0.0)*.2);;;;}
attr MQTT2_shellypro4pm_083af27b3304_CH3 webCmd :


Kanal 4:
defmod MQTT2_shellypro4pm_083af27b3304_CH4 MQTT2_DEVICE
attr MQTT2_shellypro4pm_083af27b3304_CH4 comment Channel 4 for MQTT2_shellypro4pm_083af27b3304, see also MQTT2_shellypro4pm_083af27b3304, MQTT2_shellypro4pm_083af27b3304_CH2 and MQTT2_shellypro4pm_083af27b3304_CH3
attr MQTT2_shellypro4pm_083af27b3304_CH4 devStateIcon {my $onl = ReadingsVal($name,'online','false') eq 'false'?'10px-kreis-rot': ReadingsVal($name,'new_fw','false') eq 'true' ? '10px-kreis-gelb' : '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,1);; my $temp = ReadingsVal($name,'temperature_tC','-100');; my $ip = ReadingsVal($name,'ip','none');; qq(<a href="http://$ip" target="_blank">${onl}</a><a href="/fhem?cmd.dummy=set $name toggle&XHR=1">${light}</a><div>Verbrauch: $cons W / Total: $total kwh / Temp: $temp °C</div>)}
attr MQTT2_shellypro4pm_083af27b3304_CH4 devicetopic shellypro4pm-083af27b3304
attr MQTT2_shellypro4pm_083af27b3304_CH4 event-on-change-reading .*
attr MQTT2_shellypro4pm_083af27b3304_CH4 getList in_mode:noArg in_mode $DEVICETOPIC/rpc {"id": 1,"src":"$DEVICETOPIC", "method": "Switch.GetConfig", "params": {"id": 0}}
attr MQTT2_shellypro4pm_083af27b3304_CH4 icon message_socket
attr MQTT2_shellypro4pm_083af27b3304_CH4 jsonMap params_switch_3_state:state params_switch_3_aenergy_total:aenergy_total params_switch_3_apower:apower params_switch_3_temperature_tC:temperature params_switch_3_temperature_tF:0
attr MQTT2_shellypro4pm_083af27b3304_CH4 model shellypro4pm
attr MQTT2_shellypro4pm_083af27b3304_CH4 readingList $DEVICETOPIC/events/rpc:.* { return if $EVENT !~ m{switch:3};; $EVENT =~ s/"output":true/"state":"on"/g;; $EVENT =~ s/"output":false/"state":"off"/g;; json2nameValue($EVENT,'',$JSONMAP) }\

attr MQTT2_shellypro4pm_083af27b3304_CH4 room MQTT2_DEVICE
attr MQTT2_shellypro4pm_083af27b3304_CH4 setList toggle:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Toggle","params": {"id":3}}\
  off:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Set","params": {"id":3,"on":false}}\
  on:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Set","params": {"id":3,"on":true}}\
  on-for-timer $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Set","params": {"id":3,"on":true,"toggle_after":$EVTPART1}}\
  off-for-timer $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Set","params": {"id":3,"on":false,"toggle_after":$EVTPART1}}
attr MQTT2_shellypro4pm_083af27b3304_CH4 setStateList on off toggle on-for-timer off-for-timer
attr MQTT2_shellypro4pm_083af27b3304_CH4 userReadings aenergy_total_kWh:aenergy_total.* monotonic {ReadingsNum($NAME,"aenergy_total",0)/1000.0}, Kosten:aenergy_total_kWh.* { sprintf("%.2f",(ReadingsNum($NAME,"aenergy_total_kWh",0) + 0.0)*.2);;;;}
attr MQTT2_shellypro4pm_083af27b3304_CH4 webCmd :


Ich glaube ich hab schon einen Fehler gemacht bei DEF
habe diese gelöscht??? aber die CID ist stehen geblieben?

Danke für deine Unterstützung

Helmut
System1 fhem 6.1 auf RPi 4B mit 4GB, HMUSBConfig, DS9490R-1Wire, Busware USB 868, Pool-Solarsteuerung mit FHEM. System2 fhem 6.1 auf RPi 4B mit 4GB (Bullseye) mit Busware USB 868 und 433 und HMUARTLGW für Haussteuerung

https://www.flickr.com/photos/canonhelmi/

Beta-User

...sicher bin ich auch nicht; dass die CID in den Internals (vielleicht) noch drin steht, ist entweder per refresh (sehr vielleicht), per update (vielleicht), oder per reboot zu lösen, aber an sich kein größeres Problem, anscheinend hat autocreate jedenfalls nur im Hauptdevice "zugeschlagen", das ist schon mal gut :) .

Zitat von: Helmi55 am 04 Mai 2022, 12:56:57
Hier die RAWs der einzelnen Kanäle:

Das sollte (auszugsweise) m.E. so aussehen:
defmod MQTT2_shellypro4pm_083af27b3304 MQTT2_DEVICE shellypro4pm_083af27b3304
attr MQTT2_shellypro4pm_083af27b3304 readingList $DEVICETOPIC/online:.* online\
  $DEVICETOPIC/events/rpc:.* { return if $EVENT =~ m{switch:[1-3]};; $EVENT =~ s/"output":true/"state":"on"/g;; $EVENT =~ s/"output":false/"state":"off"/g;; json2nameValue($EVENT,'',$JSONMAP) }\
  fhem2shelly/rpc:.* {}\
  shellypro4pm-083af27b3304/status/switch.0:.* { json2nameValue($EVENT, '', $JSONMAP) }

Die weiteren per autocreate wieder hinzugekommenen Einträge im Hauptdevice kommen daher, dass du das nicht in die Kanal-Devices z.B. für Kanal 2 so übernommen hattest:

attr MQTT2_shellypro4pm_083af27b3304_CH2 readingList $DEVICETOPIC/events/rpc:.* { return if $EVENT !~ m{switch:1};; $EVENT =~ s/"output":true/"state":"on"/g;; $EVENT =~ s/"output":false/"state":"off"/g;; json2nameValue($EVENT,'',$JSONMAP) }\
  shellypro4pm-083af27b3304/status/switch.1:.* { json2nameValue($EVENT, '', $JSONMAP) }

Da du die "Ergebnisinfos" nicht dazugepackt hattest, und auch keinen MQTT-Traffic (als kopierbaren Text), kann ich leider nicht abschätzen bzw. testen, ob das so paßt...
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

Helmi55

#6
Nochmals Danke für deine Zeit und Unterstützung
ich habe jetzt deinem defmod den Kanal 1 angelegt und ein setList und webCmd dazugegeben (siehe Anhang)
Energy_total und Power - das wichtigste für mich kommt sauber rein
aber der Kanal lässt sich nicht schalten?
defmod MQTT2_shellypro4pm_083af27b3304 MQTT2_DEVICE shellypro4pm_083af27b3304
attr MQTT2_shellypro4pm_083af27b3304 readingList $DEVICETOPIC/online:.* online\
  $DEVICETOPIC/events/rpc:.* { return if $EVENT =~ m{switch:[1-3]};; $EVENT =~ s/"output":true/"state":"on"/g;; $EVENT =~ s/"output":false/"state":"off"/g;; json2nameValue($EVENT,'',$JSONMAP) }\
  fhem2shelly/rpc:.* {}\
  shellypro4pm-083af27b3304/status/switch.0:.* { json2nameValue($EVENT, '', $JSONMAP) }\
shellypro4pm_083af27b3304:shellypro4pm-083af27b3304/online:.* online
attr MQTT2_shellypro4pm_083af27b3304 room MQTT2_DEVICE
attr MQTT2_shellypro4pm_083af27b3304 setList on off
attr MQTT2_shellypro4pm_083af27b3304 webCmd :

setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:36:59 IODev myBroker
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:43:00 aenergy_by_minute_1 12117.652
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:43:00 aenergy_by_minute_2 11934.408
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:43:00 aenergy_by_minute_3 11926.528
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:43:00 aenergy_minute_ts 1651671779
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:43:00 aenergy_total 9607.033
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:43:00 apower 711.9
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:43:00 current 3.141
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:43:00 id 0
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:37:05 online true
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:43:00 output true
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:43:00 pf 0.99
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:43:00 source WS_in
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:43:00 temperature_tC 39.0
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:43:00 temperature_tF 102.2
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:43:00 voltage 227.4


Am MQTT Server hab ich jetzt folgenden Traffic (nach dem ich den Shelly direkt über die Weboberfläche geschaltet habe

SENT: shellypro4pm-083af27b3304/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Set","params": {"id":2,"on":false}}

RCVD: shellypro4pm-083af27b3304/events/rpc {"src":"shellypro4pm-083af27b3304","dst":"shellypro4pm-083af27b3304/events","method":"NotifyStatus","params":{"ts":1651671892.90,"switch:0":{"id":0,"apower":0,"current":0,"output":false,"pf":0,"source":"WS_in"}}}
RCVD: shellypro4pm-083af27b3304/status/switch_0 {"id":0, "source":"WS_in", "output":false, "apower":0.0, "voltage":225.7, "current":0.000, "pf":0.00, "aenergy":{"total":9629.481,"by_minute":[10537.297,11902.227,12117.652],"minute_ts":1651671891},"temperature":{"tC":39.1, "tF":102.3}}



Sorry nicht setList on off sondern setStateList on off
Gruß
Helmut

System1 fhem 6.1 auf RPi 4B mit 4GB, HMUSBConfig, DS9490R-1Wire, Busware USB 868, Pool-Solarsteuerung mit FHEM. System2 fhem 6.1 auf RPi 4B mit 4GB (Bullseye) mit Busware USB 868 und 433 und HMUARTLGW für Haussteuerung

https://www.flickr.com/photos/canonhelmi/

Beta-User

#7
Hmm, meine Überarbeitung betraf nur die jeweils genannten Attribute, der Rest sollte eigentlich unverändert bleiben (zusätzlich setStateList zu setzen ist aber ok).
"setList" müßte daher auf den alten Stand zurück, dann sollte das wieder passen, dto für devicetopic etc.

Was anderes: Ich gehe prinzipiell davon aus, dass die firmware aktuell ist, und das mit dem Doppelpunkt im Topic war ganz zu Beginn der 2.gen-Geräte mal hochgepoppt. Nicht, dass wir hier im Prinzip überholte Sendeformate diskutieren...? (Dass es eine Warnung von pah wegen der letzten Firmware-upgrades gab, will ich aber nicht unerwähnt lassen).
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

Helmi55

Hi
jetzt sind plötzlich mehr readings gekommen
defmod MQTT2_shellypro4pm_083af27b3304 MQTT2_DEVICE shellypro4pm_083af27b3304
attr MQTT2_shellypro4pm_083af27b3304 readingList $DEVICETOPIC/online:.* online\
  $DEVICETOPIC/events/rpc:.* { return if $EVENT =~ m{switch:[1-3]};; $EVENT =~ s/"output":true/"state":"on"/g;; $EVENT =~ s/"output":false/"state":"off"/g;; json2nameValue($EVENT,'',$JSONMAP) }\
  fhem2shelly/rpc:.* {}\
  shellypro4pm-083af27b3304/status/switch.0:.* { json2nameValue($EVENT, '', $JSONMAP) }\
shellypro4pm_083af27b3304:shellypro4pm-083af27b3304/online:.* online\
shellypro4pm_083af27b3304:shellypro4pm-083af27b3304/events/rpc:.* { json2nameValue($EVENT) }\
shellypro4pm_083af27b3304:shellypro4pm-083af27b3304/status/switch_1:.* { json2nameValue($EVENT) }\
shellypro4pm_083af27b3304:shellypro4pm-083af27b3304/status/switch_2:.* { json2nameValue($EVENT) }\
shellypro4pm_083af27b3304:shellypro4pm-083af27b3304/status/switch_3:.* { json2nameValue($EVENT) }
attr MQTT2_shellypro4pm_083af27b3304 room MQTT2_DEVICE
attr MQTT2_shellypro4pm_083af27b3304 setStateList on off
attr MQTT2_shellypro4pm_083af27b3304 webCmd :

setstate MQTT2_shellypro4pm_083af27b3304 set_on
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:49:22 IODev myBroker
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:59:00 aenergy_by_minute_1 0.000
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:59:00 aenergy_by_minute_2 0.000
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:59:00 aenergy_by_minute_3 0.000
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:59:00 aenergy_minute_ts 1651672739
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:59:00 aenergy_total 0.000
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:59:00 apower 0.0
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:59:00 current 0.000
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:59:00 dst shellypro4pm-083af27b3304/events
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:59:00 id 3
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:59:00 method NotifyStatus
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:49:28 online true
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:59:00 output false
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:59:00 params_switch_0_aenergy_by_minute_1 12163.103
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:59:00 params_switch_0_aenergy_by_minute_2 11966.725
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:59:00 params_switch_0_aenergy_by_minute_3 12105.304
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:59:00 params_switch_0_aenergy_minute_ts 1651672739
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:59:00 params_switch_0_aenergy_total 9741.161
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:59:00 params_switch_0_id 0
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:59:00 params_switch_1_aenergy_by_minute_1 0.000
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:59:00 params_switch_1_aenergy_by_minute_2 0.000
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:59:00 params_switch_1_aenergy_by_minute_3 2517.976
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:59:00 params_switch_1_aenergy_minute_ts 1651672739
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:59:00 params_switch_1_aenergy_total 3541.967
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:56:25 params_switch_1_apower 0
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:56:25 params_switch_1_current 0
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:59:00 params_switch_1_id 1
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:56:25 params_switch_1_output false
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:56:25 params_switch_1_pf 0
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:56:25 params_switch_1_source WS_in
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:59:00 params_switch_2_aenergy_by_minute_1 0.000
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:59:00 params_switch_2_aenergy_by_minute_2 0.000
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:59:00 params_switch_2_aenergy_by_minute_3 0.000
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:59:00 params_switch_2_aenergy_minute_ts 1651672739
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:59:00 params_switch_2_aenergy_total 216.325
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:59:00 params_switch_2_id 2
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:59:00 params_switch_3_aenergy_by_minute_1 0.000
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:59:00 params_switch_3_aenergy_by_minute_2 0.000
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:59:00 params_switch_3_aenergy_by_minute_3 0.000
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:59:00 params_switch_3_aenergy_minute_ts 1651672739
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:59:00 params_switch_3_aenergy_total 0.000
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:59:00 params_switch_3_id 3
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:59:00 params_ts 1651672740.87
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:59:00 pf 0.00
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:59:00 source WS_in
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:59:00 src shellypro4pm-083af27b3304
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:50:19 state set_on
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:59:00 temperature_tC 38.5
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:59:00 temperature_tF 101.3
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 15:59:00 voltage 232.8


wobei bei switch0 kein apower dabei ist?
System1 fhem 6.1 auf RPi 4B mit 4GB, HMUSBConfig, DS9490R-1Wire, Busware USB 868, Pool-Solarsteuerung mit FHEM. System2 fhem 6.1 auf RPi 4B mit 4GB (Bullseye) mit Busware USB 868 und 433 und HMUARTLGW für Haussteuerung

https://www.flickr.com/photos/canonhelmi/

Beta-User

Zitat von: Helmi55 am 04 Mai 2022, 16:00:48
jetzt sind plötzlich mehr readings gekommen
Siehe meinen Vorpost und den Edit dazu: Meine Rückmeldung war nur als "ändere diesen Teil" zu verstehen gewesen, nicht im Sinne von "das ist alles".
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

Helmi55

die FW am Shelly ist 0.10.1 und FHEM habe ich heute in der Früh upgedatet.
das mit dem Punkt und Strich habe ich nicht verstanden - sorry
System1 fhem 6.1 auf RPi 4B mit 4GB, HMUSBConfig, DS9490R-1Wire, Busware USB 868, Pool-Solarsteuerung mit FHEM. System2 fhem 6.1 auf RPi 4B mit 4GB (Bullseye) mit Busware USB 868 und 433 und HMUARTLGW für Haussteuerung

https://www.flickr.com/photos/canonhelmi/

Helmi55

Gut nochmals an den Start
ich lösche jetzt alles - importiere den shelly neu und hänge das passende template dazu und dann ersetzte ich dein attr ok so?
Danke
System1 fhem 6.1 auf RPi 4B mit 4GB, HMUSBConfig, DS9490R-1Wire, Busware USB 868, Pool-Solarsteuerung mit FHEM. System2 fhem 6.1 auf RPi 4B mit 4GB (Bullseye) mit Busware USB 868 und 433 und HMUARTLGW für Haussteuerung

https://www.flickr.com/photos/canonhelmi/

Beta-User

So sollte es dann passen.

Zitat von: Helmi55 am 04 Mai 2022, 16:04:08
das mit dem Punkt und Strich habe ich nicht verstanden - sorry
Hmm, ist auch zugegebenermaßen gar nicht so einfach...

Also: die Topic-Angaben in der readingList werden intern eigentlich als regex gehandhabt.
Problematisch ist hier aber, dass im Topic ein Doppelpunkt übermittelt wird, der bei der Übergabe von MQTT2_(IO) an MQTT2_DEVICE eigentlich eine (andere) Sonderrolle spielt. Also wird der vorab durch einen Unterstrich ersetzt, was aber dann Probleme macht, weil es nicht sauber aufeinanderpaßt. Also war mein Vorschlag, diese "Fehlersetzung" durch ein im regex-Kontext korrektes "beliebiges Zeichen" zu ersetzen - eben den berühmten "Punkt"... Dies nur zu dem Zweck, dass alles in jedem Fall matcht, egal, wer es wann wie "liest" bzw. interpretieren muss.
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

Helmi55

#13
Servus
Ich glaube ich habs geschafft:
So sieht jetzt Kanal 1 aus:
defmod MQTT2_shellypro4pm_083af27b3304 MQTT2_DEVICE shellypro4pm_083af27b3304
attr MQTT2_shellypro4pm_083af27b3304 comment Channel 1 for MQTT2_shellypro4pm_083af27b3304, see also MQTT2_shellypro4pm_083af27b3304_CH2, MQTT2_shellypro4pm_083af27b3304_CH3 and MQTT2_shellypro4pm_083af27b3304_CH4
attr MQTT2_shellypro4pm_083af27b3304 devStateIcon {my $onl = ReadingsVal($name,'online','false') eq 'false'?'10px-kreis-rot': ReadingsVal($name,'new_fw','false') eq 'true' ? '10px-kreis-gelb' : '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,1);; my $temp = ReadingsVal($name,'temperature','-100');; my $ip = ReadingsVal($name,'ip','none');; qq(<a href="http://$ip" target="_blank">${onl}</a><a href="/fhem?cmd.dummy=set $name toggle&XHR=1">${light}</a><div>Verbrauch: $cons W / Total: $total kwh / Temp: $temp °C</div>)}
attr MQTT2_shellypro4pm_083af27b3304 devicetopic shellypro4pm-083af27b3304
attr MQTT2_shellypro4pm_083af27b3304 getList in_mode:noArg in_mode $DEVICETOPIC/rpc {"id": 1,"src":"$DEVICETOPIC", "method": "Switch.GetConfig", "params": {"id": 0}}
attr MQTT2_shellypro4pm_083af27b3304 icon message_socket
attr MQTT2_shellypro4pm_083af27b3304 jsonMap params_switch_0_state:state params_switch_0_aenergy_total:aenergy_total params_switch_0_apower:apower params_switch_0_temperature_tC:temperature params_switch_0_temperature_tF:0 params_wifi_sta_ip:ip
attr MQTT2_shellypro4pm_083af27b3304 model shellypro4pm
attr MQTT2_shellypro4pm_083af27b3304 readingList $DEVICETOPIC/online:.* online\
  $DEVICETOPIC/events/rpc:.* { return if $EVENT =~ m{switch:[1-3]};; $EVENT =~ s/"output":true/"state":"on"/g;; $EVENT =~ s/"output":false/"state":"off"/g;; json2nameValue($EVENT,'',$JSONMAP) }\
  fhem2shelly/rpc:.* {}\
shellypro4pm_083af27b3304:shellypro4pm-083af27b3304/status/switch_2:.* { json2nameValue($EVENT) }\
shellypro4pm_083af27b3304:shellypro4pm-083af27b3304/status/switch_3:.* { json2nameValue($EVENT) }\
shellypro4pm_083af27b3304:shellypro4pm-083af27b3304/status/switch_0:.* { json2nameValue($EVENT) }\
shellypro4pm_083af27b3304:shellypro4pm-083af27b3304/status/mqtt:.* { json2nameValue($EVENT) }
attr MQTT2_shellypro4pm_083af27b3304 room MQTT2_DEVICE
attr MQTT2_shellypro4pm_083af27b3304 setList toggle:noArg $DEVICETOPIC/rpc {"id":1,"src":"fhem2shelly","method":"Switch.Toggle","params": {"id":0}}\
  off:noArg $DEVICETOPIC/rpc {"id":1,"src":"fhem2shelly","method":"Switch.Set","params": {"id":0,"on":false}}\
  on:noArg $DEVICETOPIC/rpc {"id":1,"src":"fhem2shelly","method":"Switch.Set","params": {"id":0,"on":true}}\
  on-for-timer $DEVICETOPIC/rpc {"id":1,"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}}\
  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"}
attr MQTT2_shellypro4pm_083af27b3304 setStateList on off toggle on-for-timer off-for-timer
attr MQTT2_shellypro4pm_083af27b3304 webCmd :

setstate MQTT2_shellypro4pm_083af27b3304 on
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 16:48:34 IODev myBroker
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 16:56:01 aenergy_by_minute_1 12022.021
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 16:56:01 aenergy_by_minute_2 11972.501
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 16:56:01 aenergy_by_minute_3 11812.510
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 16:56:01 aenergy_minute_ts 1651676159
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 16:56:01 aenergy_total 10404.007
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 16:56:01 apower 711.3
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 16:24:31 associatedWith MQTT2_shellypro4pm_083af27b3304_CH2,MQTT2_shellypro4pm_083af27b3304_CH3,MQTT2_shellypro4pm_083af27b3304_CH4
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 16:24:31 attrTemplateVersion 20220115
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 16:24:49 cfg_rev 10
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 16:48:38 connected true
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 16:56:01 current 3.167
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 16:56:01 dst shellypro4pm-083af27b3304/events
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 16:24:49 fs_free 282624
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 16:24:49 fs_size 524288
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 16:56:01 id 0
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 16:24:49 mac 083AF27B3304
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 16:56:01 method NotifyStatus
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 16:48:38 online true
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 16:56:01 output true
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 16:48:38 params_mqtt_connected true
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 16:56:01 params_switch_0_aenergy_by_minute_1 12022.021
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 16:56:01 params_switch_0_aenergy_by_minute_2 11972.501
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 16:56:01 params_switch_0_aenergy_by_minute_3 11812.510
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 16:56:01 params_switch_0_aenergy_minute_ts 1651676159
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 16:43:18 params_switch_0_current 3.190
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 16:56:01 params_switch_0_id 0
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 16:43:19 params_switch_0_pf 0.99
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 16:43:17 params_switch_0_source MQTT
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 16:24:36 params_switch_0_voltage 227.6
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 16:56:01 params_ts 1651676160.83
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 16:56:01 pf 0.99
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 16:24:49 ram_free 155192
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 16:24:49 ram_size 238236
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 16:24:49 restart_required false
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 16:56:01 source MQTT
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 16:56:01 src shellypro4pm-083af27b3304
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 16:43:17 state on
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 16:56:01 temperature_tC 41.7
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 16:56:01 temperature_tF 107.1
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 16:24:49 time 16:24
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 16:24:49 unixtime 1651674289
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 16:24:49 uptime 14
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 16:56:01 voltage 225.0
setstate MQTT2_shellypro4pm_083af27b3304 2022-05-04 16:24:29 x_reboot set


wo bei apower nicht immer ankommt? Steht ab und zu 0 dort obwohl die Pumpe läuft.

Was mir aufgefallen ist: Ich hab dein readingList im Raw eingefügt nach dem ich das vorhandene gelöscht habe, aber nach einiger zeit sind die wieder dazugekommen
obwohl ich "autocreate" disabled habe

shellypro4pm_083af27b3304:shellypro4pm-083af27b3304/status/switch_2:.* { json2nameValue($EVENT) }
shellypro4pm_083af27b3304:shellypro4pm-083af27b3304/status/switch_3:.* { json2nameValue($EVENT) }
shellypro4pm_083af27b3304:shellypro4pm-083af27b3304/status/switch_0:.* { json2nameValue($EVENT) }
shellypro4pm_083af27b3304:shellypro4pm-083af27b3304/status/mqtt:.* { json2nameValue($EVENT) }


und Kanal 2 sieht jetzt so aus:
defmod MQTT2_shellypro4pm_083af27b3304_CH2 MQTT2_DEVICE MQTT2_shellypro4pm_083af27b3304_CH2
attr MQTT2_shellypro4pm_083af27b3304_CH2 comment Channel 2 for MQTT2_shellypro4pm_083af27b3304, see also MQTT2_shellypro4pm_083af27b3304, MQTT2_shellypro4pm_083af27b3304_CH3 and MQTT2_shellypro4pm_083af27b3304_CH4
attr MQTT2_shellypro4pm_083af27b3304_CH2 devicetopic shellypro4pm-083af27b3304
attr MQTT2_shellypro4pm_083af27b3304_CH2 getList in_mode:noArg in_mode $DEVICETOPIC/rpc {"id": 1,"src":"$DEVICETOPIC", "method": "Switch.GetConfig", "params": {"id": 0}}
attr MQTT2_shellypro4pm_083af27b3304_CH2 icon message_socket
attr MQTT2_shellypro4pm_083af27b3304_CH2 jsonMap params_switch_1_state:state params_switch_1_aenergy_total:aenergy_total params_switch_1_apower:apower params_switch_1_temperature_tC:temperature params_switch_1_temperature_tF:0
attr MQTT2_shellypro4pm_083af27b3304_CH2 model shellypro4pm
attr MQTT2_shellypro4pm_083af27b3304_CH2 readingList $DEVICETOPIC/events/rpc:.* { return if $EVENT !~ m{switch:1};; $EVENT =~ s/"output":true/"state":"on"/g;; $EVENT =~ s/"output":false/"state":"off"/g;; json2nameValue($EVENT,'',$JSONMAP) }\
  shellypro4pm-083af27b3304/status/switch.1:.* { json2nameValue($EVENT, '', $JSONMAP) }
attr MQTT2_shellypro4pm_083af27b3304_CH2 room MQTT2_DEVICE
attr MQTT2_shellypro4pm_083af27b3304_CH2 setList toggle:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Toggle","params": {"id":1}}\
  off:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Set","params": {"id":1,"on":false}}\
  on:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Set","params": {"id":1,"on":true}}\
  on-for-timer $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Set","params": {"id":1,"on":true,"toggle_after":$EVTPART1}}\
  off-for-timer $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Set","params": {"id":1,"on":false,"toggle_after":$EVTPART1}}
attr MQTT2_shellypro4pm_083af27b3304_CH2 setStateList on off toggle on-for-timer off-for-timer
attr MQTT2_shellypro4pm_083af27b3304_CH2 webCmd :

setstate MQTT2_shellypro4pm_083af27b3304_CH2 set_off
setstate MQTT2_shellypro4pm_083af27b3304_CH2 2022-05-04 16:48:34 IODev myBroker
setstate MQTT2_shellypro4pm_083af27b3304_CH2 2022-05-04 16:58:00 aenergy_by_minute_1 0.000
setstate MQTT2_shellypro4pm_083af27b3304_CH2 2022-05-04 16:58:00 aenergy_by_minute_2 0.000
setstate MQTT2_shellypro4pm_083af27b3304_CH2 2022-05-04 16:58:00 aenergy_by_minute_3 0.000
setstate MQTT2_shellypro4pm_083af27b3304_CH2 2022-05-04 16:58:00 aenergy_minute_ts 1651676279
setstate MQTT2_shellypro4pm_083af27b3304_CH2 2022-05-04 16:58:33 aenergy_total 3573.346
setstate MQTT2_shellypro4pm_083af27b3304_CH2 2022-05-04 16:58:00 apower 0.0
setstate MQTT2_shellypro4pm_083af27b3304_CH2 2022-05-04 16:24:31 associatedWith MQTT2_shellypro4pm_083af27b3304,MQTT2_shellypro4pm_083af27b3304_CH3,MQTT2_shellypro4pm_083af27b3304_CH4
setstate MQTT2_shellypro4pm_083af27b3304_CH2 2022-05-04 16:24:31 attrTemplateVersion 20220115
setstate MQTT2_shellypro4pm_083af27b3304_CH2 2022-05-04 16:24:49 cfg_rev 10
setstate MQTT2_shellypro4pm_083af27b3304_CH2 2022-05-04 16:24:36 connected true
setstate MQTT2_shellypro4pm_083af27b3304_CH2 2022-05-04 16:58:00 current 0.000
setstate MQTT2_shellypro4pm_083af27b3304_CH2 2022-05-04 16:58:33 dst shellypro4pm-083af27b3304/events
setstate MQTT2_shellypro4pm_083af27b3304_CH2 2022-05-04 16:24:49 fs_free 282624
setstate MQTT2_shellypro4pm_083af27b3304_CH2 2022-05-04 16:24:49 fs_size 524288
setstate MQTT2_shellypro4pm_083af27b3304_CH2 2022-05-04 16:58:00 id 1
setstate MQTT2_shellypro4pm_083af27b3304_CH2 2022-05-04 16:24:49 mac 083AF27B3304
setstate MQTT2_shellypro4pm_083af27b3304_CH2 2022-05-04 16:58:33 method NotifyStatus
setstate MQTT2_shellypro4pm_083af27b3304_CH2 2022-05-04 16:58:00 output false
setstate MQTT2_shellypro4pm_083af27b3304_CH2 2022-05-04 16:58:33 params_switch_1_aenergy_by_minute_1 0.000
setstate MQTT2_shellypro4pm_083af27b3304_CH2 2022-05-04 16:58:33 params_switch_1_aenergy_by_minute_2 0.000
setstate MQTT2_shellypro4pm_083af27b3304_CH2 2022-05-04 16:58:33 params_switch_1_aenergy_by_minute_3 0.000
setstate MQTT2_shellypro4pm_083af27b3304_CH2 2022-05-04 16:58:33 params_switch_1_aenergy_minute_ts 1651676279
setstate MQTT2_shellypro4pm_083af27b3304_CH2 2022-05-04 16:54:10 params_switch_1_current 0
setstate MQTT2_shellypro4pm_083af27b3304_CH2 2022-05-04 16:58:33 params_switch_1_id 1
setstate MQTT2_shellypro4pm_083af27b3304_CH2 2022-05-04 16:54:10 params_switch_1_pf 0
setstate MQTT2_shellypro4pm_083af27b3304_CH2 2022-05-04 16:54:10 params_switch_1_source WS_in
setstate MQTT2_shellypro4pm_083af27b3304_CH2 2022-05-04 16:24:36 params_switch_1_voltage 227.5
setstate MQTT2_shellypro4pm_083af27b3304_CH2 2022-05-04 16:58:33 params_ts 1651676280.63
setstate MQTT2_shellypro4pm_083af27b3304_CH2 2022-05-04 16:58:00 pf 0.00
setstate MQTT2_shellypro4pm_083af27b3304_CH2 2022-05-04 16:24:49 ram_free 155192
setstate MQTT2_shellypro4pm_083af27b3304_CH2 2022-05-04 16:24:49 ram_size 238236
setstate MQTT2_shellypro4pm_083af27b3304_CH2 2022-05-04 16:24:49 restart_required false
setstate MQTT2_shellypro4pm_083af27b3304_CH2 2022-05-04 16:58:00 source WS_in
setstate MQTT2_shellypro4pm_083af27b3304_CH2 2022-05-04 16:58:33 src shellypro4pm-083af27b3304
setstate MQTT2_shellypro4pm_083af27b3304_CH2 2022-05-04 16:58:20 state set_off
setstate MQTT2_shellypro4pm_083af27b3304_CH2 2022-05-04 16:58:00 temperature_tC 41.4
setstate MQTT2_shellypro4pm_083af27b3304_CH2 2022-05-04 16:58:00 temperature_tF 106.5
setstate MQTT2_shellypro4pm_083af27b3304_CH2 2022-05-04 16:24:49 time 16:24
setstate MQTT2_shellypro4pm_083af27b3304_CH2 2022-05-04 16:24:49 unixtime 1651674289
setstate MQTT2_shellypro4pm_083af27b3304_CH2 2022-05-04 16:24:49 uptime 14
setstate MQTT2_shellypro4pm_083af27b3304_CH2 2022-05-04 16:58:00 voltage 226.8


hier habe ich allerdings im state "Lampensymbol" ein rotes Rufzeichen?
Und im state werden die Werte nicht angezeigt - egal - Hauptsache in den Readings.
"Soeben gesehen - hier ist keine devStateIcon"

Jetzt noch 2 Fragen:
Ich kann jetzt
$DEVICETOPIC/events/rpc:.* { return if $EVENT !~ m{switch:1};; $EVENT =~ s/"output":true/"state":"on"/g;; $EVENT =~ s/"output":false/"state":"off"/g;; json2nameValue($EVENT,'',$JSONMAP) }\
  shellypro4pm-083af27b3304/status/switch.1:.* { json2nameValue($EVENT, '', $JSONMAP) }

in Kanal 3 und 4 kopieren?

Und ich muss diesen Shelly vom autoupdate ausnehmen - sonst wird er ja wieder beim nächsten update geändert?

Danke für deine Hilfe und Zeit.

Gruß
Helmut
System1 fhem 6.1 auf RPi 4B mit 4GB, HMUSBConfig, DS9490R-1Wire, Busware USB 868, Pool-Solarsteuerung mit FHEM. System2 fhem 6.1 auf RPi 4B mit 4GB (Bullseye) mit Busware USB 868 und 433 und HMUARTLGW für Haussteuerung

https://www.flickr.com/photos/canonhelmi/

Beta-User

Hmm, das mit autocreate ist "komisch" - ich hatte auf dem Testsystem auch ungewohnte Effekte... Nach einem FHEM-Neustart war dann aber zumindest die Auswertung von deinem MQTT-Traffic-Schnipsel ok.

readingList in Kanal 1 sollte m.E. erst mal so aussehen:
attr MQTT2_shellypro4pm_083af27b3304 readingList $DEVICETOPIC/online:.* online\
  $DEVICETOPIC/events/rpc:.* { return if $EVENT =~ m{switch:[1-3]};; $EVENT =~ s/"output":true/"state":"on"/g;; $EVENT =~ s/"output":false/"state":"off"/g;; json2nameValue($EVENT,'',$JSONMAP) }\
  fhem2shelly/rpc:.* {}\
  $DEVICETOPIC/status/switch.0:.* { json2nameValue($EVENT, '', $JSONMAP) }\
  $DEVICETOPIC/status/mqtt:.* { json2nameValue($EVENT, '', $JSONMAP) }


Zitathier habe ich allerdings im state "Lampensymbol" ein rotes Rufzeichen?
Das kommt daher, dass anscheinend irgendwas mit dem mapping/der Ersetzung in der readingList nicht klappt. Der Grund ist mir im Moment nicht klar, dazu müßte ich den ganzen Verkehr einer Schaltanweisung an den betreffenden Kanal sehen (alles, was raus- und wieder reingeht).

Zitat von: Helmi55 am 04 Mai 2022, 17:02:41
Jetzt noch 2 Fragen:
Ich kann jetzt
$DEVICETOPIC/events/rpc:.* { return if $EVENT !~ m{switch:1};; $EVENT =~ s/"output":true/"state":"on"/g;; $EVENT =~ s/"output":false/"state":"off"/g;; json2nameValue($EVENT,'',$JSONMAP) }\
  shellypro4pm-083af27b3304/status/switch.1:.* { json2nameValue($EVENT, '', $JSONMAP) }

in Kanal 3 und 4 kopieren?
Jein. Die "Indexziffer" ("1") muss dann durch "2" bzw. "3" ersetzt werden, dann sollte das ok sein.

Zitat
Und ich muss diesen Shelly vom autoupdate ausnehmen - sonst wird er ja wieder beim nächsten update geändert?
FHEM ändert die Attribute nicht, nur weil ggf. ein neues attrTemplate ausgeliefert wurde. Das wird nur wirksam, wenn der betr. User das aktiv "anschubst". Was die firmware betrifft: k.A.... Im Zweifel aktuell halten und dann eben die Attribute in FHEM so nachziehen, dass es wieder zusammenpaßt....
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