Also, das Anlegen hat funktioniert!
Das Teil lässt sich schalten, das Lampensymbol springt auf "set_toggle" und bleibt da.
Das Reading "ip" (kann ich von Hand anlegen) fehlt.
Die Temperatur wird mit -100 angezeigt.
Es wird keine Leistung angezeigt
Firmware version: 0.11.1
Raw Def:
defmod MQTT2_shellyplus1pm_441793cf2c04 MQTT2_DEVICE shellyplus1pm_441793cf2c04
attr MQTT2_shellyplus1pm_441793cf2c04 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_shellyplus1pm_441793cf2c04 devicetopic shellyplus1pm-441793cf2c04
attr MQTT2_shellyplus1pm_441793cf2c04 getList in_mode:noArg in_mode $DEVICETOPIC/rpc {"id": 1,"src":"$DEVICETOPIC", "method": "Switch.GetConfig", "params": {"id": 0}}
attr MQTT2_shellyplus1pm_441793cf2c04 icon message_socket
attr MQTT2_shellyplus1pm_441793cf2c04 jsonMap switch_state:state switch_aenergy_total:aenergy_total switch_apower:apower switch_temperature_tC:temperature switch_temperature_tF:0 params_wifi_sta_ip:ip params_switch_0_temperature_tC:temperature params_switch_0_temperature_tF:0 result_in_mode:in_mode
attr MQTT2_shellyplus1pm_441793cf2c04 model shellyPlus_1pm
attr MQTT2_shellyplus1pm_441793cf2c04 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:.* {}
attr MQTT2_shellyplus1pm_441793cf2c04 room MQTT2_DEVICE
attr MQTT2_shellyplus1pm_441793cf2c04 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_shellyplus1pm_441793cf2c04 setStateList on off toggle on-for-timer off-for-timer
attr MQTT2_shellyplus1pm_441793cf2c04 webCmd :
setstate MQTT2_shellyplus1pm_441793cf2c04 set_toggle
setstate MQTT2_shellyplus1pm_441793cf2c04 2022-09-10 20:18:00 IODev MyMQTT
setstate MQTT2_shellyplus1pm_441793cf2c04 2022-09-10 20:18:21 attrTemplateVersion 20220303
setstate MQTT2_shellyplus1pm_441793cf2c04 2022-09-10 20:19:59 dst shellyplus1pm-441793cf2c04/events
setstate MQTT2_shellyplus1pm_441793cf2c04 2022-09-10 20:19:59 method NotifyStatus
setstate MQTT2_shellyplus1pm_441793cf2c04 2022-09-10 20:18:26 online true
setstate MQTT2_shellyplus1pm_441793cf2c04 2022-09-10 20:18:26 params_mqtt_connected true
setstate MQTT2_shellyplus1pm_441793cf2c04 2022-09-10 20:19:59 params_switch_0_aenergy_by_minute_1 170.674
setstate MQTT2_shellyplus1pm_441793cf2c04 2022-09-10 20:19:59 params_switch_0_aenergy_by_minute_2 157.279
setstate MQTT2_shellyplus1pm_441793cf2c04 2022-09-10 20:19:59 params_switch_0_aenergy_by_minute_3 172.163
setstate MQTT2_shellyplus1pm_441793cf2c04 2022-09-10 20:19:59 params_switch_0_aenergy_minute_ts 1662833998
setstate MQTT2_shellyplus1pm_441793cf2c04 2022-09-10 20:19:59 params_switch_0_aenergy_total 1.443
setstate MQTT2_shellyplus1pm_441793cf2c04 2022-09-10 20:18:42 params_switch_0_apower 10.2
setstate MQTT2_shellyplus1pm_441793cf2c04 2022-09-10 20:18:44 params_switch_0_current 0.128
setstate MQTT2_shellyplus1pm_441793cf2c04 2022-09-10 20:19:59 params_switch_0_id 0
setstate MQTT2_shellyplus1pm_441793cf2c04 2022-09-10 20:18:33 params_switch_0_output true
setstate MQTT2_shellyplus1pm_441793cf2c04 2022-09-10 20:18:33 params_switch_0_source MQTT
setstate MQTT2_shellyplus1pm_441793cf2c04 2022-09-10 20:18:26 params_switch_0_voltage 233.4
setstate MQTT2_shellyplus1pm_441793cf2c04 2022-09-10 20:19:59 params_ts 1662834000.36
setstate MQTT2_shellyplus1pm_441793cf2c04 2022-09-10 20:19:59 src shellyplus1pm-441793cf2c04
setstate MQTT2_shellyplus1pm_441793cf2c04 2022-09-10 20:18:33 state set_toggle
setstate MQTT2_shellyplus1pm_441793cf2c04 2022-09-10 20:18:21 x_reboot set
Hier noch ein List vom Device. Die Readings für Spannung, Leistung, Temperatur sind korrekt.
Internals:
CID shellyplus1pm_441793cf2c04
DEF shellyplus1pm_441793cf2c04
FUUID 631cd4d8-f33f-27cb-2857-1a71114d76fff0ea
IODev MyMQTT
LASTInputDev MyMQTT
MSGCNT 40
MyMQTT_CONN MyMQTT_192.168.178.110_51637
MyMQTT_MSGCNT 40
MyMQTT_TIME 2022-09-10 20:48:59
NAME az_Schalter_Funk
NR 1126
STATE set_toggle
TYPE MQTT2_DEVICE
eventCount 40
JSONMAP:
params_switch_0_temperature_tC temperature
params_switch_0_temperature_tF 0
params_wifi_sta_ip ip
result_in_mode in_mode
switch_aenergy_total aenergy_total
switch_apower apower
switch_state state
switch_temperature_tC temperature
switch_temperature_tF 0
READINGS:
2022-09-10 20:42:06 IODev MyMQTT
2022-09-10 20:35:17 attrTemplateVersion 20220303
2022-09-10 20:48:59 dst shellyplus1pm-441793cf2c04/events
2022-09-10 20:48:59 method NotifyStatus
2022-09-10 20:42:20 online true
2022-09-10 20:39:59 params_events_1_cfg_rev 9
2022-09-10 20:39:59 params_events_1_component sys
2022-09-10 20:39:59 params_events_1_event config_changed
2022-09-10 20:39:59 params_events_1_restart_required true
2022-09-10 20:39:59 params_events_1_ts 1662835200.18
2022-09-10 20:42:20 params_mqtt_connected true
2022-09-10 20:48:59 params_switch_0_aenergy_by_minute_1 163.232
2022-09-10 20:48:59 params_switch_0_aenergy_by_minute_2 162.240
2022-09-10 20:48:59 params_switch_0_aenergy_by_minute_3 163.232
2022-09-10 20:48:59 params_switch_0_aenergy_minute_ts 1662835739
2022-09-10 20:48:59 params_switch_0_aenergy_total 5.750
2022-09-10 20:44:39 params_switch_0_apower 9.9
2022-09-10 20:44:41 params_switch_0_current 0.127
2022-09-10 20:48:59 params_switch_0_id 0
2022-09-10 20:44:31 params_switch_0_output true
2022-09-10 20:44:31 params_switch_0_source MQTT
2022-09-10 20:41:05 params_switch_0_voltage 233.9
2022-09-10 20:39:59 params_sys_cfg_rev 9
2022-09-10 20:39:59 params_sys_restart_required true
2022-09-10 20:48:59 params_ts 1662835741.52
2022-09-10 20:48:59 src shellyplus1pm-441793cf2c04
2022-09-10 20:44:31 state set_toggle
2022-09-10 20:39:51 temperature 41.84
2022-09-10 20:35:17 x_reboot set
Attributes:
alias Steckdosen (Funkgeräte)
devStateIcon {my $onl = ReadingsVal($name,'online','false') eq 'false'?'10px-kreis-rot':'10px-kreis-gruen'; $onl = FW_makeImage($onl); my $light = FW_makeImage(ReadingsVal($name,'state','off')); my $cons = ReadingsNum($name,'apower',0); my $total = round(ReadingsNum($name,'aenergy_total',0)/1000,3); my $temp = ReadingsVal($name,'temperature','-100'); my $ip = ReadingsVal($name,'ip','none'); my $reb = ReadingsVal($name,'sys_restart_required','false') eq 'true'?'<a href="/fhem?cmd.dummy=set '.$name.' x_reboot&XHR=1"> ... Notwendigen Reboot durchführen</a>':''; qq(<a href="http://$ip" target="_blank">${onl}</a><a href="/fhem?cmd.dummy=set $name toggle&XHR=1">${light}</a>$reb<div>Verbrauch: $cons W / Total: $total kwh / Temp: $temp °C</div>)}
devicetopic shellyplus1pm-441793cf2c04
getList in_mode:noArg in_mode $DEVICETOPIC/rpc {"id": 1,"src":"$DEVICETOPIC", "method": "Switch.GetConfig", "params": {"id": 0}}
icon message_socket
jsonMap switch_state:state switch_aenergy_total:aenergy_total switch_apower:apower switch_temperature_tC:temperature switch_temperature_tF:0 params_wifi_sta_ip:ip params_switch_0_temperature_tC:temperature params_switch_0_temperature_tF:0 result_in_mode:in_mode
model shellyPlus_1pm
readingList $DEVICETOPIC/online:.* online
$DEVICETOPIC/events/rpc:.* { json2nameValue($EVENT,'',$JSONMAP) }
$DEVICETOPIC/status/mqtt:.* { json2nameValue($EVENT, 'mqtt_', $JSONMAP) }
$DEVICETOPIC/status/sys:.* { json2nameValue($EVENT, 'sys_', $JSONMAP) }
$DEVICETOPIC/status/switch_0:.* { $EVENT =~ s/"output":true/"state":"on"/g; $EVENT =~ s/"output":false/"state":"off"/g; json2nameValue($EVENT, 'switch_', $JSONMAP) }
$DEVICETOPIC/status/cloud:.* {}
$DEVICETOPIC/rpc:.* { json2nameValue($EVENT, 'req_', $JSONMAP, 'in_mode')}
$DEVICETOPIC/status/input_0:.* { json2nameValue($EVENT, 'input_', $JSONMAP) }
fhem2shelly/rpc:.* {}
room Büro,MQTT2_DEVICE
setList toggle:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Toggle","params": {"id":0}}
off:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Set","params": {"id":0,"on":false}}
on:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Set","params": {"id":0,"on":true}}
on-for-timer $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Set","params": {"id":0,"on":true,"toggle_after":$EVTPART1}}
off-for-timer $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Set","params": {"id":0,"on":false,"toggle_after":$EVTPART1}}
in_mode:toggle,flip,detached {fhem("sleep 0.2; get $NAME in_mode"); my $val = $EVTPART1 ne 'toggle' ? $EVTPART1 : ReadingsVal($NAME,'in_mode','flip') eq 'flip' ? 'detached':'flip'; qq($DEVICETOPIC/rpc {"id":1,"src":"fhem2shelly","method":"Switch.SetConfig","params": {"id":0, "config": {"in_mode": "$val"}}})}
x_update:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Shelly.Update","params": {"stage":"stable"}}
x_reboot:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Shelly.Reboot"}
x_eco:true,false $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Sys.SetConfig","params": {"config": {"device": {"eco_mode": $EVTPART1}}}}
setStateList on off toggle on-for-timer off-for-timer
webCmd :