Template / setlist für Shelly Plus RGBW PM

Begonnen von roedert, 14 Juli 2024, 08:33:35

Vorheriges Thema - Nächstes Thema

roedert

Ich habe o.a. neuen Shelly. Für MQTT gibt es dafür jedoch noch kein Template. Daher habe ich versucht selbst die MQTT-setList zu erstellen, bisher jedoch ohne Erfolg.
Die Plus-Geräte unterscheiden sind vom MQTT-Syntax ja deutlich von den Vorgängern.

Hat hier schon jemand Erfahrungen machen können?

enno

Moin Roedert,

Ich habe auch drei der Teile hier liegen und bin ungefähr so weit wie du :P Welche Einstellungen hast du im Shelly bei MQTT aktiviert?

Gruss
  Enno
Einfacher FHEM Anwender auf Intel®NUC mit Proxmox und Debian

rico5588

Hallo Ihr beiden,

wollte mal fragen ob ihr zufällig schon etwas erreicht habt. Besitze jetzt auch einen solchen Shelly und steh total auf dem Schlauch... :o
Geht nicht gibt's nicht.
NUC-I3+Proxmox, Fritzbox 7590 AX, Synology DS423+
Dimplex Wärmepumpe, Lüftungsanlage, Solarlog 1200
HM,IT,Lacross,EspEasy,Modbus,MQTT2, Freund von Shelly

rico5588

#3
Hallo,

ich würde gern beim erstellen des Template unterstützen. Leider weicht die neue Serie von Shelly stark von den alten ab.
Bis jetzt habe ich folgendes hinbekommen.
on, off, toggle,white , pct (helligkeit),trans...(Zeit zum wechsel Farbe/Helligkeit), rot (zum Test),

on:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"RGBW.Set","params": {"id":0,"on":true}}\
off:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"RGBW.Set","params": {"id":0,"on":false}}\
toggle:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"RGBW.Toggle","params": {"id":0}}\
white:colorpicker,BRI,0,5,255 $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"RGBW.Set","params": {"id":0,"on":true,"white":$EVTPART1}}\
pct:colorpicker,BRI,0,5,100 $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"RGBW.Set","params": {"id":0,"on":true,"brightness":$EVTPART1}}\
transition_duration:colorpicker,BRI,1,1,10 $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"RGBW.Set","params": {"id":0,"on":true,"transition_duration":$EVTPART1}}\
rot:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"RGBW.Set","params": {"id":0,"on":true,"rgb":[255,0,0]}}\

mit dem colorpicker habe ich so meine Probleme da ich nicht das richtige Verständiss für Perl habe.
die 3 Versuche gehen nicht!
# rgb:colorpicker,RGB {return '$DEVICETOPIC/rpc' if $EVTPART1 eq '000000';  return '$DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"RGBW.Set","params": {"id":0,"on":true,"rgb":[$EVTPART1]}}'; $EVTPART1=~/(..),(..),(..)/;  '$DEVICETOPIC/rpc {"turn":"on","mode":"color","red":'.hex($1).',"green":'.hex($2).',"blue":'.hex($3).'}'}
# rgb:colorpicker,RGB {$EVTPART1=~/(..)(..)(..)/;'$DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"RGBW.Set","params": {"id":0,"on":true,"rgb":['.hex($1).',"green":'.hex($2).',"blue":'.hex($3).']}}'}
  rgb:colorpicker,RGB {$EVTPART1=~/(..)(..)(..)/;if($1 ne $2 || $2 ne $3) {"$DEVICETOPIC/rpc {\"id\":0,\"src\":\"fhem\",\"method\":\"RGBW.Set\",\"params\": {\"id\":0,\"on\":true,\"rgb\":[.hex($1),.hex($2),.hex($3)]}}"}else{"$DEVICETOPIC/rpc {\"turn\":\"on\",\"mode\":\"white\",\"brightness\":".int(hex($1)/2.55)."}"}}

die letzte Zeile macht fast alles was Sie soll aus der hex Teil welcher nicht funktioniert.
rpc = {"id":0,"src":"fhem","method":"RGBW.Set","params": {"id":0,"on":true,"rgb":[{.hex(29)},.hex($2),.hex($3)]}}
wenn mir jemand unter Arme greifen möchte...nur zu.
Sobald die Setliste fertig ist könnte man es in ein Template stecken.
Gruß Rico

 
Geht nicht gibt's nicht.
NUC-I3+Proxmox, Fritzbox 7590 AX, Synology DS423+
Dimplex Wärmepumpe, Lüftungsanlage, Solarlog 1200
HM,IT,Lacross,EspEasy,Modbus,MQTT2, Freund von Shelly

Beta-User

Cool! Schau mal in der template-file nach was, das den Rückgabestring mit "qq" zusammen setzt, dann wird es einfacher zu lesen und zu coden.
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: ZigBee2mqtt, MiLight@ESP-GW, BT@OpenMQTTGw | ZWave | SIGNALduino | MapleCUN | RHASSPY
svn: u.a Weekday-&RandomTimer, Twilight,  div. attrTemplate-files, MySensors

rico5588

noch habe ich das manuell ins Device geschrieben...es gibt aktuell noch kein Template.
Im Teil rgb... wird die Wandlung vom Farbcode nicht richtig aufgelösst.
[.hex($1),.hex($2),.hex($3)]Es sollte das -> [255,0,0] ankommen, aber es kommt so [hex(ff),.hex(00),.hex(00)] an. Vermutlich ein Klammer oder Sonderzeichen Problem 🤷�♂️.
im ganzen sieht es so aus. ↓
rgb:colorpicker,RGB {$EVTPART1=~/(..)(..)(..)/;if($1 ne $2 || $2 ne $3) {"$DEVICETOPIC/rpc {\"id\":0,\"src\":\"fhem\",\"method\":\"RGBW.Set\",\"params\": {\"id\":0,\"on\":true,\"rgb\":[.hex($1),.hex($2),.hex($3)]}}"}else{"$DEVICETOPIC/rpc {\"turn\":\"on\",\"mode\":\"white\",\"brightness\":".int(hex($1)/2.55)."}"}}
Geht nicht gibt's nicht.
NUC-I3+Proxmox, Fritzbox 7590 AX, Synology DS423+
Dimplex Wärmepumpe, Lüftungsanlage, Solarlog 1200
HM,IT,Lacross,EspEasy,Modbus,MQTT2, Freund von Shelly

TomLee

#6
Zitat... wird die Wandlung vom Farbcode nicht richtig aufgelösst.

Hallo,

wenn Du die Funktionsaufrufe zuvor in Variablen schreibst und diese in der Rückgabe angibst, dann werden diese aufgelöst:

...my $h1=hex($1);my $h2=hex($2);my $h3=hex($3);if($1 ne $2 || $2 ne $3) {qq($DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"RGBW.Set","params": {"id":0,"on":true,"rgb":[$h1,$h2,$h3]}})}...
Gruß Thomas

edit:
statt drei Variablen könnte man auch ein Array verwenden:
... my @a=(hex($1),hex($2),hex($3));if($1 ne $2 || $2 ne $3) {qq($DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"RGBW.Set","params": {"id":0,"on":true,"rgb":[$a[0],$a[1],$a[2]]}})}...

rico5588

Hallo,
Dank TomLee konnte ich den ColorPicker nun fertigstellen.
Das Template habe ich angefangen. Hier komme ich beim Regex für das Topic wieder nicht weiter.
Aus dem DEVICE (MQTT2_shellyplusrgbwpm_d8132addb75c) könnte man den Topic ableiden.
Dazu müsste "MQTT2_" abgeschnitten und der Unterstrich in ein - geändert werden.
par:DEV_TPC;Shelly name in the topic;{ AttrVal('DEVICE','devicetopic',AttrVal('DEVICE','readingList','')) =~ m<(shellies/[^/]+|shellyp(lus|ro4pm)[^/:_]{4,}+)> ? $1 : undef }freiwillige vor ;-)


Anbei mein Device
defmod MQTT2_shellyplusrgbwpm_d8132addb75c MQTT2_DEVICE shellyplusrgbwpm_d8132addb75c
attr MQTT2_shellyplusrgbwpm_d8132addb75c devicetopic shellyplusrgbwpm-d8132addb75c
attr MQTT2_shellyplusrgbwpm_d8132addb75c icon light_control
attr MQTT2_shellyplusrgbwpm_d8132addb75c jsonMap brightness:pct
attr MQTT2_shellyplusrgbwpm_d8132addb75c model shellyplusrgbwpm
attr MQTT2_shellyplusrgbwpm_d8132addb75c readingList shellyplusrgbwpm_d8132addb75c:shellyplusrgbwpm-d8132addb75c/events/rpc:.* { json2nameValue($EVENT) }\
shellyplusrgbwpm_d8132addb75c:shellyplusrgbwpm-d8132addb75c/status/rgbw_0:.* { json2nameValue($EVENT) }\
shellyplusrgbwpm_d8132addb75c:shellyplusrgbwpm-d8132addb75c/debug/log:.* log\
shellyplusrgbwpm_d8132addb75c:shellyplusrgbwpm-d8132addb75c/online:.* online\
shellyplusrgbwpm_d8132addb75c:shellyplusrgbwpm-d8132addb75c/status/ws:.* { json2nameValue($EVENT) }\
shellyplusrgbwpm_d8132addb75c:shellyplusrgbwpm-d8132addb75c/status/ble:.* ble\
shellyplusrgbwpm_d8132addb75c:shellyplusrgbwpm-d8132addb75c/status/wifi:.* { json2nameValue($EVENT) }\
shellyplusrgbwpm_d8132addb75c:shellyplusrgbwpm-d8132addb75c/status/cloud:.* { json2nameValue($EVENT) }\
shellyplusrgbwpm_d8132addb75c:shellyplusrgbwpm-d8132addb75c/status/input_0:.* { json2nameValue($EVENT) }\
shellyplusrgbwpm_d8132addb75c:shellyplusrgbwpm-d8132addb75c/status/input_1:.* { json2nameValue($EVENT) }\
shellyplusrgbwpm_d8132addb75c:shellyplusrgbwpm-d8132addb75c/status/input_2:.* { json2nameValue($EVENT) }\
shellyplusrgbwpm_d8132addb75c:shellyplusrgbwpm-d8132addb75c/status/input_3:.* { json2nameValue($EVENT) }\
shellyplusrgbwpm_d8132addb75c:shellyplusrgbwpm-d8132addb75c/status/mqtt:.* { json2nameValue($EVENT) }\
shellyplusrgbwpm_d8132addb75c:shellyplusrgbwpm-d8132addb75c/status/plusrgbwpm:.* plusrgbwpm\
shellyplusrgbwpm_d8132addb75c:shellyplusrgbwpm-d8132addb75c/status/sys:.* { json2nameValue($EVENT) }\
shellyplusrgbwpm_d8132addb75c:fhem/rpc:.* { json2nameValue($EVENT) }
attr MQTT2_shellyplusrgbwpm_d8132addb75c room MQTT2_DEVICE
attr MQTT2_shellyplusrgbwpm_d8132addb75c setList on:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"RGBW.Set","params": {"id":0,"on":true}}\
  off:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"RGBW.Set","params": {"id":0,"on":false}}\
  toggle:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"RGBW.Toggle","params": {"id":0}}\
  white:colorpicker,BRI,0,5,255 $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"RGBW.Set","params": {"id":0,"on":true,"white":$EVTPART1}}\
  pct:colorpicker,BRI,0,5,100 $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"RGBW.Set","params": {"id":0,"on":true,"brightness":$EVTPART1}}\
  transition_duration:colorpicker,BRI,1,1,10 $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"RGBW.Set","params": {"id":0,"on":true,"transition_duration":$EVTPART1}}\
  toggle_after:colorpicker,BRI,1,1,10 $MQTT2_shellyplusrgbwpm_d8132addb75cTOPIC/rpc {"id":0,"src":"fhem","method":"RGBW.Set","params": {"id":0,"on":true,"toggle_after":$EVTPART1}}\
  rot:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"RGBW.Set","params": {"id":0,"on":true,"rgb":[0,255,0]}}\
  status:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"RGBW.Set","params": {"id":0,"on":true,"white":255}}\
  rgb:colorpicker,RGB {$EVTPART1=~/(..)(..)(..)/;;my @a=(hex($1),hex($2),hex($3));;if($1 ne $2 || $2 ne $3) {qq($DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"RGBW.Set","params": {"id":0,"on":true,"white":0,"rgb":[$a[0],$a[1],$a[2]]}})}else{qq($DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"RGBW.Set","params": {"id":0,"on":true,"white":255,"rgb":[$a[0],$a[1],$a[2]]}})}}
attr MQTT2_shellyplusrgbwpm_d8132addb75c userReadings ip { ReadingsVal($name,"sta_ip",0)}
attr MQTT2_shellyplusrgbwpm_d8132addb75c webCmd on:off:rgb:pct:white

und wer will das Template als frühe Beta.


#shellybulb using original firmware
# some modifications by Rico, https://forum.fhem.de/index.php/topic,....
name:shellyplusrgbwpm
filter:TYPE=MQTT2_DEVICE
desc:shellybulb using original firmware <br>Tested with 1.49
order:A_15b
par:DEVNAME;name of this shelly;{ AttrVal('DEVICE','readingList','') =~ m,shellies/([^/]+)/, ? $1 : undef }
par:DEV_TPC;Shelly name in the topic;{ AttrVal('DEVICE','devicetopic',AttrVal('DEVICE','readingList','')) =~ m<(shellies/[^/]+|shellyp(lus|ro4pm)[^/:_]{4,}+)> ? $1 : undef }
par:ICON;ICON as set, defaults to light_control;{ AttrVal('DEVICE','icon','light_control') }
attr DEVICE icon ICON
#attr DEVICE devStateIcon {my $onl = ReadingsVal($name,'online','false') eq 'true'?'10px-kreis-gruen':'10px-kreis-rot'; my $light = ReadingsVal($name,'state','off'); my $cons = ReadingsVal($name,'light_0_power>','unknown'); '<a href="http://'.ReadingsVal($name,'ip','none').' "target="_blank">'.FW_makeImage($onl)."</a> <a href=\"/fhem?cmd.dummy=set $name toggle&XHR=1\">".FW_makeImage($light)."</a><div>Verbrauch: $cons</div>"}
attr DEVICE devicetopic DEVICE
attr DEVICE model shellyplusrgbwpm
attr DEVICE comment 1 DEVNAME\
#2 DEV_TPC
#3 DEVICE
attr DEVICE 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/rgbw_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) }\
  fhem/rpc:.* {}
attr DEVICE setList\
  on:noArg $\DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"RGBW.Set","params": {"id":0,"on":true}}\
  off:noArg $\DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"RGBW.Set","params": {"id":0,"on":false}}\
  toggle:noArg $\DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"RGBW.Toggle","params": {"id":0}}\
  white:colorpicker,BRI,0,5,255 $\DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"RGBW.Set","params": {"id":0,"on":true,"white":$EVTPART1}}\
  pct:colorpicker,BRI,0,5,100 $\DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"RGBW.Set","params": {"id":0,"on":true,"brightness":$EVTPART1}}\
  transition_duration:colorpicker,BRI,1,1,10 $\DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"RGBW.Set","params": {"id":0,"on":true,"transition_duration":$EVTPART1}}\
  toggle_after:colorpicker,BRI,1,1,10 $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"RGBW.Set","params": {"id":0,"on":true,"toggle_after":$EVTPART1}}\
  rot:noArg $\DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"RGBW.Set","params": {"id":0,"on":true,"rgb":[0,255,0]}}\
  status:noArg $\DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"RGBW.Set","params": {"id":0,"on":true,"white":255}}\
  rgb:colorpicker,RGB {$EVTPART1=~/(..)(..)(..)/;my @a=(hex($1),hex($2),hex($3));if($1 ne $2 || $2 ne $3) {qq($\DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"RGBW.Set","params": {"id":0,"on":true,"white":0,"rgb":[$a[0],$a[1],$a[2]]}})}else{qq($\DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"RGBW.Set","params": {"id":0,"on":true,"white":255,"rgb":[$a[0],$a[1],$a[2]]}})}}
deletereading -q DEVICE status_.*
attr DEVICE comment 1 DEVNAME\
2 DEV_TPC
attr DEVICE 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 $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>Temp: $temp °C</div>)}
attr DEVICE userReadings ip { ReadingsVal($name,"sta_ip",0)}
attr DEVICE webCmd on:off:rgb:pct:white
attr DEVICE jsonMap brightness:pct
set DEVICE attrTemplate speechcontrol_type_light
setreading DEVICE attrTemplateVersion 20240915

Gruß Rico
PS: Wie sehen eure Device aus?
Geht nicht gibt's nicht.
NUC-I3+Proxmox, Fritzbox 7590 AX, Synology DS423+
Dimplex Wärmepumpe, Lüftungsanlage, Solarlog 1200
HM,IT,Lacross,EspEasy,Modbus,MQTT2, Freund von Shelly

Tueftler1983

Hallo ich habe seid heute auch einen SchellyproRGBWpm und Versuche diesen in FHEM einzubinden, mit dem Shelly Modul s heintbes nicht zu klappen.
Dann bin ich auf deinen Beitrag gestoßen und Versuche nun den Shelly via MQTT2 einzubinden.

Leider kann ich ihn über dein template auch nicht steuern oder sehe was Grade eingestellt ist.

Kannst du mir bei der Einbindung helfen??
So ist der Shelly konfiguriert:
Du darfst diesen Dateianhang nicht ansehen.

define shellyplusrgbwpm_ecc9ff4c616c MQTT2_DEVICE shellyplusrgbwpm-ecc9ff4c616c
attr shellyplusrgbwpm_ecc9ff4c616c alexaName Unterschrank
attr shellyplusrgbwpm_ecc9ff4c616c comment 1 shellyplusrgbwpm-ecc9ff4c616c\
2 shellyplusrgbwpm
attr shellyplusrgbwpm_ecc9ff4c616c 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 $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>Temp: $temp �C</div>)}
attr shellyplusrgbwpm_ecc9ff4c616c devicetopic shellyplusrgbwpm_ecc9ff4c616c
attr shellyplusrgbwpm_ecc9ff4c616c genericDeviceType light
attr shellyplusrgbwpm_ecc9ff4c616c icon light_control
attr shellyplusrgbwpm_ecc9ff4c616c jsonMap brightness:pct
attr shellyplusrgbwpm_ecc9ff4c616c model shellyplusrgbwpm
attr shellyplusrgbwpm_ecc9ff4c616c readingList shellyplusrgbwpm-ecc9ff4c616c/online:.* online\
shellyplusrgbwpm-ecc9ff4c616c/events/rpc:.* { json2nameValue($EVENT) }\
shellyplusrgbwpm-ecc9ff4c616c/status/sys:.* { json2nameValue($EVENT) }\
shellyplusrgbwpm-ecc9ff4c616c/status/rgbw_0:.* { json2nameValue($EVENT) }
attr shellyplusrgbwpm_ecc9ff4c616c room MQTT2_DEVICE
attr shellyplusrgbwpm_ecc9ff4c616c setList on:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"RGBW.Set","params": {"id":0,"on":true}}\
  off:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"RGBW.Set","params": {"id":0,"on":false}}\
  toggle:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"RGBW.Toggle","params": {"id":0}}\
  white:colorpicker,BRI,0,5,255 $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"RGBW.Set","params": {"id":0,"on":true,"white":$EVTPART1}}\
  pct:colorpicker,BRI,0,5,100 $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"RGBW.Set","params": {"id":0,"on":true,"brightness":$EVTPART1}}\
  transition_duration:colorpicker,BRI,1,1,10 $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"RGBW.Set","params": {"id":0,"on":true,"transition_duration":$EVTPART1}}\
  toggle_after:colorpicker,BRI,1,1,10 $shellyplusrgbwpm_ecc9ff4c616cTOPIC/rpc {"id":0,"src":"fhem","method":"RGBW.Set","params": {"id":0,"on":true,"toggle_after":$EVTPART1}}\
  rot:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"RGBW.Set","params": {"id":0,"on":true,"rgb":[0,255,0]}}\
  status:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"RGBW.Set","params": {"id":0,"on":true,"white":255}}\
  rgb:colorpicker,RGB {$EVTPART1=~/(..)(..)(..)/;;my @a=(hex($1),hex($2),hex($3));;if($1 ne $2 || $2 ne $3) {qq($DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"RGBW.Set","params": {"id":0,"on":true,"white":0,"rgb":[$a[0],$a[1],$a[2]]}})}else{qq($DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"RGBW.Set","params": {"id":0,"on":true,"white":255,"rgb":[$a[0],$a[1],$a[2]]}})}}
attr shellyplusrgbwpm_ecc9ff4c616c userReadings ip { ReadingsVal($name,"sta_ip",0)}
attr shellyplusrgbwpm_ecc9ff4c616c webCmd on:off:rgb:pct:white
#   CID        shellyplusrgbwpm-ecc9ff4c616c
#   DEF        shellyplusrgbwpm-ecc9ff4c616c
#   FUUID      6776b4ea-f33f-91a4-d4e8-de7f4de6e0e39ab0
#   IODev      MQTT2_FHEM_Server
#   LASTInputDev MQTT2_FHEM_Server
#   MQTT2_FHEM_Server_CONN MQTT2_FHEM_Server_192.168.2.69_64395
#   MQTT2_FHEM_Server_MSGCNT 194
#   MQTT2_FHEM_Server_TIME 2025-01-02 18:38:00
#   MSGCNT     194
#   NAME       shellyplusrgbwpm_ecc9ff4c616c
#   NR         699
#   STATE      on
#   TYPE       MQTT2_DEVICE
#   eventCount 223
#   JSONMAP:
#     brightness pct
#   READINGS:
#     2025-01-02 17:20:58   IODev           MQTT2_FHEM_Server
#     2025-01-02 18:38:00   aenergy_by_minute_1 36.200
#     2025-01-02 18:38:00   aenergy_by_minute_2 36.203
#     2025-01-02 18:38:00   aenergy_by_minute_3 36.200
#     2025-01-02 18:38:00   aenergy_minute_ts 1735839480
#     2025-01-02 18:38:00   aenergy_total   6.195
#     2025-01-02 18:38:00   apower          2.2
#     2025-01-02 17:23:04   attrTemplateVersion 20240915
#     2025-01-02 18:38:00   brightness      12
#     2025-01-02 17:26:38   cfg_rev         15
#     2025-01-02 18:38:00   current         0.176
#     2025-01-02 18:38:00   dst             shellyplusrgbwpm-ecc9ff4c616c/events
#     2025-01-02 17:26:38   fs_free         90112
#     2025-01-02 17:26:38   fs_size         393216
#     2025-01-02 18:38:00   id              0
#     2025-01-02 18:38:00   ip              0
#     2025-01-02 17:26:38   kvs_rev         0
#     2025-01-02 17:26:38   mac             ECC9FF4C616C
#     2025-01-02 18:38:00   method          NotifyStatus
#     2025-01-02 17:15:04   online          true
#     2025-01-02 18:38:00   output          true
#     2025-01-02 17:15:05   params_cloud_connected true
#     2025-01-02 17:26:38   params_events_1_cfg_rev 15
#     2025-01-02 17:26:38   params_events_1_component mqtt
#     2025-01-02 17:26:38   params_events_1_event config_changed
#     2025-01-02 16:47:08   params_events_1_reason 8
#     2025-01-02 17:26:38   params_events_1_restart_required false
#     2025-01-02 17:26:38   params_events_1_ts 1735835198.36
#     2025-01-02 17:15:05   params_input_0_id 0
#     2025-01-02 17:15:05   params_input_1_id 1
#     2025-01-02 17:15:05   params_input_2_id 2
#     2025-01-02 17:15:05   params_input_3_id 3
#     2025-01-02 17:15:05   params_mqtt_connected true
#     2025-01-02 18:38:00   params_rgbw_0_aenergy_by_minute_1 36.200
#     2025-01-02 18:38:00   params_rgbw_0_aenergy_by_minute_2 36.203
#     2025-01-02 18:38:00   params_rgbw_0_aenergy_by_minute_3 36.200
#     2025-01-02 18:38:00   params_rgbw_0_aenergy_minute_ts 1735839480
#     2025-01-02 18:38:00   params_rgbw_0_aenergy_total 6.195
#     2025-01-02 17:27:23   params_rgbw_0_apower 2.2
#     2025-01-02 17:27:22   params_rgbw_0_brightness 12
#     2025-01-02 17:27:23   params_rgbw_0_current 0.176
#     2025-01-02 18:38:00   params_rgbw_0_id 0
#     2025-01-02 17:27:22   params_rgbw_0_output true
#     2025-01-02 17:27:22   params_rgbw_0_rgb_1 254
#     2025-01-02 17:27:22   params_rgbw_0_rgb_2 193
#     2025-01-02 17:27:22   params_rgbw_0_rgb_3 163
#     2025-01-02 17:27:22   params_rgbw_0_source HTTP_in
#     2025-01-02 17:15:05   params_rgbw_0_temperature_tC 43.2
#     2025-01-02 17:15:05   params_rgbw_0_temperature_tF 109.8
#     2025-01-02 17:15:05   params_rgbw_0_voltage 12.6
#     2025-01-02 17:27:22   params_rgbw_0_white 33
#     2025-01-02 17:26:38   params_sys_cfg_rev 15
#     2025-01-02 17:15:05   params_sys_fs_free 90112
#     2025-01-02 17:15:05   params_sys_fs_size 393216
#     2025-01-02 17:15:05   params_sys_kvs_rev 0
#     2025-01-02 17:15:05   params_sys_mac  ECC9FF4C616C
#     2025-01-02 17:15:05   params_sys_ram_free 129420
#     2025-01-02 17:15:05   params_sys_ram_size 252284
#     2025-01-02 17:15:05   params_sys_reset_reason 3
#     2025-01-02 17:15:05   params_sys_restart_required false
#     2025-01-02 17:15:05   params_sys_schedule_rev 1
#     2025-01-02 17:15:05   params_sys_time 17:15
#     2025-01-02 17:15:05   params_sys_unixtime 1735834504
#     2025-01-02 17:15:05   params_sys_uptime 1695
#     2025-01-02 17:15:05   params_sys_webhook_rev 0
#     2025-01-02 18:38:00   params_ts       1735839480.00
#     2025-01-02 17:15:05   params_wifi_rssi -57
#     2025-01-02 17:15:05   params_wifi_ssid FRITZ!Box 6360 Cable Holger
#     2025-01-02 17:15:05   params_wifi_sta_ip 192.168.2.69
#     2025-01-02 17:15:05   params_wifi_status got ip
#     2025-01-02 17:15:05   params_ws_connected false
#     2025-01-02 17:26:38   ram_free        126320
#     2025-01-02 17:26:38   ram_size        252184
#     2025-01-02 17:26:38   reset_reason    3
#     2025-01-02 17:26:38   restart_required false
#     2025-01-02 18:38:00   rgb_1           254
#     2025-01-02 18:38:00   rgb_2           193
#     2025-01-02 18:38:00   rgb_3           163
#     2025-01-02 17:26:38   schedule_rev    1
#     2025-01-02 18:38:00   source          HTTP_in
#     2025-01-02 18:38:00   src             shellyplusrgbwpm-ecc9ff4c616c
#     2025-01-02 17:53:48   state           on
#     2025-01-02 17:20:58   subscriptions   shellies/command shellyplusrgbwpm-ecc9ff4c616c/command shellyplusrgbwpm-ecc9ff4c616c/command/sys shellyplusrgbwpm-ecc9ff4c616c/rpc
#     2025-01-02 18:38:00   temperature_tC  44.4
#     2025-01-02 18:38:00   temperature_tF  111.9
#     2025-01-02 17:26:38   time            17:26
#     2025-01-02 17:26:38   unixtime        1735835198
#     2025-01-02 17:26:38   uptime          2389
#     2025-01-02 18:38:00   voltage         12.3
#     2025-01-02 17:26:38   webhook_rev     0
#     2025-01-02 18:38:00   white           33
#
setstate shellyplusrgbwpm_ecc9ff4c616c on
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:20:58 IODev MQTT2_FHEM_Server
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 18:38:00 aenergy_by_minute_1 36.200
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 18:38:00 aenergy_by_minute_2 36.203
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 18:38:00 aenergy_by_minute_3 36.200
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 18:38:00 aenergy_minute_ts 1735839480
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 18:38:00 aenergy_total 6.195
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 18:38:00 apower 2.2
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:23:04 attrTemplateVersion 20240915
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 18:38:00 brightness 12
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:26:38 cfg_rev 15
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 18:38:00 current 0.176
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 18:38:00 dst shellyplusrgbwpm-ecc9ff4c616c/events
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:26:38 fs_free 90112
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:26:38 fs_size 393216
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 18:38:00 id 0
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 18:38:00 ip 0
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:26:38 kvs_rev 0
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:26:38 mac ECC9FF4C616C
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 18:38:00 method NotifyStatus
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:15:04 online true
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 18:38:00 output true
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:15:05 params_cloud_connected true
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:26:38 params_events_1_cfg_rev 15
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:26:38 params_events_1_component mqtt
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:26:38 params_events_1_event config_changed
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 16:47:08 params_events_1_reason 8
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:26:38 params_events_1_restart_required false
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:26:38 params_events_1_ts 1735835198.36
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:15:05 params_input_0_id 0
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:15:05 params_input_1_id 1
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:15:05 params_input_2_id 2
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:15:05 params_input_3_id 3
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:15:05 params_mqtt_connected true
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 18:38:00 params_rgbw_0_aenergy_by_minute_1 36.200
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 18:38:00 params_rgbw_0_aenergy_by_minute_2 36.203
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 18:38:00 params_rgbw_0_aenergy_by_minute_3 36.200
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 18:38:00 params_rgbw_0_aenergy_minute_ts 1735839480
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 18:38:00 params_rgbw_0_aenergy_total 6.195
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:27:23 params_rgbw_0_apower 2.2
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:27:22 params_rgbw_0_brightness 12
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:27:23 params_rgbw_0_current 0.176
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 18:38:00 params_rgbw_0_id 0
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:27:22 params_rgbw_0_output true
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:27:22 params_rgbw_0_rgb_1 254
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:27:22 params_rgbw_0_rgb_2 193
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:27:22 params_rgbw_0_rgb_3 163
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:27:22 params_rgbw_0_source HTTP_in
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:15:05 params_rgbw_0_temperature_tC 43.2
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:15:05 params_rgbw_0_temperature_tF 109.8
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:15:05 params_rgbw_0_voltage 12.6
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:27:22 params_rgbw_0_white 33
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:26:38 params_sys_cfg_rev 15
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:15:05 params_sys_fs_free 90112
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:15:05 params_sys_fs_size 393216
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:15:05 params_sys_kvs_rev 0
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:15:05 params_sys_mac ECC9FF4C616C
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:15:05 params_sys_ram_free 129420
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:15:05 params_sys_ram_size 252284
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:15:05 params_sys_reset_reason 3
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:15:05 params_sys_restart_required false
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:15:05 params_sys_schedule_rev 1
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:15:05 params_sys_time 17:15
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:15:05 params_sys_unixtime 1735834504
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:15:05 params_sys_uptime 1695
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:15:05 params_sys_webhook_rev 0
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 18:38:00 params_ts 1735839480.00
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:15:05 params_wifi_rssi -57
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:15:05 params_wifi_ssid FRITZ!Box 6360 Cable Holger
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:15:05 params_wifi_sta_ip 192.168.2.69
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:15:05 params_wifi_status got ip
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:15:05 params_ws_connected false
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:26:38 ram_free 126320
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:26:38 ram_size 252184
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:26:38 reset_reason 3
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:26:38 restart_required false
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 18:38:00 rgb_1 254
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 18:38:00 rgb_2 193
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 18:38:00 rgb_3 163
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:26:38 schedule_rev 1
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 18:38:00 source HTTP_in
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 18:38:00 src shellyplusrgbwpm-ecc9ff4c616c
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:53:48 state on
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:20:58 subscriptions shellies/command shellyplusrgbwpm-ecc9ff4c616c/command shellyplusrgbwpm-ecc9ff4c616c/command/sys shellyplusrgbwpm-ecc9ff4c616c/rpc
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 18:38:00 temperature_tC 44.4
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 18:38:00 temperature_tF 111.9
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:26:38 time 17:26
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:26:38 unixtime 1735835198
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:26:38 uptime 2389
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 18:38:00 voltage 12.3
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 17:26:38 webhook_rev 0
setstate shellyplusrgbwpm_ecc9ff4c616c 2025-01-02 18:38:00 white 33

LG Holger

Beta-User

Versuche mal Binde- statt Unterstrich in devicetopic.
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: ZigBee2mqtt, MiLight@ESP-GW, BT@OpenMQTTGw | ZWave | SIGNALduino | MapleCUN | RHASSPY
svn: u.a Weekday-&RandomTimer, Twilight,  div. attrTemplate-files, MySensors

Tueftler1983

Danke, Hatte es in der Dev geändert aber unten das attr übersehen!

rudimäntär funktioniert es, aber der erste slider ist ohne funktion und der zweite steuert sowohl RGB als auch W Hälligkeit gleichzeitig.

Der Color Picker funktioniert.

wenn ich im set Dropdown menu rot wähle und ausführe wechselt der LED streifen auf GRÜN

Der Set befehl transition_duration scheint garkeinen einfluss zu haben, egal ob 1 oder 10 die Übergangszeit ist immer gleich

Das soll keine Kretik sein sondern nur ein Feedback zur Funktion.

Finde es super das du dich dran gemacht hast ein Template zu erstellen, habe dies selbst schon durch für den Bestway Wirlpool

lg Holger

rico5588

Moin,

Zitatwenn ich im set Dropdown menu rot wähle und ausführe wechselt der LED streifen auf GRÜN
↑ das klinkt für mich nach einen Verdrahtungsfehler vom Controller zu Stripe.
Gehen denn alle anderen Farben?
Das Problem mit "befehl transition_duration" kenne ich auch und konnte es noch nicht lösen.
Geht nicht gibt's nicht.
NUC-I3+Proxmox, Fritzbox 7590 AX, Synology DS423+
Dimplex Wärmepumpe, Lüftungsanlage, Solarlog 1200
HM,IT,Lacross,EspEasy,Modbus,MQTT2, Freund von Shelly

Tueftler1983

Zitat von: rico5588 am 03 Januar 2025, 12:58:49Moin,

Zitatwenn ich im set Dropdown menu rot wähle und ausführe wechselt der LED streifen auf GRÜN
↑ das klinkt für mich nach einen Verdrahtungsfehler vom Controller zu Stripe.
Gehen denn alle anderen Farben?
Das Problem mit "befehl transition_duration" kenne ich auch und konnte es noch nicht lösen.

Hey über den colorPicker kann ich alle Farben richtig auswählen, aber habe den Fehler gefunden!
rot:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"RGBW.Set","params": {"id":0,"on":true,"rgb":[0,255,0]}}muss
rot:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"RGBW.Set","params": {"id":0,"on":true,"rgb":[255,0,0]}}
habe dann den Set befehlen noch
gruen:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"RGBW.Set","params": {"id":0,"on":true,"rgb":[0,255,0]}}
blau:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"RGBW.Set","params": {"id":0,"on":true,"rgb":[0,0,255]}}
hinzugefügt.

Dann habe ich noch das reading für die Temperatur vom Shelly angepasst, da fehlte ein_tC im DevStateIcon

Was mich ein wenig stört ist, das der Slider für die Helligkeit immer wieser auf 0 zurück springt da der kein Reading hat.

Sonst muss ich sagen herzlichen dank für das Template


sonst Läuft es jetzt ohne Probleme bis auf die Übergangsgeschwindigkeit.

TomLee

ZitatWas mich ein wenig stört ist, das der Slider für die Helligkeit immer wieser auf 0 zurück springt da der kein Reading hat.

Sollte er nicht mehr wenn Du den setter pct in brightness änderst?

Beta-User

...oder den 3. Parameter bei json2nameReading() setzt...
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: ZigBee2mqtt, MiLight@ESP-GW, BT@OpenMQTTGw | ZWave | SIGNALduino | MapleCUN | RHASSPY
svn: u.a Weekday-&RandomTimer, Twilight,  div. attrTemplate-files, MySensors