FHEM Forum

FHEM - Anwendungen => Beleuchtung => Thema gestartet von: nocomment am 18 Februar 2015, 22:01:40

Titel: Milight & Lightscene
Beitrag von: nocomment am 18 Februar 2015, 22:01:40
Hallo ihr Lieben,
leider werden die "states" der Milight Lampen nicht richtig gespeichert mit RGB etc, von den Philips Hue devices dennoch schon.
Liegt es an Lightscene ?

Auszug aus der LightScenes.Save:
Wohnzimmer_Scene":{"Full_On":{"bridge_HUEDevice4":{"icon":"on@#ffffff","state":"bri 254 : xy 0.3333,0.3333"},"bridge_HUEDevice3":{"icon":"on@#ffffff","state":"bri 254 : xy 0.3333,0.3333"},"HUEDevice5":{"icon":"on@#ffffff","state":"bri 254 : xy 0.3333,0.3333"},"Deckenlampe_Wohnzimmer":"on 100","Wohnzimmer_Alkschrank":"on 100"},"Warme_Sonne":{"bridge_HUEDevice4":{"icon":"on@#e038a8","state":"bri 254 : xy 0.4612,0.2336"},"bridge_HUEDevice3":{"icon":"dim93%@#e4226e","state":"bri 251 : xy 0.5294,0.242"},"HUEDevice5":{"icon":"dim87%@#fe6520","state":"bri 239 : xy 0.5727,0.3626"},"Deckenlampe_Wohnzimmer":"on 33","Wohnzimmer_schrank":"on 45"}}}

Deckenlampe_Wohnzimmer & Wohnzimmer_schrank sind Milight devices.

Wäre dankbar für einen Ansatz zur Lösung dieses Problems.

lg,
Patrick
Titel: Antw:Milight & Lightscene
Beitrag von: justme1968 am 18 Februar 2015, 22:07:40
was heisst nicht richtig gespeichert?

wenn nicht state sondern ein anderes reading gespeichert und per set wieder hergestellt werden soll musst du das lightSceneParamsToSave attribut passend setzen.

gruss
  andre
Titel: Antw:Milight & Lightscene
Beitrag von: nocomment am 18 Februar 2015, 23:29:55
Dankö Andre, das war es!

Gute Nacht  ;D
Titel: Milight & Lightscene
Beitrag von: nocomment am 19 Februar 2015, 00:12:25
Leider zu früh gefreut. :(

Die Helligkeit wird nicht übernommen von den Milight devices. Die Farbe wird geändert aber die Helligkeit wird nicht geändert.

define Deckenlampe_Wohnzimmer MilightDevice RGBW MiLightBridge 7
attr Deckenlampe_Wohnzimmer IODev MiLightBridge
attr Deckenlampe_Wohnzimmer alias Wohnzimmer Deckenlampe
attr Deckenlampe_Wohnzimmer devStateIcon {(MilightDevice_devStateIcon($name),"toggle")}
attr Deckenlampe_Wohnzimmer event-on-change-reading state,transitionInProgress
attr Deckenlampe_Wohnzimmer group Licht
attr Deckenlampe_Wohnzimmer room Wohnzimmer
attr Deckenlampe_Wohnzimmer webCmd rgb:rgb ffffff:rgb ff2a00:rgb 00ff00:rgb 0000ff:rgb ffff00:on:off:dim
attr Deckenlampe_Wohnzimmer lightSceneParamsToSave state,brightness,brightness_on,RGB,hue,saturation,discoMode,discoSpeed,previousState
Titel: Antw:Milight & Lightscene
Beitrag von: justme1968 am 19 Februar 2015, 09:17:42
kann es sein das du dir gegenseitig voneinander abhängige parameter überschreibst?

schau mal ins log und schalte von hand genau so wie  es die  oben angegeben konfiguration tut.
Titel: Antw:Milight & Lightscene
Beitrag von: mattwire am 20 Februar 2015, 01:05:01
I have added support to LightScene for the MilightDevice.  Please try it by using 31_LightScene.pm and 31_MilightDevice.pm from here: https://github.com/mattwire/fhem/commit/24dd8c587029321a78193f9b4dbd14561d6a3fd3

Be sure to delete LightSceneParamsToSave first
Titel: Antw:Milight & Lightscene
Beitrag von: nocomment am 20 Februar 2015, 01:36:38
Thanks Matt for adding Milight support to LightScene!
Made my day :D 8)
Titel: Antw:Milight & Lightscene
Beitrag von: justme1968 am 20 Februar 2015, 08:27:57
this is not the best way to go. lightscene ahould geht less device dependend. not more.

could you please provide a initialization of LightSceneParamsToSave in the commandref or even in the module so lightscene can work unchanged?

thanks
  andre
Titel: Antw:Milight & Lightscene
Beitrag von: mattwire am 20 Februar 2015, 08:59:17
@justme1968: ok. How should I do that? I need to "set hsv x, x, x"  in lightscene. At the moment there is no reading "hsv" but I could add one. Then I would only need to set LightSceneParamsToSave=hsv
Correct?
Titel: Antw:Milight & Lightscene
Beitrag von: justme1968 am 20 Februar 2015, 11:10:09
yes. a hsv reading would be one way. or an rgb reading.

the other would be to accept a set like this:set <device> hue <value> : saturation <value> : brightness <value>then you would set LightSceneParamsToSave hue:saturation:brightness

  andre
Titel: Antw:Milight & Lightscene
Beitrag von: mattwire am 20 Februar 2015, 22:31:55
I've updated MilightDevice to set attribute lightSceneParamsToSave=hsv for RGBW/RGB; lightSceneParamsToSave=brightness for White; https://github.com/mattwire/fhem/commit/07f96f813893ffbb6fcfc88bf851c89dcc72268c
Fix typo: https://github.com/mattwire/fhem/commit/71da5a317673cac5fb251a6b9ca7d920390503b1

Please use original 31_LightScene.

Matthew