MQTT2+Shelly: erste Konfiguration und template-Entwicklung

Begonnen von miggun, 03 Dezember 2018, 21:05:34

Vorheriges Thema - Nächstes Thema

gameshacker

So also,

Ich habe auch das Gerät komplett resettet, denn hier hatte ich den Namen schon geändert.
auch die Zeile habe ich entsprechend geändert.

Allerdings stehe ich ein bisschen auf dem Schlauch, wie das mit dem einlesen funktioniert.
Ich habe nun auch das JsonMap Attribut gesetzt, ich dhabe die Beispiele in der Href so verstanden.
attr MQTT2_shellyplusht_XXXXXXXXX jsonMap devicepower_0_battery_percent:battery humidity_0_rh:humidity temperature_0_tC:temperature

Wo wird aber nun was angezeigt?

Das list sieht nun so aus:

define MQTT2_shellyplusht_XXXXXXXXX MQTT2_DEVICE shellyplusht_c049ef8b7a8c
attr MQTT2_shellyplusht_XXXXXXXXX jsonMap devicepower_0_battery_percent:battery humidity_0_rh:humidity temperature_0_tC:temperature
attr MQTT2_shellyplusht_XXXXXXXXX readingList shellyplusht_c049ef8b7a8c:shellyplusht-c049ef8b7a8c/online:.* online\
shellyplusht_XXXXXXXXX:shellyplusht-XXXXXXXXX/status/ble:.* ble\
shellyplusht_XXXXXXXXX:shellyplusht-XXXXXXXXX/status/cloud:.* { json2nameValue($EVENT, 'cloud_', $JSONMAP) }\shellyplusht_XXXXXXXXX
shellyplusht_XXXXXXXXX:shellyplusht-XXXXXXXXX/status/devicepower_0:.* { json2nameValue($EVENT, 'devicepower_0_', $JSONMAP) }\
shellyplusht_XXXXXXXXX:shellyplusht-XXXXXXXXX/status/ht_ui:.* ht_ui\
shellyplusht_XXXXXXXXX:shellyplusht-XXXXXXXXX/status/humidity_0:.* { json2nameValue($EVENT, 'humidity_0_', $JSONMAP) }\
shellyplusht_XXXXXXXXX:shellyplusht-XXXXXXXXX/status/mqtt:.* { json2nameValue($EVENT, 'mqtt_', $JSONMAP) }\
shellyplusht_XXXXXXXXX:shellyplusht-XXXXXXXXX/status/sys:.* { json2nameValue($EVENT, 'sys_', $JSONMAP) }\
shellyplusht_XXXXXXXXX:shellyplusht-XXXXXXXXX/status/temperature_0:.* { json2nameValue($EVENT, 'temperature_0_', $JSONMAP) }\
shellyplusht_XXXXXXXXX:shellyplusht-XXXXXXXXX/status/wifi:.* { json2nameValue($EVENT, 'wifi_', $JSONMAP) }\
shellyplusht_XXXXXXXXX:shellyplusht-XXXXXXXXX/status/ws:.* { json2nameValue($EVENT, 'ws_', $JSONMAP) }\
shellyplusht_XXXXXXXXX:shellyplusht-XXXXXXXXX/events/rpc:.* { json2nameValue($EVENT, '', $JSONMAP) }
attr MQTT2_shellyplusht_XXXXXXXXX room MQTT2_DEVICE
.....
setstate MQTT2_shellyplusht_XXXXXXXXX 2023-03-07 11:37:32 rpc_dst shellyplusht-XXXXXXXXX/events
setstate MQTT2_shellyplusht_XXXXXXXXX 2023-03-07 11:37:32 rpc_method NotifyEvent
setstate MQTT2_shellyplusht_XXXXXXXXX 2023-03-07 11:37:30 rpc_params_cloud_connected false
setstate MQTT2_shellyplusht_XXXXXXXXX 2023-03-07 11:37:30 rpc_params_devicepower_0_battery_V 5.71
setstate MQTT2_shellyplusht_XXXXXXXXX 2023-03-07 11:37:30 rpc_params_devicepower_0_battery_percent 85
setstate MQTT2_shellyplusht_XXXXXXXXX 2023-03-07 11:37:30 rpc_params_devicepower_0_external_present false
setstate MQTT2_shellyplusht_XXXXXXXXX 2023-03-07 11:37:30 rpc_params_devicepower_0_id 0
setstate MQTT2_shellyplusht_XXXXXXXXX 2023-03-07 11:37:32 rpc_params_events_1_component sys
setstate MQTT2_shellyplusht_XXXXXXXXX 2023-03-07 11:37:32 rpc_params_events_1_event sleep
setstate MQTT2_shellyplusht_XXXXXXXXX 2023-03-07 11:37:32 rpc_params_events_1_ts 1678185452.96
setstate MQTT2_shellyplusht_XXXXXXXXX 2023-03-07 11:37:30 rpc_params_humidity_0_id 0
setstate MQTT2_shellyplusht_XXXXXXXXX 2023-03-07 11:37:30 rpc_params_humidity_0_rh 42.6
setstate MQTT2_shellyplusht_XXXXXXXXX 2023-03-07 11:37:30 rpc_params_mqtt_connected true
setstate MQTT2_shellyplusht_XXXXXXXXX 2023-03-07 11:37:30 rpc_params_sys_cfg_rev 5
setstate MQTT2_shellyplusht_XXXXXXXXX 2023-03-07 11:37:30 rpc_params_sys_fs_free 114688
setstate MQTT2_shellyplusht_XXXXXXXXX 2023-03-07 11:37:30 rpc_params_sys_fs_size 458752
setstate MQTT2_shellyplusht_XXXXXXXXX 2023-03-07 11:37:30 rpc_params_sys_kvs_rev 0
setstate MQTT2_shellyplusht_XXXXXXXXX 2023-03-07 11:37:30 rpc_params_sys_mac XXXXXXXXX
setstate MQTT2_shellyplusht_XXXXXXXXX 2023-03-07 11:37:30 rpc_params_sys_ram_free 146828
setstate MQTT2_shellyplusht_XXXXXXXXX 2023-03-07 11:37:30 rpc_params_sys_ram_size 249712
setstate MQTT2_shellyplusht_XXXXXXXXX 2023-03-07 11:37:30 rpc_params_sys_restart_required false
setstate MQTT2_shellyplusht_XXXXXXXXX 2023-03-07 11:37:30 rpc_params_sys_uptime 1
setstate MQTT2_shellyplusht_XXXXXXXXX 2023-03-07 11:37:30 rpc_params_sys_wakeup_period 7200
setstate MQTT2_shellyplusht_XXXXXXXXX 2023-03-07 11:37:30 rpc_params_sys_wakeup_reason_boot software_restart
setstate MQTT2_shellyplusht_XXXXXXXXX 2023-03-07 11:37:30 rpc_params_sys_wakeup_reason_cause undefined
setstate MQTT2_shellyplusht_XXXXXXXXX 2023-03-07 11:37:30 rpc_params_sys_webhook_rev 0
setstate MQTT2_shellyplusht_XXXXXXXXX 2023-03-07 11:37:30 rpc_params_temperature_0_id 0
setstate MQTT2_shellyplusht_XXXXXXXXX 2023-03-07 11:37:30 rpc_params_temperature_0_tC 27.8
setstate MQTT2_shellyplusht_XXXXXXXXX 2023-03-07 11:37:30 rpc_params_temperature_0_tF 82.0
setstate MQTT2_shellyplusht_XXXXXXXXX 2023-03-07 11:37:32 rpc_params_ts 1678185452.96
setstate MQTT2_shellyplusht_XXXXXXXXX 2023-03-07 11:37:30 rpc_params_wifi_rssi -46
setstate MQTT2_shellyplusht_XXXXXXXXX 2023-03-07 11:37:30 rpc_params_wifi_ssid XXXXXXXXX
setstate MQTT2_shellyplusht_XXXXXXXXX 2023-03-07 11:37:30 rpc_params_wifi_sta_ip x.x.x.x
setstate MQTT2_shellyplusht_XXXXXXXXX 2023-03-07 11:37:30 rpc_params_wifi_status got ip
setstate MQTT2_shellyplusht_XXXXXXXXX 2023-03-07 11:37:30 rpc_params_ws_connected false
setstate MQTT2_shellyplusht_XXXXXXXXX 2023-03-07 11:37:32 rpc_src shellyplusht-XXXXXXXXX
setstate MQTT2_shellyplusht_XXXXXXXXX 2023-03-07 12:18:21 src shellyplusht-XXXXXXXXX
......


Grüße Gameshacker

Beta-User

Na ja, wenn du jsonMap verwendest, solltest du auch in "old:new" auf "old" setzen und nicht nur Teile davon. Sonst sieht das schon besser aus...
Server: HP-T620@Debian 11, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

buennerbernd

Ich habe einen Shelly PlusPlugS.
Mit dem Template shelly1_w_energy_measuring kommen Werte rein.

Mir ist es allerdings noch nicht gelungen, Werte (speziell den output) per MQTT zu setzen.

Ist das schon jemandem gelungen? Gibt es ein Template, das besser passt?

Danke schon mal im Voraus.
Modulentwickler von KLF200 und KLF200Node

Beta-User

Die "plus"-Modelle sind 2nd gen.. Dafür gibt es eine andere attrTemplate-"Linie", die 1er passen nicht!
(Nächster Abschnitt der template-file)
Server: HP-T620@Debian 11, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

buennerbernd

Ich habe das Template shellyPlus_1pm ausprobiert.

Die Setter bleiben leider erfolglos.
Die jsonMap scheint leider auch nicht richtig zum Shelly PlusPlugS zu passen.
Modulentwickler von KLF200 und KLF200Node

buennerbernd

#935
Ich nehme an, dass nichts an dem Template so richtig funktioniert, weil bei mir $DEVICETOPIC nicht gesetzt ist.
Müsste ich das nicht in den Internals sehen?

define MQTT2_shellyplusplugs_80646fd60bf4 MQTT2_DEVICE shellyplusplugs_80646fd60bf4
attr MQTT2_shellyplusplugs_80646fd60bf4 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>)}
attr MQTT2_shellyplusplugs_80646fd60bf4 devicetopic shellyplusplugs
attr MQTT2_shellyplusplugs_80646fd60bf4 getList in_mode:noArg in_mode $DEVICETOPIC/rpc {"id": 1,"src":"$DEVICETOPIC", "method": "Switch.GetConfig", "params": {"id": 0}}
attr MQTT2_shellyplusplugs_80646fd60bf4 icon message_socket
attr MQTT2_shellyplusplugs_80646fd60bf4 jsonMap switch_state:state switch_aenergy_total:aenergy_total switch_apower:apower temperature_tC:temperature 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
attr MQTT2_shellyplusplugs_80646fd60bf4 model shellyPlus_1pm
attr MQTT2_shellyplusplugs_80646fd60bf4 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:.* {}\
shellyplusplugs_80646fd60bf4:shellyplusplugs-80646fd60bf4/events/rpc:.* { json2nameValue($EVENT) }\
shellyplusplugs_80646fd60bf4:shellyplusplugs-80646fd60bf4/status/switch_0:.* { json2nameValue($EVENT) }
attr MQTT2_shellyplusplugs_80646fd60bf4 room MQTT2_DEVICE
attr MQTT2_shellyplusplugs_80646fd60bf4 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}}}}
attr MQTT2_shellyplusplugs_80646fd60bf4 setStateList on off toggle on-for-timer off-for-timer
attr MQTT2_shellyplusplugs_80646fd60bf4 webCmd :

setstate MQTT2_shellyplusplugs_80646fd60bf4 2023-06-05 14:25:37 IODev MQTTBroker
setstate MQTT2_shellyplusplugs_80646fd60bf4 2023-06-05 14:46:00 aenergy_by_minute_1 0.000
setstate MQTT2_shellyplusplugs_80646fd60bf4 2023-06-05 14:46:00 aenergy_by_minute_2 0.000
setstate MQTT2_shellyplusplugs_80646fd60bf4 2023-06-05 14:46:00 aenergy_by_minute_3 0.000
setstate MQTT2_shellyplusplugs_80646fd60bf4 2023-06-05 14:46:00 aenergy_minute_ts 1685969159
setstate MQTT2_shellyplusplugs_80646fd60bf4 2023-06-05 14:46:00 aenergy_total 406.372
setstate MQTT2_shellyplusplugs_80646fd60bf4 2023-06-05 14:46:00 apower 0.0
setstate MQTT2_shellyplusplugs_80646fd60bf4 2023-06-05 14:26:25 attrTemplateVersion 20220303
setstate MQTT2_shellyplusplugs_80646fd60bf4 2023-06-05 14:46:00 current 0.000
setstate MQTT2_shellyplusplugs_80646fd60bf4 2023-06-05 14:46:00 dst shellyplusplugs-80646fd60bf4/events
setstate MQTT2_shellyplusplugs_80646fd60bf4 2023-06-05 14:46:00 id 0
setstate MQTT2_shellyplusplugs_80646fd60bf4 2023-06-05 14:46:00 method NotifyStatus
setstate MQTT2_shellyplusplugs_80646fd60bf4 2023-06-05 14:46:00 output true
setstate MQTT2_shellyplusplugs_80646fd60bf4 2023-06-05 14:46:00 params_switch_0_aenergy_by_minute_1 0.000
setstate MQTT2_shellyplusplugs_80646fd60bf4 2023-06-05 14:46:00 params_switch_0_aenergy_by_minute_2 0.000
setstate MQTT2_shellyplusplugs_80646fd60bf4 2023-06-05 14:46:00 params_switch_0_aenergy_by_minute_3 0.000
setstate MQTT2_shellyplusplugs_80646fd60bf4 2023-06-05 14:46:00 params_switch_0_aenergy_minute_ts 1685969159
setstate MQTT2_shellyplusplugs_80646fd60bf4 2023-06-05 14:46:00 params_switch_0_aenergy_total 406.372
setstate MQTT2_shellyplusplugs_80646fd60bf4 2023-06-05 14:46:00 params_switch_0_id 0
setstate MQTT2_shellyplusplugs_80646fd60bf4 2023-06-05 14:46:00 params_ts 1685969160.97
setstate MQTT2_shellyplusplugs_80646fd60bf4 2023-06-05 14:46:00 source http
setstate MQTT2_shellyplusplugs_80646fd60bf4 2023-06-05 14:46:00 src shellyplusplugs-80646fd60bf4
setstate MQTT2_shellyplusplugs_80646fd60bf4 2023-06-05 14:46:00 temperature_tC 30.1
setstate MQTT2_shellyplusplugs_80646fd60bf4 2023-06-05 14:46:00 temperature_tF 86.1
setstate MQTT2_shellyplusplugs_80646fd60bf4 2023-06-05 14:46:00 voltage 235.6
setstate MQTT2_shellyplusplugs_80646fd60bf4 2023-06-05 14:26:25 x_reboot set

Modulentwickler von KLF200 und KLF200Node

Beta-User

Es ist gesetzt, aber der Bindestrich und die darauf folgende chip-id fehlen m.E.
Server: HP-T620@Debian 11, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

buennerbernd

Danke, ich nähere mich an.
Ich habe das Attribut devicetopic entdeckt und auf shellyplusplugs-80646fd60bf4 gesetzt.
Die Setter on, off, toggle über rpc/ gehen jetzt.
Das Reading state geht jetzt auch. Ein großer Schritt nach vorn.

Alles was unter getList und jsonMap steht scheint aber weiterhin nicht zu funktionieren.
Modulentwickler von KLF200 und KLF200Node

Motivierte linke Hände

Ich habe hier einen Shelly pro 3EM, den ich gerade mal einzubinden versuche. Besonders weit bin ich nicht (oder vielleicht doch). Readings kommen grundsätzlich (außer "online", da kommt zwar per MQTT der Wert, aber der taucht als Reading nicht auf):

Internals:
  CFGFN     
  CID        Shelly-WPumpe
  DEF        Shelly-WPumpe
  FUUID      648f1b86-f33f-e1ef-97b1-c507d41cc2f594a9
  IODev      myBroker
  LASTInputDev myBroker
  MSGCNT    8148
  NAME      MQTT2_Shelly_WPumpe
  NR        12531
  STATE      P1: -0.0 W / Total P1: 0.1 kWh<br>P2: -0.0 W / Total P2: 0.0 kWh<br>P3: -0.1 W / Total P3: 0.1 kWh
  TYPE      MQTT2_DEVICE
  eventCount 8154
  myBroker_MSGCNT 8148
  myBroker_TIME 2023-06-18 20:14:43
  OLDREADINGS:
  READINGS:
    2023-06-18 16:58:14  IODev          myBroker
    2023-06-18 19:51:00  associatedWith  MQTT2_myBroker
    2023-06-18 20:14:43  em_0_a_act_power -0.0
    2023-06-18 20:14:43  em_0_a_aprt_power 0.0
    2023-06-18 20:14:43  em_0_a_current  0.028
    2023-06-18 20:14:43  em_0_a_pf      1.00
    2023-06-18 20:14:43  em_0_a_voltage  0.1
    2023-06-18 20:14:43  em_0_b_act_power -0.0
    2023-06-18 20:14:43  em_0_b_aprt_power 0.0
    2023-06-18 20:14:43  em_0_b_current  0.027
    2023-06-18 20:14:43  em_0_b_pf      1.00
    2023-06-18 20:14:43  em_0_b_voltage  0.1
    2023-06-18 20:14:43  em_0_c_act_power -0.1
    2023-06-18 20:14:43  em_0_c_aprt_power 6.4
    2023-06-18 20:14:43  em_0_c_current  0.027
    2023-06-18 20:14:43  em_0_c_pf      1.00
    2023-06-18 20:14:43  em_0_c_voltage  238.5
    2023-06-18 20:14:43  em_0_errors_1  no_load
    2023-06-18 20:14:43  em_0_id        0
    2023-06-18 20:14:43  em_0_total_act_power -0.151
    2023-06-18 20:14:43  em_0_total_aprt_power 6.359
    2023-06-18 20:14:43  em_0_total_current 0.081
    2023-06-18 20:14:00  emdata_0_a_total_act_energy 62.59
    2023-06-18 20:14:00  emdata_0_a_total_act_ret_energy 0.00
    2023-06-18 20:14:00  emdata_0_b_total_act_energy 20.55
    2023-06-18 20:14:00  emdata_0_b_total_act_ret_energy 0.00
    2023-06-18 20:14:00  emdata_0_c_total_act_energy 62.62
    2023-06-18 20:14:00  emdata_0_c_total_act_ret_energy 0.00
    2023-06-18 20:14:00  emdata_0_id    0
    2023-06-18 20:14:00  emdata_0_total_act 145.76
    2023-06-18 20:14:00  emdata_0_total_act_ret 0.00
    2023-06-18 20:14:43  rpc_dst        shellies/Shelly-WPumpe/events
    2023-06-18 20:14:43  rpc_method      NotifyStatus
    2023-06-18 20:14:43  rpc_params_em_0_a_act_power -0.0
    2023-06-18 20:14:43  rpc_params_em_0_a_aprt_power 0.0
    2023-06-18 20:14:43  rpc_params_em_0_a_current 0.028
    2023-06-18 20:14:43  rpc_params_em_0_a_pf 1.00
    2023-06-18 20:14:43  rpc_params_em_0_a_voltage 0.1
    2023-06-18 20:14:43  rpc_params_em_0_b_act_power -0.0
    2023-06-18 20:14:43  rpc_params_em_0_b_aprt_power 0.0
    2023-06-18 20:14:43  rpc_params_em_0_b_current 0.027
    2023-06-18 20:14:43  rpc_params_em_0_b_pf 1.00
    2023-06-18 20:14:43  rpc_params_em_0_b_voltage 0.1
    2023-06-18 20:14:43  rpc_params_em_0_c_act_power -0.1
    2023-06-18 20:14:43  rpc_params_em_0_c_aprt_power 6.4
    2023-06-18 20:14:43  rpc_params_em_0_c_current 0.027
    2023-06-18 20:14:43  rpc_params_em_0_c_pf 1.00
    2023-06-18 20:14:43  rpc_params_em_0_c_voltage 238.5
    2023-06-18 20:14:43  rpc_params_em_0_id 0
    2023-06-18 20:14:43  rpc_params_em_0_total_act_power -0.151
    2023-06-18 20:14:43  rpc_params_em_0_total_aprt_power 6.359
    2023-06-18 20:14:43  rpc_params_em_0_total_current 0.081
    2023-06-18 20:14:00  rpc_params_emdata_0_a_total_act_energy 62.59
    2023-06-18 20:14:00  rpc_params_emdata_0_a_total_act_ret_energy 0.00
    2023-06-18 20:14:00  rpc_params_emdata_0_b_total_act_energy 20.55
    2023-06-18 20:14:00  rpc_params_emdata_0_b_total_act_ret_energy 0.00
    2023-06-18 20:14:00  rpc_params_emdata_0_c_total_act_energy 62.62
    2023-06-18 20:14:00  rpc_params_emdata_0_c_total_act_ret_energy 0.00
    2023-06-18 20:14:00  rpc_params_emdata_0_id 0
    2023-06-18 20:14:00  rpc_params_emdata_0_total_act 145.76
    2023-06-18 20:14:00  rpc_params_emdata_0_total_act_ret 0.00
    2023-06-18 20:14:00  rpc_params_events_1_component emdata:0
    2023-06-18 20:14:00  rpc_params_events_1_data_period 60
    2023-06-18 20:14:00  rpc_params_events_1_data_ts 1687111980
    2023-06-18 20:14:00  rpc_params_events_1_data_values_1_1 0.0000
    2023-06-18 20:14:00  rpc_params_events_1_data_values_1_10 0.0
    2023-06-18 20:14:00  rpc_params_events_1_data_values_1_11 0.076
    2023-06-18 20:14:00  rpc_params_events_1_data_values_1_12 0.071
    2023-06-18 20:14:00  rpc_params_events_1_data_values_1_13 0.073
    2023-06-18 20:14:00  rpc_params_events_1_data_values_1_14 0.029
    2023-06-18 20:14:00  rpc_params_events_1_data_values_1_15 0.027
    2023-06-18 20:14:00  rpc_params_events_1_data_values_1_16 0.028
    2023-06-18 20:14:00  rpc_params_events_1_data_values_1_17 0.0000
    2023-06-18 20:14:00  rpc_params_events_1_data_values_1_18 0.0000
    2023-06-18 20:14:00  rpc_params_events_1_data_values_1_19 0.0000
    2023-06-18 20:14:00  rpc_params_events_1_data_values_1_2 0.0000
    2023-06-18 20:14:00  rpc_params_events_1_data_values_1_20 0.0000
    2023-06-18 20:14:00  rpc_params_events_1_data_values_1_21 0.0000
    2023-06-18 20:14:00  rpc_params_events_1_data_values_1_22 0.0000
    2023-06-18 20:14:00  rpc_params_events_1_data_values_1_23 0.0
    2023-06-18 20:14:00  rpc_params_events_1_data_values_1_24 -0.0
    2023-06-18 20:14:00  rpc_params_events_1_data_values_1_25 0.0
    2023-06-18 20:14:00  rpc_params_events_1_data_values_1_26 0.0
    2023-06-18 20:14:00  rpc_params_events_1_data_values_1_27 0.078
    2023-06-18 20:14:00  rpc_params_events_1_data_values_1_28 0.072
    2023-06-18 20:14:00  rpc_params_events_1_data_values_1_29 0.075
    2023-06-18 20:14:00  rpc_params_events_1_data_values_1_3 0.0000
    2023-06-18 20:14:00  rpc_params_events_1_data_values_1_30 0.028
    2023-06-18 20:14:00  rpc_params_events_1_data_values_1_31 0.026
    2023-06-18 20:14:00  rpc_params_events_1_data_values_1_32 0.027
    2023-06-18 20:14:00  rpc_params_events_1_data_values_1_33 0.0000
    2023-06-18 20:14:00  rpc_params_events_1_data_values_1_34 0.0001
    2023-06-18 20:14:00  rpc_params_events_1_data_values_1_35 0.0000
    2023-06-18 20:14:00  rpc_params_events_1_data_values_1_36 0.0003
    2023-06-18 20:14:00  rpc_params_events_1_data_values_1_37 0.0000
    2023-06-18 20:14:00  rpc_params_events_1_data_values_1_38 0.0000
    2023-06-18 20:14:00  rpc_params_events_1_data_values_1_39 0.5
    2023-06-18 20:14:00  rpc_params_events_1_data_values_1_4 0.0000
    2023-06-18 20:14:00  rpc_params_events_1_data_values_1_40 -0.3
    2023-06-18 20:14:00  rpc_params_events_1_data_values_1_41 6.7
    2023-06-18 20:14:00  rpc_params_events_1_data_values_1_42 6.3
    2023-06-18 20:14:00  rpc_params_events_1_data_values_1_43 238.645
    2023-06-18 20:14:00  rpc_params_events_1_data_values_1_44 236.979
    2023-06-18 20:14:00  rpc_params_events_1_data_values_1_45 238.289
    2023-06-18 20:14:00  rpc_params_events_1_data_values_1_46 0.028
    2023-06-18 20:14:00  rpc_params_events_1_data_values_1_47 0.027
    2023-06-18 20:14:00  rpc_params_events_1_data_values_1_48 0.027
    2023-06-18 20:14:00  rpc_params_events_1_data_values_1_49 0.028
    2023-06-18 20:14:00  rpc_params_events_1_data_values_1_5 0.0000
    2023-06-18 20:14:00  rpc_params_events_1_data_values_1_50 0.026
    2023-06-18 20:14:00  rpc_params_events_1_data_values_1_51 0.028
    2023-06-18 20:14:00  rpc_params_events_1_data_values_1_6 0.0000
    2023-06-18 20:14:00  rpc_params_events_1_data_values_1_7 0.0
    2023-06-18 20:14:00  rpc_params_events_1_data_values_1_8 -0.0
    2023-06-18 20:14:00  rpc_params_events_1_data_values_1_9 0.0
    2023-06-18 20:14:00  rpc_params_events_1_event data
    2023-06-18 20:14:00  rpc_params_events_1_id 0
    2023-06-18 20:14:00  rpc_params_events_1_ts 1687111980.00
    2023-06-18 20:14:43  rpc_params_ts  1687112081.70
    2023-06-18 20:14:43  rpc_src        shellypro3em-0cb815fce6c0
Attributes:
  readingList $DEVICETOPIC/online:.* online
$DEVICETOPIC:.* { json2nameValue($EVENT,'',$JSONMAP) }
shellies/Shelly-WPumpe/events/rpc:.* { json2nameValue($EVENT, 'rpc_', $JSONMAP) }
shellies/Shelly-WPumpe/status/em_0:.* { json2nameValue($EVENT, 'em_0_', $JSONMAP) }
shellies/Shelly-WPumpe/status/emdata_0:.* { json2nameValue($EVENT, 'emdata_0_', $JSONMAP) }
  room      MQTT2_DEVICE
  stateFormat { my $cons1 = ReadingsVal($name,'em_0_a_act_power',0); my $cons2 = ReadingsVal($name,'em_0_b_act_power',0); my $cons3 = ReadingsVal($name,'em_0_c_act_power',0); my $total1 = round(ReadingsNum($name,'emdata_0_a_total_act_energy',0)/1000,1); my $total2 = round(ReadingsNum($name,'emdata_0_b_total_act_energy',0)/1000,1); my $total3 = round(ReadingsNum($name,'emdata_0_c_total_act_energy',0)/1000,1); return qq(P1: $cons1 W / Total P1: $total1 kWh<br>P2: $cons2 W / Total P2: $total2 kWh<br>P3: $cons3 W / Total P3: $total3 kWh) }

Schalten kann der pro 3EM nicht. Die/eine Frage ist, ob man die Readings so belassen oder vielleicht umbenennen sollte, damit es besser zu den 3EMs passt...?

FHEM 6 in einer KVM VM mit Ubuntu
HM-CFG-USB2, 2xHM-CFG-HMLAN, HM-HMUARTLGW mit 100+ HomeMatic Devices, Geofencing, Fritzbox, Unifi, HUE, Harmony-Hub, Denon-Receiver-Modul, Calendar, GardenaSmartDevice, Shelly, MQTT (zigbee2mqtt, Tasmota und Shelly) und ein wenig 1Wire.

Alcamar

Hallo,

bin auch gerade etwas verloren.
Ich habe auch einen Shelly pro 3EM, der über LAN fleißig seine Messdaten an fhem sendet.
Leider kommen die readings in fhem anders an, als ich sie erwarten würde. Die Namen haben einen "Präfix" Params_em_...
Die Messwerte lassen sich zwar inhaltlich den einzelnen Phasen (a,b,c) zuordnen, und die Totals stimmen auf dem ersten Blick. Aber die Bezeichner sind völlig andere als ich in Postings im Forum finde. Wenn ich als attrTemplate shelly3em wähle, passt natürlich die Zuordnung dann gar nicht mehr.

Hat jemand einen Hinweis für mich? Wo lassen sich die ankommenden Readings-Beichner steuern?

Liegt das Problem am Settings des Shellys oder an fhem?
Beim Setting des Shelly selbst habe ich einen Eintrag gemacht, der mir nicht verständlich ist:
MQTT PREFIX, den ich mit "ShellyPro" gefüllt habe.



Internals:
   CFGFN     
   CID        ShellyPro
   DEF        ShellyPro
   FUUID      64a1e25f-f33f-82e0-e42e-955e9ad1ef781b50
   IODev      mqtt2s
   LASTInputDev mqtt2s
   MSGCNT     627
   NAME       MQTT2_ShellyPro
   NR         1901
   STATE      Relay: off,<br>P1: 0 W / Total P1: 0 kWh<br>P2: 0 W / Total P2: 0 kWh<br>P3: 0 W / Total P3: 0 kWh
   TYPE       MQTT2_DEVICE
   eventCount 636
   mqtt2s_CONN mqtt2s_192.168.3.30_58439
   mqtt2s_MSGCNT 627
   mqtt2s_TIME 2023-07-02 23:03:23
   OLDREADINGS:
   READINGS:
     2023-07-02 22:47:27   IODev           mqtt2s
     2023-07-02 23:03:23   a_act_power     5.9
     2023-07-02 23:03:23   a_aprt_power    82.3
     2023-07-02 23:03:23   a_current       0.346
     2023-07-02 23:03:23   a_pf            -0.52
     2023-07-02 23:03:00   a_total_act_energy 3053.59
     2023-07-02 23:03:00   a_total_act_ret_energy 0.00
     2023-07-02 23:03:23   a_voltage       237.6
     2023-07-02 22:58:06   attrTemplateVersion 20220109
     2023-07-02 23:03:23   b_act_power     378.6
     2023-07-02 23:03:23   b_aprt_power    445.5
     2023-07-02 23:03:23   b_current       1.872
     2023-07-02 23:03:23   b_pf            -0.87
     2023-07-02 23:03:00   b_total_act_energy 39100.44
     2023-07-02 23:03:00   b_total_act_ret_energy 0.00
     2023-07-02 23:03:23   b_voltage       237.6
     2023-07-02 23:03:23   c_act_power     215.1
     2023-07-02 23:03:23   c_aprt_power    274.9
     2023-07-02 23:03:23   c_current       1.149
     2023-07-02 23:03:23   c_pf            -0.82
     2023-07-02 23:03:00   c_total_act_energy 21073.66
     2023-07-02 23:03:00   c_total_act_ret_energy 0.00
     2023-07-02 23:03:23   c_voltage       239.0
     2023-07-02 23:03:23   dst             ShellyPro/events
     2023-07-02 23:03:23   id              0
     2023-07-02 23:03:23   method          NotifyStatus
     2023-07-02 23:03:23   params_em_0_a_act_power 5.9
     2023-07-02 23:03:23   params_em_0_a_aprt_power 82.3
     2023-07-02 23:03:23   params_em_0_a_current 0.346
     2023-07-02 23:03:23   params_em_0_a_pf -0.52
     2023-07-02 23:03:23   params_em_0_a_voltage 237.6
     2023-07-02 23:03:23   params_em_0_b_act_power 378.6
     2023-07-02 23:03:23   params_em_0_b_aprt_power 445.5
     2023-07-02 23:03:23   params_em_0_b_current 1.872
     2023-07-02 23:03:23   params_em_0_b_pf -0.87
     2023-07-02 23:03:23   params_em_0_b_voltage 237.6
     2023-07-02 23:03:23   params_em_0_c_act_power 215.1
     2023-07-02 23:03:23   params_em_0_c_aprt_power 274.9
     2023-07-02 23:03:23   params_em_0_c_current 1.149
     2023-07-02 23:03:23   params_em_0_c_pf -0.82
     2023-07-02 23:03:23   params_em_0_c_voltage 239.0
     2023-07-02 23:03:23   params_em_0_id  0
     2023-07-02 23:03:23   params_em_0_total_act_power 599.591
     2023-07-02 23:03:23   params_em_0_total_aprt_power 802.707
     2023-07-02 23:03:23   params_em_0_total_current 3.368
     2023-07-02 23:03:00   params_emdata_0_a_total_act_energy 3053.59
     2023-07-02 23:03:00   params_emdata_0_a_total_act_ret_energy 0.00
     2023-07-02 23:03:00   params_emdata_0_b_total_act_energy 39100.44
     2023-07-02 23:03:00   params_emdata_0_b_total_act_ret_energy 0.00
     2023-07-02 23:03:00   params_emdata_0_c_total_act_energy 21073.66
     2023-07-02 23:03:00   params_emdata_0_c_total_act_ret_energy 0.00
     2023-07-02 23:03:00   params_emdata_0_id 0
     2023-07-02 23:03:00   params_emdata_0_total_act 63227.69
     2023-07-02 23:03:00   params_emdata_0_total_act_ret 0.00
     2023-07-02 23:03:00   params_events_1_component emdata:0
     2023-07-02 23:03:00   params_events_1_data_period 60
     2023-07-02 23:03:00   params_events_1_data_ts 1688331720
     2023-07-02 23:03:00   params_events_1_data_values_1_1 0.1002
     2023-07-02 23:03:00   params_events_1_data_values_1_10 81.3
     2023-07-02 23:03:00   params_events_1_data_values_1_11 237.749
     2023-07-02 23:03:00   params_events_1_data_values_1_12 237.121
     2023-07-02 23:03:00   params_events_1_data_values_1_13 237.464
     2023-07-02 23:03:00   params_events_1_data_values_1_14 0.347
     2023-07-02 23:03:00   params_events_1_data_values_1_15 0.342
     2023-07-02 23:03:00   params_events_1_data_values_1_16 0.345
     2023-07-02 23:03:00   params_events_1_data_values_1_17 6.2836
     2023-07-02 23:03:00   params_events_1_data_values_1_18 6.3008
     2023-07-02 23:03:00   params_events_1_data_values_1_19 0.0000
     2023-07-02 23:03:00   params_events_1_data_values_1_2 0.0988
     2023-07-02 23:03:00   params_events_1_data_values_1_20 0.0000
     2023-07-02 23:03:00   params_events_1_data_values_1_21 0.0000
     2023-07-02 23:03:00   params_events_1_data_values_1_22 2.6393
     2023-07-02 23:03:00   params_events_1_data_values_1_23 386.3
     2023-07-02 23:03:00   params_events_1_data_values_1_24 371.5
     2023-07-02 23:03:00   params_events_1_data_values_1_25 456.6
     2023-07-02 23:03:00   params_events_1_data_values_1_26 439.1
     2023-07-02 23:03:00   params_events_1_data_values_1_27 237.572
     2023-07-02 23:03:00   params_events_1_data_values_1_28 236.670
     2023-07-02 23:03:00   params_events_1_data_values_1_29 237.062
     2023-07-02 23:03:00   params_events_1_data_values_1_3 0.0000
     2023-07-02 23:03:00   params_events_1_data_values_1_30 1.922
     2023-07-02 23:03:00   params_events_1_data_values_1_31 1.850
     2023-07-02 23:03:00   params_events_1_data_values_1_32 1.871
     2023-07-02 23:03:00   params_events_1_data_values_1_33 3.6366
     2023-07-02 23:03:00   params_events_1_data_values_1_34 3.6413
     2023-07-02 23:03:00   params_events_1_data_values_1_35 0.0000
     2023-07-02 23:03:00   params_events_1_data_values_1_36 0.0000
     2023-07-02 23:03:00   params_events_1_data_values_1_37 0.0000
     2023-07-02 23:03:00   params_events_1_data_values_1_38 1.9814
     2023-07-02 23:03:00   params_events_1_data_values_1_39 223.6
     2023-07-02 23:03:00   params_events_1_data_values_1_4 0.0000
     2023-07-02 23:03:00   params_events_1_data_values_1_40 212.1
     2023-07-02 23:03:00   params_events_1_data_values_1_41 282.6
     2023-07-02 23:03:00   params_events_1_data_values_1_42 271.8
     2023-07-02 23:03:00   params_events_1_data_values_1_43 239.363
     2023-07-02 23:03:00   params_events_1_data_values_1_44 238.844
     2023-07-02 23:03:00   params_events_1_data_values_1_45 239.152
     2023-07-02 23:03:00   params_events_1_data_values_1_46 1.180
     2023-07-02 23:03:00   params_events_1_data_values_1_47 1.135
     2023-07-02 23:03:00   params_events_1_data_values_1_48 1.159
     2023-07-02 23:03:00   params_events_1_data_values_1_49 0.029
     2023-07-02 23:03:00   params_events_1_data_values_1_5 0.0000
     2023-07-02 23:03:00   params_events_1_data_values_1_50 0.027
     2023-07-02 23:03:00   params_events_1_data_values_1_51 0.027
     2023-07-02 23:03:00   params_events_1_data_values_1_6 1.3113
     2023-07-02 23:03:00   params_events_1_data_values_1_7 6.5
     2023-07-02 23:03:00   params_events_1_data_values_1_8 5.7
     2023-07-02 23:03:00   params_events_1_data_values_1_9 82.5
     2023-07-02 23:03:00   params_events_1_event data
     2023-07-02 23:03:00   params_events_1_id 0
     2023-07-02 23:03:00   params_events_1_ts 1688331720.00
     2023-07-02 23:03:23   params_ts       1688331801.84
     2023-07-02 23:03:23   src             shellypro3em-0cb815fcbbec
     2023-07-02 23:03:00   total_act       63227.69
     2023-07-02 23:03:23   total_act_power 599.591
     2023-07-02 23:03:00   total_act_ret   0.00
     2023-07-02 23:03:23   total_aprt_power 802.707
     2023-07-02 23:03:23   total_current   3.368
Attributes:
   devStateIcon {my $onl = FW_makeImage(ReadingsVal($name,'online','false') eq 'true'?'10px-kreis-gruen':'10px-kreis-rot'); my $light = FW_makeImage(ReadingsVal($name,'state','off')); my $cons1 = ReadingsVal($name,'emeter_0_power',0); my $cons2 = ReadingsVal($name,'emeter_1_power',0); my $cons3 = ReadingsVal($name,'emeter_2_power',0); my $total1 = ReadingsVal($name,'emeter_0_kWh',0); my $total2 = ReadingsVal($name,'emeter_1_kWh',0); my $total3 = ReadingsVal($name,'emeter_2_kWh',0); my $total_sum = $total1+$total2+$total3; my $total_w =$cons1+$cons2+$cons3; my $ip = ReadingsVal($name,'ip','unknown'); qq(<a href="http://$ip"target="_blank">$onl</a> <a href="/fhem?cmd.dummy=set $name toggle&XHR=1">$light</a><div>P1: $cons1 W / Total P1: $total1 kWh<br>P2: $cons2 W / Total P2: $total2 kWh<br>P3: $cons3 W / Total P3: $total3 kWh<br>3 Phases total: $total_w W / $total_sum kWh</div>)}
   model      shelly3em
   readingList shellies/ShellyPro3EM/online:.* online
  shellies/ShellyPro3EM/announce:.* { json2nameValue($EVENT) }
  shellies/announce:.* { $EVENT =~ m,..id...ShellyPro3EM...mac.*, ? json2nameValue($EVENT) : return }
  shellies/ShellyPro3EM/relay/0:.* state
  shellies/ShellyPro3EM/input_event/0:.* { json2nameValue($EVENT) }
  shellies/ShellyPro3EM/input/0:.* input0
  shellies/ShellyPro3EM/online:.* online
  shellies/ShellyPro3EM/emeter/0/power:.* emeter_0_power
  shellies/ShellyPro3EM/emeter/0/pf:.* emeter_0_pf
  shellies/ShellyPro3EM/emeter/0/current:.* emeter_0_current
  shellies/ShellyPro3EM/emeter/0/voltage:.* emeter_0_voltage
  shellies/ShellyPro3EM/emeter/1/power:.* emeter_1_power
  shellies/ShellyPro3EM/emeter/1/pf:.* emeter_1_pf
  shellies/ShellyPro3EM/emeter/1/current:.* emeter_1_current
  shellies/ShellyPro3EM/emeter/1/voltage:.* emeter_1_voltage
  shellies/ShellyPro3EM/emeter/2/power:.* emeter_2_power
  shellies/ShellyPro3EM/emeter/2/pf:.* emeter_2_pf
  shellies/ShellyPro3EM/emeter/2/current:.* emeter_2_current
  shellies/ShellyPro3EM/emeter/2/voltage:.* emeter_2_voltage
  shellies/ShellyPro3EM/emeter/0/energy:.* emeter_0_energy
  shellies/ShellyPro3EM/emeter/0/returned_energy:.* emeter_0_returned_energy
  shellies/ShellyPro3EM/emeter/0/total:.* emeter_0_total
  shellies/ShellyPro3EM/emeter/0/total:.* {'emeter_0_kWh' => sprintf("%.2f",$EVENT/1000)}
  shellies/ShellyPro3EM/emeter/0/total_returned:.* emeter_0_total_returned
  shellies/ShellyPro3EM/emeter/1/energy:.* emeter_1_energy
  shellies/ShellyPro3EM/emeter/1/returned_energy:.* emeter_1_returned_energy
  shellies/ShellyPro3EM/emeter/1/total:.* emeter_1_total
  shellies/ShellyPro3EM/emeter/1/total:.* {'emeter_1_kWh' => sprintf("%.2f",$EVENT/1000)}
  shellies/ShellyPro3EM/emeter/1/total_returned:.* emeter_1_total_returned
  shellies/ShellyPro3EM/emeter/2/energy:.* emeter_2_energy
  shellies/ShellyPro3EM/emeter/2/returned_energy:.* emeter_2_returned_energy
  shellies/ShellyPro3EM/emeter/2/total:.* emeter_2_total
  shellies/ShellyPro3EM/emeter/2/total:.* {'emeter_2_kWh' => sprintf("%.2f",$EVENT/1000)}
  shellies/ShellyPro3EM/emeter/2/total_returned:.* emeter_2_total_returned
ShellyPro:ShellyPro/events/rpc:.* { json2nameValue($EVENT) }
ShellyPro:ShellyPro/status/em_0:.* { json2nameValue($EVENT) }
ShellyPro:ShellyPro/status/emdata_0:.* { json2nameValue($EVENT) }
   room       MQTT2_DEVICE
   stateFormat { my $light = ReadingsVal($name,'state','off'); my $cons1 = ReadingsVal($name,'emeter_0_power',0); my $cons2 = ReadingsVal($name,'emeter_1_power',0); my $cons3 = ReadingsVal($name,'emeter_2_power',0); my $total1 = ReadingsVal($name,'emeter_0_kWh',0); my $total2 = ReadingsVal($name,'emeter_1_kWh',0); my $total3 = ReadingsVal($name,'emeter_2_kWh',0); return qq(Relay: $light,<br>P1: $cons1 W / Total P1: $total1 kWh<br>P2: $cons2 W / Total P2: $total2 kWh<br>P3: $cons3 W / Total P3: $total3 kWh) }
   userReadings emeter_0_energy_total:emeter_0_energy:.* monotonic {ReadingsNum("$name","emeter_0_energy",0)}, emeter_1_energy_total:emeter_1_energy:.* monotonic {ReadingsNum("$name","emeter_1_energy",0)}, emeter_2_energy_total:emeter_2_energy:.* monotonic {ReadingsNum("$name","emeter_2_energy",0)}

Beta-User

jsonMap und die 3-Argument-Variante von json2nameValue() in readingList wären der Ansatz.

Solche Umbenennungen führen u.U. dazu, dass nicht alle attrTemplate angezeigt werden...
Server: HP-T620@Debian 11, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

Motivierte linke Hände

#941
@Beta-User: Ein Template für den 3empro gibt es aber nicht, oder?

@Alcamar: Mein Prefix ist "shellies/Shelly-WPumpe". Damit habe ich den Präfix bei den Readings nicht. "/shellies" für Shellies als Präfix beizubehalten, hilft. Mit den übrigen Readingnamen kann man dann m.E. leben.
FHEM 6 in einer KVM VM mit Ubuntu
HM-CFG-USB2, 2xHM-CFG-HMLAN, HM-HMUARTLGW mit 100+ HomeMatic Devices, Geofencing, Fritzbox, Unifi, HUE, Harmony-Hub, Denon-Receiver-Modul, Calendar, GardenaSmartDevice, Shelly, MQTT (zigbee2mqtt, Tasmota und Shelly) und ein wenig 1Wire.

Beta-User

Zitat von: Motivierte linke Hände am 03 Juli 2023, 07:37:16@Beta-User: Ein Template für den 3empro gibt es aber nicht, oder?
Hab's nicht geprüft, kann schon sein, dass es (noch?) keines gibt.
Jedenfalls ist es (meistens) kontraproduktiv, die topic-defaults zu ändern....
Server: HP-T620@Debian 11, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

Alcamar

ich komme auch mit jsonMap und json2nameValue nicht klar, auch wenn ich versuche die "Doku" zu verstehen.

Zitatattr m2d jsonMap SENSOR_AM2301_Humidity:Humidity
attr m2d readingList tele/sonoff/SENSOR:.* { json2nameValue($EVENT, 'SENSOR_', $JSONMAP) }

Wenn ich die unzähligen Readings auf die wesentlichen reduzieren und dann auch noch loggen könnte, wäre ich für meine Begriffe durch.
Als Neuling in diesem Thema ist es nicht so einfach die ganzen Beiträge hier für sich zu sortieren.

Den Shelly Pro 3em in die Stromverteilung zu montieren und dafür zu sorgen, dass es Daten an fhem sendet, war eine einfache Übung.
Jetzt wo die Daten dort allerdings einprasseln, sehe ich nicht, wie ich sie verarbeiten kann. die attrTemplate hat mir nicht geholfen.

Gibt es eine grundsätzliche Dokumentationsquelle, die man zielführend heranziehen kann?




Motivierte linke Hände

Ändere den MQTT-Prefix im Shelly (nicht in fhem) auf den Standard zurück, alternativ auf "shellies/irgendwas". Damit solltest Du den Präfix "params" bei den Readings loswerden. Mit dem Rest kann man m.E. im Standard gut leben, ohne dass es dann (in dem vmtl. danach dann neu angelegten Gerät in fhem) weiterer Änderungen bedarf. Du kannst für a, b und c die Messwerte erkennen und auslesen.

Wenn Du die Messwerte noch einfacher lesbar haben möchtest, kannst Du diese in den Status des Geräts schreiben. Bei mir sieht das so aus:

attr EM_WPumpe stateFormat { my $cons1 = ReadingsVal($name,'em_0_a_act_power',0); my $cons2 = ReadingsVal($name,'em_0_b_act_power',0); my $cons3 = ReadingsVal($name,'em_0_c_act_power',0); my $total1 = round(ReadingsNum($name,'emdata_0_a_total_act_energy',0)/1000,1); my $total2 = round(ReadingsNum($name,'emdata_0_b_total_act_energy',0)/1000,1); my $total3 = round(ReadingsNum($name,'emdata_0_c_total_act_energy',0)/1000,1); my $gesamtP = round(ReadingsNum($name, 'em_0_total_act_power',0),0); my $gesamtE = round(ReadingsNum($name, 'emdata_0_total_act',0)/1000,1);return qq(Frischwasser: $cons1 W / Total: $total1 kWh<br>Außeneinheit: $cons2 W / Total: $total2 kWh<br>Zentrale: $cons3 W / Total P3: $total3 kWh<br>Gesamt: $gesamtP W, $gesamtE kWh) }
(Ggf. möchtest Du dann die Bezeichnungen "Frischwasser", "Außeneinheit" und "Zentrale" gegen was anderes austauschen. Das stammt halt von der Nutzung hier für eine Wärmepumpe...
FHEM 6 in einer KVM VM mit Ubuntu
HM-CFG-USB2, 2xHM-CFG-HMLAN, HM-HMUARTLGW mit 100+ HomeMatic Devices, Geofencing, Fritzbox, Unifi, HUE, Harmony-Hub, Denon-Receiver-Modul, Calendar, GardenaSmartDevice, Shelly, MQTT (zigbee2mqtt, Tasmota und Shelly) und ein wenig 1Wire.