[GELÖST]ShellyRGB2 fehlende Farbe rgb ->000000 und FFFFFF

Begonnen von rico5588, 17 Oktober 2021, 19:54:49

Vorheriges Thema - Nächstes Thema

rico5588

die effekte gehen nun :D
Nun zu den Farben
Wichtig ist es immer die gleiche Lampe anzusprechen ;D 8) (3C6105E500CC<->shellyrgbw2-D887B2) habe gerade wieder die Küche zum leuchten gebracht...

Aber die "test" bulb geht nun - alles Farbig und Aus bei 000000.
  rgb:colorpicker,RGB { return 'shellies/shellycolorbulb-3C6105E500CC/color/0/command off' if $EVTPART1 eq '000000'; $EVTPART1=~/(..)(..)(..)/;'shellies/shellyrgbw2-D887B2/color/0/set {"mode":"color","red":'.hex($1).',"green":'.hex($2).',"blue":'.hex($3).'}'}

Wenn ich jetzt noch FFFFFF dazu haben möchte kann ich das dann so erweitern?
  rgb:colorpicker,RGB { return 'shellies/shellycolorbulb-3C6105E500CC/color/0/command off' if $EVTPART1 eq '000000'; return 'shellies/shellycolorbulb-3C6105E500CC/color/0/set {\"turn\":\"on\",\"brightness\":".int(hex($1)/2.55).",\"mode\":\"white\",\"temp\":\"$EVTPART1\"}' if $EVTPART1 eq 'FFFFFF'; $EVTPART1=~/(..)(..)(..)/;'shellies/shellycolorbulb-3C6105E500CC/color/0/set {"mode":"color","red":'.hex($1).',"green":'.hex($2).',"blue":'.hex($3).'}'}


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

Beta-User

Na ja, ein bißchen selber Knobeln schadet doch eigentlich nicht...

Dass du den weiteren Pfad als "mittleren Teil" ergänzen müßtest, hast du ja bereits korrekt erfasst. Aber warum dann noch die (nicht aufzulösende (s.u.)) Variable $EVTPART1 da steht, erschließt sich mir nicht, genausowenig die "escapes" für die doppelten Quotes.
Dein Suchwort heißt "Quotes in Perl" - siehe z.B. https://www.perlmonks.org/?node_id=401006.

Das bekommst du schon vollends hin ;) .
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

rico5588

ich brauch doch nochmal einen Gedankeanstoß.
Ich bekomme es nicht hin, den mode White zu aktivieren.
Perl bin ich nicht so ganz (garnicht) Fit und meine TrialandError Methode zieht nicht  8)
Das hier sollte nach meiner Theorie den mode white, mit Farbe 4000 setzen, wo liegt das Problem ?
rgb:colorpicker,RGB { return 'shellies/shellycolorbulb-3C6105E500CC/color/0/set {\"mode\":\"white\,\"temp\":\"4000\"}' if $EVTPART1 eq 'FFFFFF'}
Gruß Rico
Geht nicht gibt's nicht.
NUC-I3+Proxmox, Fritzbox 7590 AX, Synology DS414
Dimplex Wärmepumpe, Lüftungsanlage, Solarlog 1200
HM,IT,Lacross,EspEasy,Modbus,MQTT2, Freund von Shelly

Beta-User

#18
Zitat von: rico5588 am 05 November 2021, 16:50:19
wo liegt das Problem ?
Bei "Quotes in Perl", ein bißchen "paarig" zählen, und einem fehlenden "Hosenträger" (vermutlich) ::) ...
rgb:colorpicker,RGB { return 'shellies/shellycolorbulb-3C6105E500CC/color/0/set {"turn":"on","mode":"white","temp":4000}' if $EVTPART1 eq 'FFFFFF'}

Ergänzend: Geschweifte Klammern sind mehrdeutig:
- die ersten sind für "das ist Perl-Code"-Erkennung in MQTT2_DEVICE;
- die inneren sind hier (!) die Textmarker für "das ist JSON" in der Payload
Es gibt aber noch weitere geschweifte Klammer-Typen, die man kennen sollte:
- Abgrenzung von "if"-Zweigen in Perl (bei "normalem, vorangestelltem if");
- Hash-Marker, um key-Value-Paare in Perl kenntlich zu machen/zu erzeugen...

Ist nicht ganz selbsterklärend, und man muss aufpassen, in welchem Kontext was steht.
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

rico5588

#19
So hatte ich das gestern auch schon versucht, geht aber nicht.
Zitatrgb:colorpicker,RGB { return 'shellies/shellycolorbulb-3C6105E500CC/color/0/set {"turn":"on","mode":"white","temp":4000}' if $EVTPART1 eq 'FFFFFF'}
so ↓ schaltet es zumindest in jede Farbe auf mode:white
rgb:colorpicker,RGB shellies/shellycolorbulb-3C6105E500CC/color/0/set {"turn":"on","mode":"white","temp":4000}
Geht nicht gibt's nicht.
NUC-I3+Proxmox, Fritzbox 7590 AX, Synology DS414
Dimplex Wärmepumpe, Lüftungsanlage, Solarlog 1200
HM,IT,Lacross,EspEasy,Modbus,MQTT2, Freund von Shelly

Beta-User

Mein Testgerät sagt, dass FFFFFF mit meinem Code zu einem passenden publish führt => kann keinen Fehler erkennen, tut mir leid.
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

rico5588


so gehts nicht
rgb:colorpicker,RGB { return 'shellies/shellycolorbulb-3C6105E500CC/color/0/set {"turn":"on","mode":"white","temp":"$EVTPART1"}' if $EVTPART1 eq 'FFFFFF'}

so geht es bei jedem Farbwert
rgb:colorpicker,RGB { return 'shellies/shellycolorbulb-3C6105E500CC/color/0/set {"turn":"on","mode":"white","temp":"$EVTPART1"}'}

so geht es bei jedem Farbwert, sollte aber nur bei "FFFFFF" gehen
rgb:colorpicker,RGB { return 'shellies/shellycolorbulb-3C6105E500CC/color/0/set {"turn":"on","mode":"white","temp":4000}'if $EVTPART1 == 'FFFFFF'}
rgb:colorpicker,RGB { return 'shellies/shellycolorbulb-3C6105E500CC/color/0/set {"turn":"on","mode":"white","temp":4000}'if $EVTPART1 = 'FFFFFF'}


Es wird der Farbwert nicht erkannt. Andere gehen auch nicht (z.b. FFFFF1)
Noch eine Idee was ich testen kann?
Geht nicht gibt's nicht.
NUC-I3+Proxmox, Fritzbox 7590 AX, Synology DS414
Dimplex Wärmepumpe, Lüftungsanlage, Solarlog 1200
HM,IT,Lacross,EspEasy,Modbus,MQTT2, Freund von Shelly

Beta-User

Dieses wilde rumprobieren wird nicht weiterführen.

Sowas ist Quatsch und die Konsequenz im Log zu finden sein (nummeric eq)
Zitatif $EVTPART1 == 'FFFFFF'
Das ist auch Quatsch:
if $EVTPART1 = 'FFFFFF'"=" ist eine Zuweisung, und die klappt/ist wahr.

Du mußt dich mit den Grundlagen beschäftigen.

Nochmal:
Zitat von: Beta-User am 05 November 2021, 17:07:48
Mein Testgerät sagt, dass FFFFFF mit meinem Code zu einem passenden publish führt => kann keinen Fehler erkennen, tut mir leid.
Was immer du gestern versucht hast, es war ziemlich sicher (geringfügig) was anderes. Damit bin ich erst mal raus.
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

rico5588

#23
Hallo,

Finale:
ich habe mich vom Colorpicker etwas in die Irre führen lassen.
Ich habe immer im Colorpicker FFFFFF eingegeben und dort hat er immer die Farbe FFFFFF im mode color eingestellt.
Niemals aber ist er in den mode white gesprungen...
Nach langem "Rum" probieren  ;D habe ich den Befehl mal direkt abgesetzt.
set shelly2 rgb FFFFFF
Und hier geht's...
Alles nochmal auf Anfang und nun bin ich zufrieden.

Anbei nochmal die komplette RAW.
Vielleicht willst du ja den Teil mit die Effekte noch ins Temp übernehmen.
Da man zum umschalten des mode color|white das turn:on mitgeben muß, habe ich mir rgb_on gesparrt.

defmod Shelly2 MQTT2_DEVICE shellycolorbulb_3C6105E500CC
attr Shelly2 comment rgb:colorpicker,RGB {return 'shellies/shellycolorbulb-3C6105E500CC/color/0/command off' if $EVTPART1 eq '000000';;  return 'shellies/shellycolorbulb-3C6105E500CC/color/0/set {"turn":"on","mode":"white","temp":"$EVTPART1"}' if $EVTPART1 eq 'FFFFFF';;   $EVTPART1=~/(..)(..)(..)/;;  'shellies/shellycolorbulb-3C6105E500CC/color/0/set {"turn":"on","mode":"color","red":'.hex($1).',"green":'.hex($2).',"blue":'.hex($3).'}'}
attr Shelly2 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,"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 Shelly2 disable 0
attr Shelly2 genericDeviceType light
attr Shelly2 homebridgeMapping Brightness=brightness::brightness,maxValue=100,factor=0.39216,delay=true
attr Shelly2 icon light_control
attr Shelly2 jsonMap brightness:pct
attr Shelly2 model shellybulb
attr Shelly2 readingList shellies/shellycolorbulb-3C6105E500CC/color/0/status:.* {json2nameValue($EVENT,'',$JSONMAP)}\
shellycolorbulb_3C6105E500CC:shellies/shellycolorbulb-3C6105E500CC/online:.* online\
shellycolorbulb_3C6105E500CC:shellies/shellycolorbulb-3C6105E500CC/announce:.* { json2nameValue($EVENT) }\
shellycolorbulb_3C6105E500CC:shellies/shellycolorbulb-3C6105E500CC/info:.* { json2nameValue($EVENT) }\
shellycolorbulb_3C6105E500CC:shellies/shellycolorbulb-3C6105E500CC/color/0:.* color_0\
shellycolorbulb_3C6105E500CC:shellies/shellycolorbulb-3C6105E500CC/light/0/power:.* light_0_power\
shellycolorbulb_3C6105E500CC:shellies/shellycolorbulb-3C6105E500CC/light/0/energy:.* light_0_energy\
shellycolorbulb_3C6105E500CC:shellies/shellycolorbulb-3C6105E500CC/color/0/status:.* { json2nameValue($EVENT) }
attr Shelly2 room MQTT2_DEVICE
attr Shelly2 setList off:noArg shellies/shellycolorbulb-3C6105E500CC/color/0/command off\
  on:noArg shellies/shellycolorbulb-3C6105E500CC/color/0/command on\
  effect:selectnumbers,0,1,3,0,lin  shellies/shellycolorbulb-3C6105E500CC/color/0/set {"effect":"$EVTPART1"}\
  effect_on:selectnumbers,0,1,3,0,lin  shellies/shellycolorbulb-3C6105E500CC/color/0/set {"effect": $EVTPART1, "turn": "on"}\
  pct:colorpicker,BRI,0,1,100 shellies/shellycolorbulb-3C6105E500CC/color/0/set {"gain":"$EVTPART1","brightness":"$EVTPART1"}\
  pct_on:colorpicker,BRI,0,1,100 shellies/shellycolorbulb-3C6105E500CC/color/0/set {"turn":"on","gain":"$EVTPART1","brightness":"$EVTPART1"}\
  ct:colorpicker,CT,3000,10,6500 {$EVTPART1=3000 if ($EVTPART1<3000);;"shellies/shellycolorbulb-3C6105E500CC/color/0/set {\"mode\":\"white\",\"temp\":\"$EVTPART1\"}"}\
  ct_on:colorpicker,CT,3000,10,6500 {$EVTPART1=3000 if ($EVTPART1<3000);;"shellies/shellycolorbulb-3C6105E500CC/color/0/set {\"turn\":\"on\",\"mode\":\"white\",\"temp\":\"$EVTPART1\"}"}\
  x_update:noArg shellies/shellycolorbulb-3C6105E500CC/command update_fw\
  x_mqttcom shellies/shellycolorbulb-3C6105E500CC/command $EVTPART1\
  rgb:colorpicker,RGB {return 'shellies/shellycolorbulb-3C6105E500CC/color/0/command off' if $EVTPART1 eq '000000';;  return 'shellies/shellycolorbulb-3C6105E500CC/color/0/set {"turn":"on","mode":"white","temp":"$EVTPART1"}' if $EVTPART1 eq 'FFFFFF';;   $EVTPART1=~/(..)(..)(..)/;;  'shellies/shellycolorbulb-3C6105E500CC/color/0/set {"turn":"on","mode":"color","red":'.hex($1).',"green":'.hex($2).',"blue":'.hex($3).'}'}
attr Shelly2 setStateList on off
attr Shelly2 userReadings ct:temp.* {ReadingsVal($name,"temp",3000)}, rgb:red.* {if(ReadingsVal($name,"mode","") eq "color"){sprintf("%02X%02X%02X", ReadingsVal($name,"red",99), ReadingsVal($name,"green",99), ReadingsVal($name,"blue",99))}else{my $a=sprintf("%02X",ReadingsVal($name,"brightness",0)*2.555);;"$a$a$a"}}
attr Shelly2 webCmd on:off:rgb:pct:ct:effect


zu guter letzt ...
Der state bleibt immer auf set_on oder set_off stehen, gibt es hierfür noch einen Trick?
Dieser hier https://forum.fhem.de/index.php/topic,94494.msg998583.html#msg998583 geht nicht da es kein Reading mit Power gibt?!


Ich habe das Device nochmal neu angelegt, damit war der "set" Fehler weg...und noch ein paar anpassungen durch geführt.
Im Attr devStateIcon steht ReadingsVal($name,"power","unknown")
Das Reading power gibt es bei mir nicht-> geändert in "light_0_power", nun wird der Verbrauch angezeigt.

alle Setlist Einträge mit "_on" haben nicht mehr funktioniert.
Ich habe Sie entfernt und "turn": "on" in den normal Zweig eingefügt.

webCmd effect hinzugefügt

defmod Shelly2 MQTT2_DEVICE shellycolorbulb_3C6105E500CC
attr Shelly2 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 Shelly2 genericDeviceType light
attr Shelly2 homebridgeMapping Brightness=brightness::brightness,maxValue=100,factor=0.39216,delay=true
attr Shelly2 icon light_control
attr Shelly2 jsonMap brightness:pct
attr Shelly2 model shellybulb
attr Shelly2 readingList shellies/shellycolorbulb-3C6105E500CC/color/0/status:.* {json2nameValue($EVENT,'',$JSONMAP)}\
shellycolorbulb_3C6105E500CC:shellies/shellycolorbulb-3C6105E500CC/online:.* online\
shellycolorbulb_3C6105E500CC:shellies/shellycolorbulb-3C6105E500CC/announce:.* { json2nameValue($EVENT) }\
shellycolorbulb_3C6105E500CC:shellies/shellycolorbulb-3C6105E500CC/info:.* { json2nameValue($EVENT) }\
shellycolorbulb_3C6105E500CC:shellies/shellycolorbulb-3C6105E500CC/color/0:.* color_0\
shellycolorbulb_3C6105E500CC:shellies/shellycolorbulb-3C6105E500CC/light/0/power:.* light_0_power\
shellycolorbulb_3C6105E500CC:shellies/shellycolorbulb-3C6105E500CC/light/0/energy:.* light_0_energy
attr Shelly2 room MQTT2_DEVICE
attr Shelly2 setList off:noArg shellies/shellycolorbulb-3C6105E500CC/color/0/command off\
  on:noArg shellies/shellycolorbulb-3C6105E500CC/color/0/command on\
  effect:selectnumbers,0,1,3,0,lin  shellies/shellycolorbulb-3C6105E500CC/color/0/set {"turn": "on","mode":"color","effect":"$EVTPART1"}\
  pct:colorpicker,BRI,0,1,100 shellies/shellycolorbulb-3C6105E500CC/color/0/set {"turn":"on","gain":"$EVTPART1","brightness":"$EVTPART1"}\
  ct:colorpicker,CT,3000,10,6500 {$EVTPART1=3000 if ($EVTPART1<3000);;"shellies/shellycolorbulb-3C6105E500CC/color/0/set {\"turn\":\"on\",\"mode\":\"white\",\"temp\":\"$EVTPART1\"}"}\
  x_update:noArg shellies/shellycolorbulb-3C6105E500CC/command update_fw\
  x_mqttcom shellies/shellycolorbulb-3C6105E500CC/command $EVTPART1\
  rgb:colorpicker,RGB {return 'shellies/shellycolorbulb-3C6105E500CC/color/0/command off' if $EVTPART1 eq '000000';;  return 'shellies/shellycolorbulb-3C6105E500CC/color/0/set {"turn":"on","mode":"white","temp":"$EVTPART1"}' if $EVTPART1 eq 'FFFFFF';;   $EVTPART1=~/(..)(..)(..)/;;  'shellies/shellycolorbulb-3C6105E500CC/color/0/set {"turn":"on","mode":"color","red":'.hex($1).',"green":'.hex($2).',"blue":'.hex($3).'}'}\

attr Shelly2 userReadings ct:temp.* {ReadingsVal($name,"temp",3000)}, rgb:red.* {if(ReadingsVal($name,'mode','') eq 'color'){sprintf("%02X%02X%02X", ReadingsVal($name,'red',99), ReadingsVal($name,'green',99), ReadingsVal($name,'blue',99))}else{my $a=sprintf("%02X",ReadingsVal($name,'brightness',0)*2.555);;"$a$a$a"}}
attr Shelly2 webCmd on:off:pct:ct:rgb:effect


Bekannter Fehler die noch offen sind
- state zeigt neben on off (as Lampe) auch rgb,ct,pct,effect im Klartext was erstmal komisch aussieht.
Geht nicht gibt's nicht.
NUC-I3+Proxmox, Fritzbox 7590 AX, Synology DS414
Dimplex Wärmepumpe, Lüftungsanlage, Solarlog 1200
HM,IT,Lacross,EspEasy,Modbus,MQTT2, Freund von Shelly

rico5588

und hier noch das Template falls von Interesse
####################### shellybulb using original firmware
########################### by Rico
name:shellybulb
filter:TYPE=MQTT2_DEVICE:FILTER=readingList=.*shellies.*
desc:shellybulb using original firmware <br>Tested with 1.49
order:A_15
par:DEVNAME;name of this shelly;{ AttrVal('DEVICE','readingList','') =~ m,shellies/([^/]+)/, ? $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 setList\
  off:noArg shellies/DEVNAME/color/0/command off\
  on:noArg shellies/DEVNAME/color/0/command on\
  effect:selectnumbers,0,1,3,0,lin  shellies/shellycolorbulb-3C6105E500CC/color/0/set {"turn": "on","mode":"color","effect":"$EVTPART1"}\
  pct:colorpicker,BRI,0,1,100 shellies/DEVNAME/color/0/set {"turn":"on","gain":"$EVTPART1","brightness":$EVTPART1}\
  ct:colorpicker,CT,3000,10,6500 {$EVTPART1=3000 if $EVTPART1<3000;qq(shellies/DEVNAME/color/0/set {"turn":"on","mode":"white","temp":$EVTPART1})}\
  rgb:colorpicker,RGB {return 'shellies/shellycolorbulb-3C6105E500CC/color/0/command off' if $EVTPART1 eq '000000';  return 'shellies/shellycolorbulb-3C6105E500CC/color/0/set {"turn":"on","mode":"white","temp":"$EVTPART1"}' if $EVTPART1 eq 'FFFFFF';   $EVTPART1=~/(..)(..)(..)/;  'shellies/shellycolorbulb-3C6105E500CC/color/0/set {"turn":"on","mode":"color","red":'.hex($1).',"green":'.hex($2).',"blue":'.hex($3).'}'}\
  x_update:noArg shellies/DEVNAME/command update_fw\
  x_mqttcom shellies/DEVNAME/command $EVTPART1
deletereading -q DEVICE status_.*
attr DEVICE readingList shellies/DEVNAME/color/0/status:.* {json2nameValue($EVENT,'',$JSONMAP)}
attr DEVICE userReadings ct:temp.* {ReadingsVal($name,"temp",3000)}, rgb:red.* {if(ReadingsVal($name,'mode','') eq 'color'){sprintf("%02X%02X%02X", ReadingsVal($name,'red',99), ReadingsVal($name,'green',99), ReadingsVal($name,'blue',99))}else{my $a=sprintf("%02X",ReadingsVal($name,'brightness',0)*2.555);"$a$a$a"}}
attr DEVICE webCmd on:off:pct:ct:rgb:effect
attr DEVICE jsonMap brightness:pct
set DEVICE x_mqttcom announce
set DEVICE attrTemplate speechcontrol_type_light
attr DEVICE model shellybulb
setreading DEVICE attrTemplateVersion 20211022
Geht nicht gibt's nicht.
NUC-I3+Proxmox, Fritzbox 7590 AX, Synology DS414
Dimplex Wärmepumpe, Lüftungsanlage, Solarlog 1200
HM,IT,Lacross,EspEasy,Modbus,MQTT2, Freund von Shelly

Beta-User

Via update kommt jetzt eine etwas veränderte Fassung. Wäre nett, wenn du die (ggf. mit einer Kopie deines "fertigen eigenen" Gerätes) austesten könntest.
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

rico5588

Sieht sehr gut aus, geht besser wie meins. :o ;D

Ich kann jetzt im Colorpicker "FFFFFF" eingeben und die Lampe schaltet auf mode white.
Verbrauchsanzeige geht auch richtig!
siehe Anhang

Eine Frage, kann man einen Zeilenumbruch im Setlist machen? Dadurch das die Zeile solang geworden ist das Device Fenster 4 Seiten breit.
Grundsätzlich ist das kein Problem, eher eine schönheitsfrage!

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

Beta-User

Zitat von: rico5588 am 11 November 2021, 19:53:47
Eine Frage, kann man einen Zeilenumbruch im Setlist machen? Dadurch das die Zeile solang geworden ist das Device Fenster 4 Seiten breit.
Grundsätzlich ist das kein Problem, eher eine schönheitsfrage!
Das Attribut setList wird zeilenweise ausgewertet, der Perl-Code kann daher leider nicht umgebrochen werden. Evtl. könnte man mit etwas css nachhelfen, dass der Text nicht ganz so klein wird und/oder in der html-Ansicht umgebrochen, aber funktional im Attribut geht das afaik nicht.

Ansonsten: Danke für die Rückmeldung, dass das so funktioniert wie erhofft... 8)
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

rico5588

Habe gerade gemerkt das noch eine kleinigkeit fehlt...

RGB:colorpicker,RGB {return 'shellies/shellycolorbulb-E8DB84AA555A/color/0/command off' if $EVTPART1 eq '000000'; 
return 'shellies/shellycolorbulb-E8DB84AA555A/color/0/set {"turn":"on","mode":"white","temp":4000}' if $EVTPART1 eq 'FFFFFF';
$EVTPART1=~/(..)(..)(..)/;
return if !defined $3; if($1 ne $2 || $2 ne $3){qq(shellies/shellycolorbulb-E8DB84AA555A/color/0/set {"mode":"color","gain":"100","red":).hex($1).qq(,"green":).hex($2).qq(,"blue":).hex($3).'}'}
else{qq(shellies/shellycolorbulb-E8DB84AA555A/color/0/set {"turn":"on","mode":"white","brightness":).int(hex($1)/2.55).'}'}}

und zwar "turn":"on" im vorletzten zweig. Dadurch geht rgb mit einem Set Befehl nicht aus dem "aus" zustand an.
(nicht Wundern ich musste aus rgb, RGB machen damit mein doif vereinheitlicht bleiben kann.

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