FHEM - Hausautomations-Systeme > Zigbee

Silvercrest Zigbee Produkte bei Lidl ab 03.12.

<< < (25/28) > >>

majestro84:
Ich war auf dem falschen weg........ Also weg mit dem Blödsinn

majestro84:
Was ich nicht geht ist der HSV Colorpicker. Ich habe es nun als Hex Reading mit hsb2hex jetzt müsste man es nur in einen Befehl sende können in der Art hex2hsb.
Gibt es irgendwo eine Erklärung wie das
--- Code: ---.zigbee2mqtt_RGB2JSON($EVTPART1)
--- Ende Code ---
funktioniert.
Finde zu der Funktion keine Doku.

Nighthawk:
Die Funktion steckt in der 10_MQTT2_Device.pm


--- Code: ---sub
zigbee2mqtt_RGB2JSON($)
{
  my $rgb = shift(@_);
  $rgb =~ m/^(..)(..)(..)/;
  return toJSON({'transition'=>1, 'color'=>{r=>hex($1),g=>hex($2),b=>hex($3)}});
}
--- Ende Code ---

majestro84:
Ja habe ich gestern Abend auch gefunden.
Ich denke man wird sich eine Art Funktion schreiben die HSB2JSON schreibt.
Wobei man wohl dann auch die Werte nicht über den Colorpicker bekommt da dieser Set Befehle für die einzelnen Werte benötigt.

majestro84:
Ich habe es für mich jetzt erst einmal so gelöst. Ist zwar nicht 100% aber besser als nichts
Vielleicht hat der ein oder andere noch ein Tipp.


--- Code: ---Internals:
   CFGFN     
   CID        zigbee_0xbc33acfffe775568
   DEF        zigbee_0xbc33acfffe775568
   DEVICETOPIC zigbee2mqtt/0xbc33acfffe775568
   FUUID      61bb8dfb-f33f-3405-f86f-648b9d36c46813ba
   IODev      MQTT_Server
   LASTInputDev MQTT_Server
   MQTT_Server_CONN MQTT_Server_132.21.32.59_53774
   MQTT_Server_MSGCNT 1187
   MQTT_Server_TIME 2021-12-18 10:59:42
   MSGCNT     1187
   NAME       Lichterketter_Weihnachtsbaum
   NR         124461
   STATE      off
   TYPE       MQTT2_DEVICE
   OLDREADINGS:
   READINGS:
     2021-12-16 20:05:31   IODev           MQTT_Server
     2021-12-17 23:37:10   associatedWith  MQTT2_Zigbee_Pi
     2021-12-17 15:50:17   attrTemplateVersion 20200904
     2021-12-18 10:59:42   brightness      254
     2021-12-18 10:59:42   color           FE0400
     2021-12-18 10:59:42   color_b         254
     2021-12-18 10:59:42   color_h         134
     2021-12-18 10:59:42   color_s         254
     2021-12-18 10:47:28   effect_colors_1_b 0
     2021-12-18 10:47:28   effect_colors_1_g 192
     2021-12-18 10:33:03   effect_colors_1_r 172
     2021-12-18 10:47:28   effect_colors_2_b 6
     2021-12-18 10:47:28   effect_colors_2_g 96
     2021-12-18 10:47:28   effect_colors_2_r 9
     2021-12-18 10:47:28   effect_colors_3_b 0
     2021-12-18 10:47:28   effect_colors_3_g 96
     2021-12-18 10:47:28   effect_colors_3_r 9
     2021-12-18 10:47:28   effect_colors_4_b 70
     2021-12-18 10:47:28   effect_colors_4_g 6
     2021-12-18 10:47:28   effect_colors_4_r 8
     2021-12-18 10:47:28   effect_colors_5_b 0
     2021-12-18 10:47:28   effect_colors_5_g 8
     2021-12-18 10:47:28   effect_colors_5_r 64
     2021-12-18 10:47:28   effect_colors_6_b 8
     2021-12-18 10:47:28   effect_colors_6_g 0
     2021-12-18 10:47:28   effect_colors_6_r 0
     2021-12-18 10:47:28   effect_effect   steady
     2021-12-18 10:33:03   effect_speed    9
     2021-12-18 10:59:42   hue             134
     2021-12-18 10:59:42   last_seen       1639821582326
     2021-12-18 10:59:42   linkquality     0
     2021-12-18 10:59:42   state           OFF
Attributes:
   devStateIcon {zigbee2mqtt_devStateIcon255($name)}
   devicetopic zigbee2mqtt/0xbc33acfffe775568
   getList    Status:noArg state $DEVICETOPIC/get {"state": ""}
   homebridgeMapping Brightness=brightness::brightness,maxValue=100,factor=0.39216,delay=true
   icon       light_led_stripe_rgb
   model      zigbee2mqtt_LED_string_lights
   readingList $DEVICETOPIC:.* { json2nameValue($EVENT) }
   room       MQTT2,Weihnachten
   setList    on:noArg $DEVICETOPIC/set {"state":"ON"}
off:noArg $DEVICETOPIC/set {"state":"OFF"}
brightness:colorpicker,BRI,0,1,254 $DEVICETOPIC/set {"state":"on","$EVTPART0":"$EVTPART1"}
hue:colorpicker,HUE,0,1,360 {my $bri=ReadingsNum($NAME,'brightness',0);; "$DEVICETOPIC/set \{\"color\":{\"hue\":$EVTPART1\,\"saturation\":$bri\}\}";;}
steady:noArg $DEVICETOPIC/set {"effect":{"effect":"steady"},"state":"ON"}
snow:noArg $DEVICETOPIC/set {"effect":{"effect":"snow","colors":[{"r":0,"g":0,"b":255}]},"state":"ON"}
rainbow:noArg $DEVICETOPIC/set {"effect":{"effect":"rainbow"},"state":"ON"}
snake:noArg $DEVICETOPIC/set {"effect":{"effect":"snake","colors":[{"r":255,"g":0,"b":0},{"r":0,"g":0,"b":255},{"r":255,"g":197,"b":25},{"r":0,"g":255,"b":0},{"r":4,"g":97,"b":191},{"r":191,"g":30,"b":4}]},"state":"ON"}
twinkle:noArg $DEVICETOPIC/set {"effect":{"effect":"twinkle","speed":80,"colors":[{"r":172,"g":0,"b":0},{"r":128,"g":100,"b":100}]},"state":"ON"}
firework:noArg $DEVICETOPIC/set {"effect":{"effect":"firework","speed":10},"state":"ON"}
horizontal_flag:noArg $DEVICETOPIC/set {"effect":{"effect":"horizontal_flag","speed":10,"colors":[{"r":255,"g":0,"b":0},{"r":210,"g":0,"b":255},{"r":255,"g":197,"b":25}]},"state":"ON"}
waves:noArg $DEVICETOPIC/set {"effect":{"effect":"waves","colors":[{"r":255,"g":114,"b":0},{"r":54,"g":255,"b":0},{"r":210,"g":0,"b":255}]},"state":"ON"}
updown:noArg $DEVICETOPIC/set {"effect":{"effect":"updown","colors":[{"r":255,"g":0,"b":0},{"r":0,"g":255,"b":0}]},"state":"ON"}
vintage:noArg $DEVICETOPIC/set {"effect":{"effect":"vintage"},"state":"ON"}
fading:noArg $DEVICETOPIC/set {"effect":{"effect":"fading"},"state":"ON"}
collide:noArg $DEVICETOPIC/set {"effect":{"effect":"collide"},"state":"ON"}
strobe:noArg $DEVICETOPIC/set {"effect":{"effect":"strobe","colors":[{"r":255,"g":0,"b":0},{"r":255,"g":197,"b":25},{"r":0,"g":0,"b":255},{"r":4,"g":97,"b":191},{"r":191,"g":30,"b":4}]},"state":"ON"}
sparkles:noArg $DEVICETOPIC/set {"effect":{"effect":"sparkles","speed":80,"colors":[{"r":0,"g":255,"b":0},{"r":255,"g":255,"b":255},{"r":255,"g":0,"b":0}]},"state":"ON"}
carnaval:noArg $DEVICETOPIC/set {"effect":{"effect":"carnaval","speed":10,"colors":[{"r":172,"g":0,"b":0},{"r":150,"g":0,"b":96},{"r":150,"g":0,"b":0},{"r":128,"g":100,"b":100},{"r":0,"g":128,"b":0},{"r":0,"g":0,"b":128}]},"state":"ON"}
glow:noArg $DEVICETOPIC/set {"effect":{"effect":"glow","colors":[{"r":255,"g":0,"b":0},{"r":0,"g":0,"b":255},{"r":255,"g":197,"b":25},{"r":0,"g":255,"b":0},{"r":4,"g":97,"b":191},{"r":191,"g":30,"b":4}]},"state":"ON"}
   stateFormat {lc ReadingsVal($name,"state",0)}
   struc_Christmas_map OFF:off ON:on
   userReadings color {Color::hsb2hex(ReadingsVal($name,"color_h",0),ReadingsVal($name,"color_s",0),ReadingsVal($name,"color_b",0))},
   hue {ReadingsNum($name,"color_h",0)}
   userattr   struc_Christmas struc_Christmas_map structexclude
   webCmd     toggle:on:off:brightness:hue
--- Ende Code ---

und noch einmal nur das Setlist

--- Code: ---on:noArg $DEVICETOPIC/set {"state":"ON"}
off:noArg $DEVICETOPIC/set {"state":"OFF"}
brightness:colorpicker,BRI,0,1,254 $DEVICETOPIC/set {"state":"on","$EVTPART0":"$EVTPART1"}
hue:colorpicker,HUE,0,1,360 {my $bri=ReadingsNum($NAME,'brightness',0);; "$DEVICETOPIC/set \{\"color\":{\"hue\":$EVTPART1\,\"saturation\":$bri\}\}";;}
steady:noArg $DEVICETOPIC/set {"effect":{"effect":"steady"},"state":"ON"}
snow:noArg $DEVICETOPIC/set {"effect":{"effect":"snow","colors":[{"r":0,"g":0,"b":255}]},"state":"ON"}
rainbow:noArg $DEVICETOPIC/set {"effect":{"effect":"rainbow"},"state":"ON"}
snake:noArg $DEVICETOPIC/set {"effect":{"effect":"snake","colors":[{"r":255,"g":0,"b":0},{"r":0,"g":0,"b":255},{"r":255,"g":197,"b":25},{"r":0,"g":255,"b":0},{"r":4,"g":97,"b":191},{"r":191,"g":30,"b":4}]},"state":"ON"}
twinkle:noArg $DEVICETOPIC/set {"effect":{"effect":"twinkle","speed":80,"colors":[{"r":172,"g":0,"b":0},{"r":128,"g":100,"b":100}]},"state":"ON"}
firework:noArg $DEVICETOPIC/set {"effect":{"effect":"firework","speed":10},"state":"ON"}
horizontal_flag:noArg $DEVICETOPIC/set {"effect":{"effect":"horizontal_flag","speed":10,"colors":[{"r":255,"g":0,"b":0},{"r":210,"g":0,"b":255},{"r":255,"g":197,"b":25}]},"state":"ON"}
waves:noArg $DEVICETOPIC/set {"effect":{"effect":"waves","colors":[{"r":255,"g":114,"b":0},{"r":54,"g":255,"b":0},{"r":210,"g":0,"b":255}]},"state":"ON"}
updown:noArg $DEVICETOPIC/set {"effect":{"effect":"updown","colors":[{"r":255,"g":0,"b":0},{"r":0,"g":255,"b":0}]},"state":"ON"}
vintage:noArg $DEVICETOPIC/set {"effect":{"effect":"vintage"},"state":"ON"}
fading:noArg $DEVICETOPIC/set {"effect":{"effect":"fading"},"state":"ON"}
collide:noArg $DEVICETOPIC/set {"effect":{"effect":"collide"},"state":"ON"}
strobe:noArg $DEVICETOPIC/set {"effect":{"effect":"strobe","colors":[{"r":255,"g":0,"b":0},{"r":255,"g":197,"b":25},{"r":0,"g":0,"b":255},{"r":4,"g":97,"b":191},{"r":191,"g":30,"b":4}]},"state":"ON"}
sparkles:noArg $DEVICETOPIC/set {"effect":{"effect":"sparkles","speed":80,"colors":[{"r":0,"g":255,"b":0},{"r":255,"g":255,"b":255},{"r":255,"g":0,"b":0}]},"state":"ON"}
carnaval:noArg $DEVICETOPIC/set {"effect":{"effect":"carnaval","speed":10,"colors":[{"r":172,"g":0,"b":0},{"r":150,"g":0,"b":96},{"r":150,"g":0,"b":0},{"r":128,"g":100,"b":100},{"r":0,"g":128,"b":0},{"r":0,"g":0,"b":128}]},"state":"ON"}
glow:noArg $DEVICETOPIC/set {"effect":{"effect":"glow","colors":[{"r":255,"g":0,"b":0},{"r":0,"g":0,"b":255},{"r":255,"g":197,"b":25},{"r":0,"g":255,"b":0},{"r":4,"g":97,"b":191},{"r":191,"g":30,"b":4}]},"state":"ON"}
--- Ende Code ---

Edit: Reading Hue hinzugefügt

Navigation

[0] Themen-Index

[#] Nächste Seite

[*] Vorherige Sete

Zur normalen Ansicht wechseln