also readingList und getList habe ich umgebaut auf $DEVICETOPIC ... wenn ich den get manuel ausführe - klappt das auch
was nicht geht, ist der get call beim toggle bzw. flip|detached (was am ende ja das gleiche ist) - also der set wird wohl ausgeführt, aber der get nicht, kommt auch in m_sub nix was darauf hindeuten würde, dass der get ausgeführt wurde)
hier nochmal der in_mode teil der setList
in_mode:toggle,flip,detached {fhem("sleep 0.2;; get $NAME in_mode"); my $val = $EVTPART1 ne 'toggle' ? $EVTPART1 : ReadingsVal($NAME,'in_mode','flip') ne 'flip' ? 'flip':'detached'; qq($DEVICETOPIC/rpc {"id":1,"src":"fhem2shelly","method":"Switch.SetConfig","params": {"id":0, "config": {"in_mode": "$val"}}})}
MaaAAHHNN
übertreibs doch nicht mit deinen "fehlerchen" einbauen

... nachdem ich den 2. ; hinter sleep 0.2 entfernt habe, wird get getriggert ...

aber (natürlich?!) bekommt fhem es nicht mit, wenn ich im shelly direkt den in_mode ändere
axo, das userReadings habe ich natürlich rausgeworfen!
hier ein raw dieser version: (und JA, da ist mein devStateIcon ... halt einfach ignorieren

, aber um dieses gehts ja aktuell nicht^^)
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,'in_mode','flip') eq '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 in_mode toggle&XHR=1">${lock}</a>)}
attr MQTT2_shellyplus1_441793a3b110 devStateStyle style="text-align:right;;;;"
attr MQTT2_shellyplus1_441793a3b110 devicetopic shellyplus1-441793a3b110
attr MQTT2_shellyplus1_441793a3b110 getList in_mode:noArg in_mode $DEVICETOPIC/rpc {"id": 1,"src":"$DEVICETOPIC", "method": "Switch.GetConfig", "params": {"id": 0}}
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 params_switch_0_temperature_tC:temperature params_switch_0_temperature_tF:0 req_result_in_mode:in_mode
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:.* { json2nameValue($EVENT, 'req_', $JSONMAP, 'in_mode') }\
fhem2shelly/rpc:.* {}\
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}}\
in_mode:toggle,flip,detached {fhem("sleep 0.2;; get $NAME in_mode");; my $val = $EVTPART1 ne 'toggle' ? $EVTPART1 : ReadingsVal($NAME,'in_mode','flip') ne 'flip' ? 'flip':'detached';; 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_shellyplus1_441793a3b110 setStateList on off toggle on-for-timer off-for-timer
attr MQTT2_shellyplus1_441793a3b110 webCmd :
den setState part am ende habe ich mal weg gelassen ...
BUG: ist mir gerade aufgefallen:
wenn ich im detached mode bin, und am echten Schalter welcher am Shelly ist, schalte, passiert der lampe nichts, wohl aber ändert sich "state" auf "true" und damit spring die das devStateIcon auf "AN" (weil der state nicht mehr off ist) und bleibt solange, bis ich über FHEM ein / ausschalte ... hier wird also irgendein reading "falsch" an state weiter geleitet
dieses event erhalte ich in m_sub (EIN und AUS schalten)
shellyplus1-441793a3b110/events/rpc {"src":"shellyplus1-441793a3b110","dst":"shellyplus1-441793a3b110/events","method":"NotifyStatus","params":{"ts":1646396730.00,"input:0":{"id":0,"state":true}}}
shellyplus1-441793a3b110/status/input:0 {"id":0,"state":true}
shellyplus1-441793a3b110/events/rpc {"src":"shellyplus1-441793a3b110","dst":"shellyplus1-441793a3b110/events","method":"NotifyStatus","params":{"ts":1646396735.85,"input:0":{"id":0,"state":false}}}
shellyplus1-441793a3b110/status/input:0 {"id":0,"state":false}
denke, das ist bis her nicht aufgefallen, da im "normal" mode ja beim betätigen des schalters, auch irgendwas am Licht passiert und es vermutlich dann sofort wieder überschrieben wird durch den status der lampe ...