Dreambox EnigmaLight per EnigmaLight Remote (http) steuern

Begonnen von stefanru, 19 Oktober 2021, 00:01:32

Vorheriges Thema - Nächstes Thema

stefanru

Hi,

sorry das ich hier bei Anfängerfragen poste, aber ich weiß nicht ganz wo es hinpasst.
Für die Dreambox gibt es das EnigmaLight für ein Ambilight.
An dem Plugin wurde gewaltig weiter gebaut, pclin und schwatter sind da sehr aktiv.
Ich habe eine Anbindung an WLED per WLAN gebaut.
Ich kann meine Ambilight auch per WLED steuern.

Jetzt würde ich aber auch gern wenn die Dreambox an ist EnigmaLight steuern können und in Alexa integrieren per FHEM.

Bisher ging das nur per Commandozeilen Befehle auf der Dream, mehr schlecht als recht.
Nun hat Schwatter aber das EnigmaLight Remote repariert.

Das ganze ist eine Weboberfläche zur Steuerung per Webseite.
Es sind auch URL's zum steuern eingebaut:
HttpRequest Examples
http://[IP]:[Port]/control/light?set=off
http://[IP]:[Port]/control/light?set=dynamic
http://[IP]:[Port]/control/light?set=moodlamp
http://[IP]:[Port]/control/option?set=brightness&v=1.0
http://[IP]:[Port]/control/option?set=brightnessmin&v=0.00
http://[IP]:[Port]/control/option?set=brightnessmax&v=1.00
http://[IP]:[Port]/control/option?set=saturation&v=1.0
http://[IP]:[Port]/control/option?set=saturationmin&v=0.00
http://[IP]:[Port]/control/option?set=saturationmax&v=1.00
http://[IP]:[Port]/control/option?set=speed&v=50
http://[IP]:[Port]/control/option?set=gamma&v=2.2
http://[IP]:[Port]/control/option?set=adjustr&v=255
http://[IP]:[Port]/control/option?set=adjustg&v=255
http://[IP]:[Port]/control/option?set=adjustb&v=255
http://[IP]:[Port]/control/option?set=moodlamp_mode&v=1
http://[IP]:[Port]/control/option?set=moodlamp_brightness&v=150
http://[IP]:[Port]/control/option?set=moodlamp_static_color_r&v=150
http://[IP]:[Port]/control/option?set=moodlamp_static_color_g&v=150
http://[IP]:[Port]/control/option?set=moodlamp_static_color_b&v=150
http://[IP]:[Port]/api/statusinfo

Statusinfo liefert:
{"option_saturationmax": "1.00", "option_moodlamp_green": "99", "option_brightness": "0.3", "option_speed": "30", "option_brightnessmin": "0.00", "option_moodlampbrightness": "100", "current_mode": "2", "option_moodlamp_blue": "68", "option_saturation": "1.0", "lights_onoff": "dynamic", "option_red": "190", "option_moodlamp_red": "5", "dyna_mood": "dynamic", "option_moodlampmode": "1", "option_green": "255", "option_brightnessmax": "1.00", "option_blue": "200", "option_saturationmin": "0.00", "option_gamma": "1.0"}

Ist httpmod der richtige Weg das einzubauen oder gibt es einen besseren Ansatz?

Danke und Gruß,
Stefan


schwatter

Nabend,

ich antworte mal :) Bis eben hatte ich Enigmalight noch nicht in Fhem. Hier mal ein Schnellschuß per httpmod.
Darauf kannst du erstmal aufbauen. Vielleicht ändere ich die Namen in Enigmalight nochmal, damit sie besser zu Fhem passen.

defmod Enigmalight HTTPMOD http://192.168.178.13:1414/api/statusinfo
attr Enigmalight extractAllJSON 1
attr Enigmalight icon hue_filled_lightstrip
attr Enigmalight room 03.Wohnzimmer_EG
attr Enigmalight set01Hint dynamic,moodlamp,off
attr Enigmalight set01Name setMode
attr Enigmalight set01TextArg dynamic,moodlamp,off
attr Enigmalight set01URL http://192.168.178.13:1414/control/light?set=$val
attr Enigmalight set02Hint 1,3,4,5
attr Enigmalight set02Max 5
attr Enigmalight set02Min 1
attr Enigmalight set02Name setMoodlampmode
attr Enigmalight set02URL http://192.168.178.13:1414/control/option?set=moodlamp_mode&v=$val
attr Enigmalight set03Name setMoodlamp_Static_Color_R
attr Enigmalight set03URL http://192.168.178.13:1414/control/option?set=moodlamp_static_color_r&v=$val
attr Enigmalight set04Name setMoodlamp_Static_Color_G
attr Enigmalight set04URL http://192.168.178.13:1414/control/option?set=moodlamp_static_color_g&v=$val
attr Enigmalight set05Name setMoodlamp_Static_Color_B
attr Enigmalight set05URL http://192.168.178.13:1414/control/option?set=moodlamp_static_color_b&v=$val
attr Enigmalight stateFormat current_mode
attr Enigmalight widgetOverride setMoodlamp_Brightness:slider,0,1,255 setMoodlamp_Static_Color_R:slider,0,1,255 setMoodlamp_Static_Color_G:slider,0,1,255 setMoodlamp_Static_Color_B:slider,0,1,255

setstate Enigmalight 1
setstate Enigmalight 2021-10-19 19:02:29 current_mode 1
setstate Enigmalight 2021-10-19 19:02:29 dyna_mood moodlamp
setstate Enigmalight 2021-10-19 19:02:29 lights_onoff dynamic
setstate Enigmalight 2021-10-19 19:02:29 option_blue 105
setstate Enigmalight 2021-10-19 19:02:29 option_brightness 1.0
setstate Enigmalight 2021-10-19 19:02:29 option_brightnessmax 1.00
setstate Enigmalight 2021-10-19 19:02:29 option_brightnessmin 0.00
setstate Enigmalight 2021-10-19 19:02:29 option_gamma 2.4
setstate Enigmalight 2021-10-19 19:02:29 option_green 35
setstate Enigmalight 2021-10-19 19:02:29 option_moodlamp_blue 45
setstate Enigmalight 2021-10-19 19:02:29 option_moodlamp_green 85
setstate Enigmalight 2021-10-19 19:02:29 option_moodlamp_red 135
setstate Enigmalight 2021-10-19 19:02:29 option_moodlampbrightness 31
setstate Enigmalight 2021-10-19 19:02:29 option_moodlampmode 1
setstate Enigmalight 2021-10-19 19:02:29 option_red 35
setstate Enigmalight 2021-10-19 19:02:29 option_saturation 1.0
setstate Enigmalight 2021-10-19 19:02:29 option_saturationmax 1.00
setstate Enigmalight 2021-10-19 19:02:29 option_saturationmin 0.00
setstate Enigmalight 2021-10-19 19:02:29 option_speed 35


Gruß schwatter

stefanru

#2
Hi Schwatter,

wow cool du auch hier.
Ich dank die vielmals!

Werde das gleich mal testen.
Ist dann wohl schon die beste Möglichkeit mit Enigmalight zu kommunizieren zur Zeit, richtig?

P.S.: Tut schon richtig gut. Ich werde mal noch etwas dran rumbasteln, eventuell kann man es dann auch in die Templates aufnehmen.
Es gibt noch mehr Leute die Enigmalight nutzen ;-)

Gruß und Danke,
Stefan

yersinia

Ich hab das jetzt nur Oberflächlig gesucht (habe weder eine Dreambox noch nutze ich EnigmaLight), aber haben EnigmaLight und Hyperion[NG] nicht eine gleiche/ähnliche Basis? Könnte man denn nicht, in Bezug auf FHEM, Synergien mit Hyperion nutzen?
Neues Modul für Hyperion Server 98_Hyperion.pm
[98_HyperionNG] Hyperion Next Generation Module
viele Grüße, yersinia
----
FHEM 6.3 (SVN) on RPi 4B with RasPi OS Bullseye (perl 5.32.1) | FTUI
nanoCUL->2x868(1x ser2net)@tsculfw, 1x433@Sduino | MQTT2 | Tasmota | ESPEasy
VCCU->14xSEC-SCo, 7xCC-RT-DN, 5xLC-Bl1PBU-FM, 3xTC-IT-WM-W-EU, 1xPB-2-WM55, 1xLC-Sw1PBU-FM, 1xES-PMSw1-Pl

schwatter

Morgen,

keine Ahnung wie die Module aufgebaut sind. Hyperion stellt auch mehrere Arten bereit zu kommunizieren.
Enigmalight kann jetzt per Httprequest gesteuert werden und Status per Json ausgeben. War eine Baustelle vom Entwickler die ich nur zu Ende gebracht habe.
Ob da jetzt ein Modul für gebaut werden muss halte ich fragwürdig.
Im Grunde reicht Httpmod.

Gruß schwatter

schwatter

#5
@stefanru

Hier ein HTTPMOD update. Jetzt erfolgt ein automatisches Update der Readings nach einem set. Danke an @ch.eick für den Hinweis.
Ein paar Readings habe ich in Enigmalight geändert, bzw besser abgestimmt. Das Update bekommst du im BP_Forum per PN. Bitte testen.

defmod Enigmalight HTTPMOD http://192.168.178.13:1414/api/statusinfo 900
attr Enigmalight extractAllJSON 1
attr Enigmalight get01Name Updatelink
attr Enigmalight get01URL http://192.168.178.13:1414/api/statusinfo
attr Enigmalight icon hue_filled_lightstrip
attr Enigmalight room 03.Wohnzimmer_EG
attr Enigmalight set01FollowGet Updatelink
attr Enigmalight set01Hint dynamic,moodlamp,off
attr Enigmalight set01Name enigmalightmode
attr Enigmalight set01TextArg dynamic,moodlamp,off
attr Enigmalight set01URL http://192.168.178.13:1414/control/light?set=$val
attr Enigmalight set02FollowGet Updatelink
attr Enigmalight set02Hint 1,3,4,5
attr Enigmalight set02Max 5
attr Enigmalight set02Min 1
attr Enigmalight set02Name current_mode
attr Enigmalight set02URL http://192.168.178.13:1414/control/option?set=moodlamp_mode&v=$val
attr Enigmalight set03FollowGet Updatelink
attr Enigmalight set03Name option_moodlamp_red
attr Enigmalight set03URL http://192.168.178.13:1414/control/option?set=moodlamp_static_color_r&v=$val
attr Enigmalight set04FollowGet Updatelink
attr Enigmalight set04Name option_moodlamp_green
attr Enigmalight set04URL http://192.168.178.13:1414/control/option?set=moodlamp_static_color_g&v=$val
attr Enigmalight set05FollowGet Updatelink
attr Enigmalight set05Name option_moodlamp_blue
attr Enigmalight set05URL http://192.168.178.13:1414/control/option?set=moodlamp_static_color_b&v=$val
attr Enigmalight set06FollowGet Updatelink
attr Enigmalight set06Name option_moodlamp_brightness
attr Enigmalight set06URL http://192.168.178.13:1414/control/option?set=moodlamp_brightness&v=$val
attr Enigmalight stateFormat Mode: enigmalightmode / Moodlampmode: current_mode
attr Enigmalight subType Light
attr Enigmalight webCmd enigmalightmode:current_mode
attr Enigmalight webCmdLabel EL_Mode:Moodlampmode
attr Enigmalight widgetOverride enigmalightmode:dynamic,moodlamp,off current_mode:1,3,4,5 option_moodlamp_brightness:slider,0,1,255 option_moodlamp_red:slider,0,1,255 option_moodlamp_green:slider,0,1,255 option_moodlamp_blue:slider,0,1,255 moodlamp_brightness:slider,0,1,255

setstate Enigmalight Mode: off / Moodlampmode: 100
setstate Enigmalight 2021-10-23 11:57:17 current_mode 100
setstate Enigmalight 2021-10-23 11:57:17 enigmalightmode off
setstate Enigmalight 2021-10-23 11:57:17 lights_on_off off
setstate Enigmalight 2021-10-23 11:57:17 option_blue 75
setstate Enigmalight 2021-10-23 11:57:17 option_brightness 1.0
setstate Enigmalight 2021-10-23 11:57:17 option_brightnessmax 1.00
setstate Enigmalight 2021-10-23 11:57:17 option_brightnessmin 0.00
setstate Enigmalight 2021-10-23 11:57:17 option_gamma 2.4
setstate Enigmalight 2021-10-23 11:57:17 option_green 35
setstate Enigmalight 2021-10-23 11:57:17 option_moodlamp_blue 143
setstate Enigmalight 2021-10-23 11:57:17 option_moodlamp_brightness 130
setstate Enigmalight 2021-10-23 11:57:17 option_moodlamp_green 75
setstate Enigmalight 2021-10-23 11:57:17 option_moodlamp_red 190
setstate Enigmalight 2021-10-23 11:57:17 option_moodlampmode 1
setstate Enigmalight 2021-10-23 11:57:17 option_red 35
setstate Enigmalight 2021-10-23 11:57:17 option_saturation 1.0
setstate Enigmalight 2021-10-23 11:57:17 option_saturationmax 1.00
setstate Enigmalight 2021-10-23 11:57:17 option_saturationmin 0.00
setstate Enigmalight 2021-10-23 11:57:17 option_speed 35



Gruß schwatter

stefanru

Hi Schwatter,

super ich werde testen und Rückmeldung im BP Forum geben.
Ich denke dann ist mein stateFormat für off/dynamic und moodlamp überflüssig ;-)
{if (ReadingsVal($name,"lights_onoff","") =~ "dynamic") {ReadingsVal($name,"dyna_mood","")} else {ReadingsVal($name,"lights_onoff","")}}

Ich schau es mir auf jeden fall an und gebe Rückmeldung.

Vielen Dank!
Stefan

stefanru

#7
Funktioniert 1A bei mir.

attr Enigmalight subType Light
ging bei mir aber nicht. Woher kommt das? Homebridge?

Vielen Dank,
Stefan

schwatter

#8
Schön  :) ,

ne den subType hab ich ganz banal gesetzt. Zum gruppieren der Typen in meinem Raum Wohnzimmer. Httpmod bietet das auch an, bzw global userattr.

edit:
Ok, mit der Zeit vergisst man schon einiges...
Das kommt daher, das ich in global userattr subType gesetzt habe.

Gruß schwatter

stefanru


stefanru

Hi,

Ich habe ein, zwei Dinge tun müssen damit auch Alexa es steuern kann.
Alles etwas dirty, aber zur Zeit sehe ich keine andere Lösung.

Dirty hin oder her, ich kann auf der Couch mein Enigmalight steuern ohne die Fernbedienung in die Hand nehmen zu müssen. Finde ich richtig cool.
Gibt man eine Farbe vor, wechselt es in den Moodlight Mode und setzt die Farbe.
Sagt man "an" geht der Dynamic Mode an.
Mit "aus" immer aus egal in welchem Modus.

Nochmals vielen Dank an Schwatter und alle anderen die mir hier geholfen haben auch vielen Dank an Pclin und Schwatter für die tolle weiterentwicklung von Enigmalight.

Hier mein Setup für Enigmalight in FHEM und Steuerung per Alexa:

define Enigmalight HTTPMOD http://192.168.69.98:1414/api/statusinfo 900
attr Enigmalight alexaName enigmalight
attr Enigmalight alexaRoom Wohnzimmer
attr Enigmalight extractAllJSON 1
attr Enigmalight genericDeviceType light
attr Enigmalight get01Name Updatelink
attr Enigmalight get01URL http://192.168.69.98:1414/api/statusinfo
attr Enigmalight group Licht
attr Enigmalight homebridgeMapping On=enigmalightmode,valueOn=/dynamic|moodlamp/,cmdOn=enigmalightmode+dynamic,cmdOff=enigmalightmode+off
attr Enigmalight icon hue_filled_lightstrip
attr Enigmalight room Alexa
attr Enigmalight set01FollowGet Updatelink
attr Enigmalight set01Hint dynamic,moodlamp,off
attr Enigmalight set01Name enigmalightmode
attr Enigmalight set01TextArg dynamic,moodlamp,off
attr Enigmalight set01URL http://192.168.69.98:1414/control/light?set=$val
attr Enigmalight set02FollowGet Updatelink
attr Enigmalight set02Hint 1,3,4,5
attr Enigmalight set02Max 5
attr Enigmalight set02Min 1
attr Enigmalight set02Name current_mode
attr Enigmalight set02URL http://192.168.69.98:1414/control/option?set=moodlamp_mode&v=$val
attr Enigmalight set03FollowGet Updatelink
attr Enigmalight set03Name option_moodlamp_red
attr Enigmalight set03URL http://192.168.69.98:1414/control/option?set=moodlamp_static_color_r&v=$val
attr Enigmalight set04FollowGet Updatelink
attr Enigmalight set04Name option_moodlamp_green
attr Enigmalight set04URL http://192.168.69.98:1414/control/option?set=moodlamp_static_color_g&v=$val
attr Enigmalight set05FollowGet Updatelink
attr Enigmalight set05Name option_moodlamp_blue
attr Enigmalight set05URL http://192.168.69.98:1414/control/option?set=moodlamp_static_color_b&v=$val
attr Enigmalight set06FollowGet Updatelink
attr Enigmalight set06Name option_moodlamp_brightness
attr Enigmalight set06URL http://192.168.69.98:1414/control/option?set=moodlamp_brightness&v=$val
attr Enigmalight set07FollowGet Updatelink
attr Enigmalight set07Name rgb
attr Enigmalight set07TextArg hex
attr Enigmalight set07URL http://192.168.69.98:1414/control/option?set=moodlamp_static_color_h&v=$val
attr Enigmalight stateFormat Mode: enigmalightmode / Moodlampmode: current_mode
attr Enigmalight userReadings rgb {ReadingsVal("Enigmalight","option_moodlamp_color_h",0)}
attr Enigmalight webCmd enigmalightmode:current_mode:rgb
attr Enigmalight webCmdLabel EL_Mode:Moodlampmode:option_moodlamp_color_h
attr Enigmalight widgetOverride enigmalightmode:dynamic,moodlamp,off current_mode:1,3,4,5 option_moodlamp_brightness:slider,0,1,255 option_moodlamp_red:slider,0,1,255 option_moodlamp_green:slider,0,1,255 option_moodlamp_blue:slider,0,1,255 option_moodlamp_brightness:slider,0,1,255 rgb:colorpicker,RGB
define Enigmalight_rgb cmdalias set Enigmalight rgb .* AS set Enigmalight enigmalightmode moodlamp;;set Enigmalight rgb $EVTPART2