moin,
habe zumindest das SET hin bekommen und aufs reading des aktuell tatsächlichen "in_mode" verzichtet.
ergänzung in setList
Code
x_in_mode:flip,detached $DEVICETOPIC/rpc {"id":1,"src":"fhem2shelly","method":"Switch.SetConfig","params": {"id":0, "config": {"in_mode": "$EVTPART1"}}}
modeToggle:noArg {if (ReadingsVal("MQTT2_shellyplus1_441793a3b110", 'x_in_mode', 'set flip' ) eq 'set flip' ) {fhem("set MQTT2_shellyplus1_441793a3b110 x_in_mode detached")}else{fhem("set MQTT2_shellyplus1_441793a3b110 x_in_mode flip")}}
der sicher nicht ganz elegante toggle ist fürs devStateIcon.
anbei noch das full raw:
Code
defmod MQTT2_shellyplus1_441793a3b110 MQTT2_DEVICE shellyplus1_441793a3b110
attr MQTT2_shellyplus1_441793a3b110 alias Jens Ceilinglight
attr MQTT2_shellyplus1_441793a3b110 devStateIcon {my $onl = ReadingsVal($name,'online','false') eq 'false'?'10px-kreis-rot':'10px-kreis-gruen';; $onl = FW_makeImage($onl);; \
my $light = ReadingsVal($name,'state','off') eq 'off'?'light_ceiling_off':'light_ceiling@yellow';; $light = FW_makeImage($light);; \
my $lock = ReadingsVal($name,'x_in_mode','set flip') eq 'set flip'?'secur_open@green':'secur_locked@red';; $lock = FW_makeImage($lock);;\
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>\
<a href="/fhem?cmd.dummy=set $name modeToggle&XHR=1">${lock}</a>)}\
attr MQTT2_shellyplus1_441793a3b110 devStateStyle style="text-align:right;;;;"
attr MQTT2_shellyplus1_441793a3b110 devicetopic shellyplus1-441793a3b110
attr MQTT2_shellyplus1_441793a3b110 icon light_ceiling_light@green
attr MQTT2_shellyplus1_441793a3b110 jsonMap switch_state:state switch_temperature_tC:temperature switch_temperature_tF:0 params_wifi_sta_ip:ip
attr MQTT2_shellyplus1_441793a3b110 model shellyPlus_1
attr MQTT2_shellyplus1_441793a3b110 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:.* {}\
fhem2shelly/rpc:.* {}\
shellyplus1_441793a3b110:shellyplus1-441793a3b110/status/input_0:.* { json2nameValue($EVENT) }\
shellyplus1_441793a3b110:shellyplus1-441793a3b110/status/script_1:.* { json2nameValue($EVENT) }
attr MQTT2_shellyplus1_441793a3b110 room Favs,Jens,MQTT2_DEVICE
attr MQTT2_shellyplus1_441793a3b110 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}}\
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}}}}\
x_in_mode:flip,detached $DEVICETOPIC/rpc {"id":1,"src":"fhem2shelly","method":"Switch.SetConfig","params": {"id":0, "config": {"in_mode": "$EVTPART1"}}}\
modeToggle:noArg {if (ReadingsVal("MQTT2_shellyplus1_441793a3b110", 'x_in_mode', 'set flip' ) eq 'set flip' ) {fhem("set MQTT2_shellyplus1_441793a3b110 x_in_mode detached")}else{fhem("set MQTT2_shellyplus1_441793a3b110 x_in_mode flip")}}
attr MQTT2_shellyplus1_441793a3b110 setStateList on off toggle on-for-timer off-for-timer
attr MQTT2_shellyplus1_441793a3b110 webCmd :
setstate MQTT2_shellyplus1_441793a3b110 off
setstate MQTT2_shellyplus1_441793a3b110 2022-03-02 10:12:16 IODev m2s
setstate MQTT2_shellyplus1_441793a3b110 2022-03-02 10:13:02 attrTemplateVersion 20220118
setstate MQTT2_shellyplus1_441793a3b110 2022-03-03 07:49:31 dst shellyplus1-441793a3b110/events
setstate MQTT2_shellyplus1_441793a3b110 2022-03-02 15:22:16 id 0
setstate MQTT2_shellyplus1_441793a3b110 2022-03-03 00:02:01 in_mode set detached
setstate MQTT2_shellyplus1_441793a3b110 2022-03-02 23:55:20 ip 192.168.177.47
setstate MQTT2_shellyplus1_441793a3b110 2022-03-03 07:49:31 method NotifyEvent
setstate MQTT2_shellyplus1_441793a3b110 2022-03-03 02:25:23 modeToggle set
setstate MQTT2_shellyplus1_441793a3b110 2022-03-02 23:55:19 mqtt_connected true
setstate MQTT2_shellyplus1_441793a3b110 2022-03-02 23:55:19 online true
setstate MQTT2_shellyplus1_441793a3b110 2022-03-03 07:49:31 params_events_1_cfg_rev 73
setstate MQTT2_shellyplus1_441793a3b110 2022-03-03 07:49:31 params_events_1_component switch:0
setstate MQTT2_shellyplus1_441793a3b110 2022-03-03 07:49:31 params_events_1_event config_changed
setstate MQTT2_shellyplus1_441793a3b110 2022-03-03 07:49:31 params_events_1_id 0
setstate MQTT2_shellyplus1_441793a3b110 2022-03-03 07:49:31 params_events_1_restart_required false
setstate MQTT2_shellyplus1_441793a3b110 2022-03-03 07:49:31 params_events_1_ts 1646290171.94
setstate MQTT2_shellyplus1_441793a3b110 2022-03-02 15:22:16 params_input_0_id 0
setstate MQTT2_shellyplus1_441793a3b110 2022-03-02 15:22:16 params_input_0_state false
setstate MQTT2_shellyplus1_441793a3b110 2022-03-02 23:55:20 params_mqtt_connected true
setstate MQTT2_shellyplus1_441793a3b110 2022-03-02 11:30:44 params_script_1_id 1
setstate MQTT2_shellyplus1_441793a3b110 2022-03-02 11:30:44 params_script_1_running false
setstate MQTT2_shellyplus1_441793a3b110 2022-03-03 07:48:46 params_switch_0_id 0
setstate MQTT2_shellyplus1_441793a3b110 2022-03-03 07:48:46 params_switch_0_output false
setstate MQTT2_shellyplus1_441793a3b110 2022-03-03 07:48:46 params_switch_0_source MQTT
setstate MQTT2_shellyplus1_441793a3b110 2022-03-02 23:55:20 params_switch_0_temperature_tC 47.57
setstate MQTT2_shellyplus1_441793a3b110 2022-03-02 23:55:20 params_switch_0_temperature_tF 117.63
setstate MQTT2_shellyplus1_441793a3b110 2022-03-02 23:55:29 params_sys_available_updates_beta_version 0.10.0-beta6
setstate MQTT2_shellyplus1_441793a3b110 2022-03-02 23:40:09 params_sys_restart_required true
setstate MQTT2_shellyplus1_441793a3b110 2022-03-03 07:49:31 params_ts 1646290171.94
setstate MQTT2_shellyplus1_441793a3b110 2022-03-02 23:55:20 params_wifi_rssi -51
setstate MQTT2_shellyplus1_441793a3b110 2022-03-02 23:55:20 params_wifi_ssid WLAN-Alex
setstate MQTT2_shellyplus1_441793a3b110 2022-03-02 23:55:20 params_wifi_status got ip
setstate MQTT2_shellyplus1_441793a3b110 2022-03-02 11:30:53 running false
setstate MQTT2_shellyplus1_441793a3b110 2022-03-03 07:49:31 src shellyplus1-441793a3b110
setstate MQTT2_shellyplus1_441793a3b110 2022-03-03 07:48:46 state off
setstate MQTT2_shellyplus1_441793a3b110 2022-03-03 07:48:46 switch_id 0
setstate MQTT2_shellyplus1_441793a3b110 2022-03-03 07:48:46 switch_source MQTT
setstate MQTT2_shellyplus1_441793a3b110 2022-03-02 23:55:29 sys_available_updates_beta_version 0.10.0-beta6
setstate MQTT2_shellyplus1_441793a3b110 2022-03-02 23:55:29 sys_cfg_rev 44
setstate MQTT2_shellyplus1_441793a3b110 2022-03-02 23:55:29 sys_fs_free 237568
setstate MQTT2_shellyplus1_441793a3b110 2022-03-02 23:55:29 sys_fs_size 458752
setstate MQTT2_shellyplus1_441793a3b110 2022-03-02 23:55:29 sys_mac 441793A3B110
setstate MQTT2_shellyplus1_441793a3b110 2022-03-02 23:55:29 sys_ram_free 179708
setstate MQTT2_shellyplus1_441793a3b110 2022-03-02 23:55:29 sys_ram_size 249448
setstate MQTT2_shellyplus1_441793a3b110 2022-03-02 23:55:29 sys_restart_required false
setstate MQTT2_shellyplus1_441793a3b110 2022-03-02 23:55:29 sys_time 23:55
setstate MQTT2_shellyplus1_441793a3b110 2022-03-02 23:55:29 sys_unixtime 1646261730
setstate MQTT2_shellyplus1_441793a3b110 2022-03-02 23:55:29 sys_uptime 11
setstate MQTT2_shellyplus1_441793a3b110 2022-03-03 07:48:46 temperature 48.0
setstate MQTT2_shellyplus1_441793a3b110 2022-03-02 23:21:39 x_eco set false
setstate MQTT2_shellyplus1_441793a3b110 2022-03-03 07:49:31 x_in_mode set flip
setstate MQTT2_shellyplus1_441793a3b110 2022-03-02 23:55:16 x_reboot set
Alles anzeigen
lg
Jens