Zitat von: rudolfkoenig am 22 Mai 2024, 11:06:10Habe f18.js erweitert, siehe Anhang.
defmod MQTT2_Licht_K150 MQTT2_DEVICE Licht_K150
attr MQTT2_Licht_K150 userattr devicetopic
attr MQTT2_Licht_K150 0_IoT_com_type MQTT
attr MQTT2_Licht_K150 0_IoT_device_type Shelly_MINI_1PM
attr MQTT2_Licht_K150 alias Beleuchtung
attr MQTT2_Licht_K150 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') eq "on"?'li_wht_on':'li_wht_off');;\
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"></a>)}
attr MQTT2_Licht_K150 devicetopic ML20-WK
attr MQTT2_Licht_K150 event-min-interval .*:60
attr MQTT2_Licht_K150 event-on-change-reading switch_0_output,switch_0_a.*,online,temperature,wifi_rssi
attr MQTT2_Licht_K150 group KG.Waschküche
attr MQTT2_Licht_K150 icon light_ceiling
attr MQTT2_Licht_K150 jsonMap switch_state:state params_switch_0_aenergy_total:aenergy_total switch_apower:apower switch_temperature_tC:temperature switch_temperature_tF:0 params_wifi_sta_ip:ip
attr MQTT2_Licht_K150 loxone nein
attr MQTT2_Licht_K150 model shellyPlus_1pm
attr MQTT2_Licht_K150 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) }\
fhem2shelly/rpc:.* {}\
Licht_K150:ML20-WK/events/rpc:.* { json2nameValue($EVENT, 'rpc_', $JSONMAP) }\
Licht_K150:ML20-WK/status/switch_0:.* { json2nameValue($EVENT, 'switch_0_', $JSONMAP) }\
Licht_K150:ML20-WK/online:.* online\
Licht_K150:ML20-WK/status/ble:.* ble\
Licht_K150:ML20-WK/status/cloud:.* { json2nameValue($EVENT, 'cloud_', $JSONMAP) }\
Licht_K150:ML20-WK/status/input_0:.* { json2nameValue($EVENT, 'input_0_', $JSONMAP) }\
Licht_K150:ML20-WK/status/mqtt:.* { json2nameValue($EVENT, 'mqtt_', $JSONMAP) }\
Licht_K150:ML20-WK/status/sys:.* { json2nameValue($EVENT, 'sys_', $JSONMAP) }\
Licht_K150:ML20-WK/status/wifi:.* { json2nameValue($EVENT, 'wifi_', $JSONMAP) }\
Licht_K150:ML20-WK/status/ws:.* { json2nameValue($EVENT, 'ws_', $JSONMAP) }
attr MQTT2_Licht_K150 room Kellergeschoß,MQTT2_DEVICE
attr MQTT2_Licht_K150 setList toggle:iconSwitch,on,li_wht_off,off,li_wht_on $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}}\
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_Licht_K150 setStateList on off toggle
attr MQTT2_Licht_K150 userReadings 0_FHEM_NAME {InternalVal("$name","NAME","")},\
SubName {"Deckenlampe"},\
0_Wifi_RSSI {100+ReadingsNum("$name","info_wifi_sta_rssi",0)},\
0_Wifi_IP {ReadingsVal("$name","wifi_sta_ip","")},\
0_WifI_MAC {ReadingsVal("$name","sys_mac","")},\
0_Device_ONLINE {ReadingsVal("$name","online","")},\
0_Device_ID {ReadingsVal("$name","src","")},\
0_Device_FW {ReadingsVal("$name","announce_fw_ver","")},\
energy_kWh:params_switch_0_aenergy_total.* monotonic {ReadingsVal($NAME,"params_switch_0_aenergy_total",0)/60/1000.0}, \
Ertrag:energy_kWh.* { sprintf("%.2f",(ReadingsVal($NAME,"energy_kWh",0) - 0.00)*.2);;;;},\
EinAus {if (ReadingsVal("$name", "switch_0_output", "") eq "true") {return "on"}\
elsif (ReadingsVal("$name", "switch_0_output", "") eq "false") {return "off"}}
attr MQTT2_Licht_K150 webCmd toggle
attr MQTT2_Licht_K150 webCmdLabel Deckenlampe\
:
Zitat von: Guzzi-Charlie am 22 Mai 2024, 17:00:34Hallo,Aktuelles list?!?
keiner eine Idee?
Zitat von: marcel_mueller am 22 Mai 2024, 08:20:43Hallo BOFH
Das Polling Interval zu reduzieren hilft sicherlich schon mal. Wir haben aber auch Umbauten auf der Roadmap im Bereich der Authorisierung (wohl noch in diesem Jahr), dies wird die Integration dann auch wieder unbrauchbar machen (bis der neue Flow nachimplementiert wurde). Die Integration API wäre schon der sichere Hafen. Gerne mal melden, was da die wichtigsten Punkte sind, welche noch fehlen. Vielleicht kann ein paar Verbesserungen beim Produkt Management platzieren, so dass ihr den Funktionsumfang in Zukunft wieder ausweiten könnt.
Kurzfristig gibt es aber noch die Frage wann (und ob) wir die Sperre aufheben können. Wie lange dauert es, bis die Benutzer deine Patches erhalten? Werden die Updates manuell eingespielt? Problem ist halt, dass auch nur eine Hand-voll (von den ca. 100) FHEM Usern allenfalls wieder eine grosse Last erzeugen. Nach einem Rollout des Updates könnten wir probehalber die Sperre entfernen, wenn es aber wieder zu den massiven Requests führt, dann müssen wir sie wieder aktivieren.
Mittelfristig (dieses Jahr) braucht es aber schon den Umstieg auf die Integrations API, wie gesagt: es kommen Änderungen in der internen API, welche die Integration wieder beeinflussen werden.