Integration von Philips Hue, Harmony in fhem

Begonnen von freestyler, 31 Januar 2016, 22:38:49

Vorheriges Thema - Nächstes Thema

freestyler

Hallo,

ich versuche eine HUE Living Colors Lampe über die Haussteuerungstasten der Logitech Harmony Companion zu schalten.
Das funktioniert auch für Ein-Ausschalten sowie Dimmen. Nicht jedoch für das Starten des automatischen Lichtwechsels,
da das bei Konfiguration in der Harmony App nicht angeboten wird.
Den Start des Farbwechsels kann ich jedoch in fhem durch ein notify auf einen dummy Schalter mit Ausführung des 'effect colorloop' erreichen.
Jetzt fehlt mir nur noch, dass ich diesen 'effect colorloop'  nach einem Event der Harmony starte. Im Event Monitor erscheint aber kein Event nach Betätigen der Haussteuerungstasten. Es erscheinen jedoch reichlich Einträge  im log.
Zitat<event xmlns="connect.logitech.com" type="automation.state?notify"><![CDATA[{"hue-00:17:88:01:01:22:3d:8d-0b":{"color":{"xy":{"y":0.3254,"x":0.6435},"mode":"xy","temp":300,"hueSat":{"hue":1644,"sat":207}},"brightness":154,"on":true,"status":0}}]]></event>

Wie kann man an den Event, der bisher nur im Log zusehen ist, herankommen, um diesen dann weiter zu verwenden?

Ich hoffe es hat jemand einen Tipp.

Gruß

freestyler


justme1968

zeig mal bitte alle arten von events die du im log findest.

wie es ausschaut sind das nicht wirklich events die zu den tasten gehören sondern aus irgend einem grund wird etwas über den schaltvorgang der ausgelöst werden soll gesendet.

wenn es hier tatsächlich etwas verwertbares gibt baue ich es ins modul ein.



gruss
  andre
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

https://github.com/sponsors/justme-1968

freestyler

Hallo,

habe mal etwas auf den Haussteuerungstasten herumgedrückt (auch auf einer, die nicht belegt ist) im log steht dann folgendes:


Zitat2016.01.31 22:52:14 4: HarmonyHub: unknown message: <event xmlns="connect.logitech.com" type="vnd.logitech.control/vnd.logitech.button?pressType"><![CDATA[type=short]]></event>
2016.01.31 22:52:14 4: HarmonyHub: unknown message: <event xmlns="connect.logitech.com" type="automation.state?notify"><![CDATA[{"hue-00:17:88:01:01:22:3d:8d-0b":{"color":{"xy":{"y":0.3262,"x":0.6432},"mode":"xy","temp":300,"hueSat":{"hue":1644,"sat":207}},"brightness":154,"on":true,"status":0}}]]></event>
2016.01.31 22:52:18 4: HarmonyHub: unknown message: <event xmlns="connect.logitech.com" type="vnd.logitech.control/vnd.logitech.button?pressType"><![CDATA[type=short]]></event>
2016.01.31 22:52:19 4: HarmonyHub: unknown message: <event xmlns="connect.logitech.com" type="automation.state?notify"><![CDATA[{"hue-00:17:88:01:01:22:3d:8d-0b":{"color":{"xy":{"y":0.3262,"x":0.6432},"mode":"xy","temp":300,"hueSat":{"hue":1644,"sat":207}},"brightness":154,"on":true,"status":0}}]]></event>
2016.01.31 22:52:19 4: HarmonyHub: unknown message: <event xmlns="connect.logitech.com" type="automation.state?notify"><![CDATA[{"hue-00:17:88:01:01:22:3d:8d-0b":{"color":{"xy":{"y":0.3262,"x":0.6432},"mode":"xy","temp":300,"hueSat":{"hue":1644,"sat":207}},"brightness":179,"on":true,"status":0}}]]></event>
2016.01.31 22:52:20 4: HarmonyHub: unknown message: <event xmlns="connect.logitech.com" type="automation.state?notify"><![CDATA[{"hue-00:17:88:01:01:22:3d:8d-0b":{"color":{"xy":{"y":0.3262,"x":0.6432},"mode":"xy","temp":300,"hueSat":{"hue":1644,"sat":207}},"brightness":204,"on":true,"status":0}}]]></event>
2016.01.31 22:52:21 4: HarmonyHub: unknown message: <event xmlns="connect.logitech.com" type="automation.state?notify"><![CDATA[{"hue-00:17:88:01:01:22:3d:8d-0b":{"color":{"xy":{"y":0.3262,"x":0.6432},"mode":"xy","temp":300,"hueSat":{"hue":1644,"sat":207}},"brightness":179,"on":true,"status":0}}]]></event>
2016.01.31 22:52:21 4: HarmonyHub: unknown message: <event xmlns="connect.logitech.com" type="automation.state?notify"><![CDATA[{"hue-00:17:88:01:01:22:3d:8d-0b":{"color":{"xy":{"y":0.3262,"x":0.6432},"mode":"xy","temp":300,"hueSat":{"hue":1644,"sat":207}},"brightness":154,"on":true,"status":0}}]]></event>
2016.01.31 22:52:23 4: HarmonyHub: unknown message: <event xmlns="connect.logitech.com" type="vnd.logitech.harmony/vnd.logitech.control.button?pressType"><![CDATA[type=long]]></event>
2016.01.31 22:52:23 4: HarmonyHub: unknown message: <event xmlns="connect.logitech.com" type="automation.state?notify"><![CDATA[{"hue-00:17:88:01:01:22:3d:8d-0b":{"color":{"xy":{"y":0.3262,"x":0.6432},"mode":"xy","temp":300,"hueSat":{"hue":1644,"sat":207}},"brightness":154,"on":false,"status":0}}]]></event>
2016.01.31 22:52:23 4: HarmonyHub: send: <iq type='get' id='ping-2551'><ping xmlns='urn:xmpp:ping'/></iq>
2016.01.31 22:52:30 4: using HUEBridge_HTTP_Request: GET lights/error
2016.01.31 22:52:30 3: resource, /lights/error, not available
2016.01.31 22:52:35 4: Connection accepted from FHEMWEB:192.168.0.55:58506
2016.01.31 22:52:36 4: FHEMWEB:192.168.0.55:58506 GET /fhem/FileLog_logWrapper?dev=Logfile&type=text&file=fhem-2016-01.log; BUFLEN:0


justme1968

#3
bau mal in 37_harmony.pm nach zeile 982 ein zusätzliches elsif ein so das der block so ausschaut:          if( $content =~ m/type="harmony.engine\?startActivityFinished"/ ) {
            harmony_updateActivity($hash, $decoded->{activityId}) if( defined($decoded->{activityId}) );
                                                                   
          } elsif( $content =~ m/type="automation.state?notify"/ ) {
            DoTrigger( $name, "automation.state: $cdata" );
                                                                   
          } else {                                                 
            Log3 $name, 4, "$name: unknown message: $content"; 
                                                                   
          }

und schau dann im event monitor. darauf solltest du ein notify setzen können.

ich habe gerade keine idee wie man das event besser formatieren kann.

gruss
  andre
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

https://github.com/sponsors/justme-1968

freestyler


rudolfkoenig

ZitatWie kann man an den Event, der bisher nur im Log zusehen ist, herankommen, um diesen dann weiter zu verwenden?

Ab sofort mit dem readLog Feature/Attribut von notify :)

justme1968

stehen die events immer noch im log? dann stimmt mit der änderung noch etwas nicht.

@rudi: das ist aber von hinten durchs knie.

gruss
  andre
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

https://github.com/sponsors/justme-1968

rudolfkoenig

Sicher, aber als kurzfristige Loesung manchmal nueetzlich.
Du darfst natuerlich diesen Fall ordentlich loesen. :)

justme1968

hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

https://github.com/sponsors/justme-1968

freestyler

Ich versuche heute Abend noch mal in Ruhe...

freestyler

Im log steht jetzt folgendes:
Zitat2016.02.01 21:37:01 4: Closing inactive connection FHEMWEB:192.168.0.55:59901
2016.02.01 21:37:01 4: Closing inactive connection FHEMWEB:192.168.0.55:59889
2016.02.01 21:37:26 4: Connection accepted from FHEMWEB:192.168.0.55:59902
2016.02.01 21:37:26 4: FHEMWEB:192.168.0.55:59902 POST /fhem?cmd.HUEDevice1=set%20HUEDevice1%20off&XHR=1&fw_id=149; BUFLEN:0
2016.02.01 21:37:26 4: using HUEBridge_HTTP_Request: PUT lights/1/state
2016.02.01 21:37:26 4: parse status message for HUEDevice1
2016.02.01 21:37:26 4: name: /fhem?cmd.HUEDevice1=set%20HUEDevice1%20off&XHR=1&fw_id=149 / RL:20 / text/plain; charset=UTF-8 / Content-Encoding: gzip
/
2016.02.01 21:37:26 4: FHEMWEB:192.168.0.55:59902 GET /fhem/images/default/off.png; BUFLEN:0
2016.02.01 21:37:26 4: FHEMWEB:192.168.0.55:59902 => 304 Not Modified
2016.02.01 21:37:28 4: FHEMWEB:192.168.0.55:59902 POST /fhem?cmd.HUEDevice1=set%20HUEDevice1%20on&XHR=1&fw_id=149; BUFLEN:0
2016.02.01 21:37:28 4: using HUEBridge_HTTP_Request: PUT lights/1/state
2016.02.01 21:37:28 4: parse status message for HUEDevice1
2016.02.01 21:37:28 4: name: /fhem?cmd.HUEDevice1=set%20HUEDevice1%20on&XHR=1&fw_id=149 / RL:20 / text/plain; charset=UTF-8 / Content-Encoding: gzip
/
2016.02.01 21:38:17 4: using HUEBridge_HTTP_Request: GET config
2016.02.01 21:38:17 4: parse status message for hueBridge
2016.02.01 21:38:40 4: FHEMWEB:192.168.0.55:59902 GET /fhem/FileLog_logWrapper?dev=Logfile&type=text&file=fhem-2016-02.log; BUFLEN:0

justme1968

ich sehe keine log meldung von hub mehr. ist das der richtige ausschnitt aus dem log?

wenn es die events für die lampen nicht mehr gibt muss es etwas im event monitor geben.

der event für die nicht belegte taste muss immer noch da sein.

gruss
  andre
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

https://github.com/sponsors/justme-1968

freestyler

Zwischen 22:10.00 und 22:10:30 habe ich die tasten gedrückt.
Mit der angepassten 37_harmony.pm
Zitat2016.02.01 22:10:01 4: Closing inactive connection FHEMWEB:192.168.0.55:60139
2016.02.01 22:10:01 4: Closing inactive connection FHEMWEB:192.168.0.55:60141
2016.02.01 22:10:25 4: Connection accepted from FHEMWEB:192.168.0.55:60145
2016.02.01 22:10:25 4: FHEMWEB:192.168.0.55:60145 GET /fhem/FileLog_logWrapper?dev=Logfile&type=text&file=fhem-2016-02.log; BUFLEN:0
2016.02.01 22:10:26 4: Connection closed for FHEMWEB:192.168.0.55:60137: EOF
2016.02.01 22:10:26 4: Connection accepted from FHEMWEB:192.168.0.55:60146
2016.02.01 22:10:26 4: Connection accepted from FHEMWEB:192.168.0.55:60147
2016.02.01 22:10:26 4: FHEMWEB:192.168.0.55:60146 GET /fhem/pgm2/style.css; BUFLEN:0
2016.02.01 22:10:26 4: FHEMWEB:192.168.0.55:60146 => 304 Not Modified
2016.02.01 22:10:26 4: FHEMWEB:192.168.0.55:60145 GET /fhem/pgm2/jquery.min.js; BUFLEN:0
2016.02.01 22:10:26 4: FHEMWEB:192.168.0.55:60145 => 304 Not Modified
2016.02.01 22:10:26 4: FHEMWEB:192.168.0.55:60147 GET /fhem/pgm2/jquery-ui.min.css; BUFLEN:0
2016.02.01 22:10:26 4: FHEMWEB:192.168.0.55:60147 => 304 Not Modified
2016.02.01 22:10:26 4: FHEMWEB:192.168.0.55:60145 GET /fhem/pgm2/defaultCommon.css; BUFLEN:0
2016.02.01 22:10:26 4: FHEMWEB:192.168.0.55:60145 => 304 Not Modified
2016.02.01 22:10:26 4: FHEMWEB:192.168.0.55:60146 GET /fhem/pgm2/jquery-ui.min.js; BUFLEN:0
2016.02.01 22:10:26 4: FHEMWEB:192.168.0.55:60146 => 304 Not Modified
2016.02.01 22:10:26 4: FHEMWEB:192.168.0.55:60145 GET /fhem/pgm2/fhemweb_colorpicker.js; BUFLEN:0
2016.02.01 22:10:26 4: FHEMWEB:192.168.0.55:60145 => 304 Not Modified
2016.02.01 22:10:26 4: FHEMWEB:192.168.0.55:60147 GET /fhem/pgm2/fhemweb.js; BUFLEN:0
2016.02.01 22:10:26 4: FHEMWEB:192.168.0.55:60147 => 304 Not Modified
2016.02.01 22:10:26 4: FHEMWEB:192.168.0.55:60145 GET /fhem/pgm2/fhemweb_fbcalllist.js; BUFLEN:0
2016.02.01 22:10:26 4: FHEMWEB:192.168.0.55:60145 => 304 Not Modified
2016.02.01 22:10:26 4: FHEMWEB:192.168.0.55:60146 GET /fhem/pgm2/dashboard_style.css; BUFLEN:0
2016.02.01 22:10:26 4: FHEMWEB:192.168.0.55:60146 => 304 Not Modified
2016.02.01 22:10:26 4: FHEMWEB:192.168.0.55:60145 GET /fhem/pgm2/fhemweb_readingsGroup.js; BUFLEN:0
2016.02.01 22:10:26 4: FHEMWEB:192.168.0.55:60145 => 304 Not Modified
2016.02.01 22:10:26 4: FHEMWEB:192.168.0.55:60147 GET /fhem/pgm2/fhemweb_knob.js; BUFLEN:0
2016.02.01 22:10:26 4: FHEMWEB:192.168.0.55:60147 => 304 Not Modified
2016.02.01 22:10:26 4: FHEMWEB:192.168.0.55:60145 GET /fhem/pgm2/fhemweb_sortable.js; BUFLEN:0
2016.02.01 22:10:26 4: FHEMWEB:192.168.0.55:60145 => 304 Not Modified
2016.02.01 22:10:26 4: FHEMWEB:192.168.0.55:60146 GET /fhem/pgm2/fhemweb_readingsHistory.js; BUFLEN:0
2016.02.01 22:10:26 4: FHEMWEB:192.168.0.55:60146 => 304 Not Modified
2016.02.01 22:10:26 4: FHEMWEB:192.168.0.55:60145 GET /fhem/pgm2/svg.js; BUFLEN:0
2016.02.01 22:10:26 4: FHEMWEB:192.168.0.55:60145 => 304 Not Modified
2016.02.01 22:10:26 4: FHEMWEB:192.168.0.55:60147 GET /fhem/pgm2/fhemweb_uzsu.js; BUFLEN:0
2016.02.01 22:10:26 4: FHEMWEB:192.168.0.55:60147 => 304 Not Modified
2016.02.01 22:10:26 4: FHEMWEB:192.168.0.55:60146 GET /fhem/pgm2/dashboard.js; BUFLEN:0
2016.02.01 22:10:26 4: FHEMWEB:192.168.0.55:60146 => 304 Not Modified
2016.02.01 22:10:26 4: FHEMWEB:192.168.0.55:60146 GET /fhem/images/default/fhemicon.png; BUFLEN:0
2016.02.01 22:10:26 4: FHEMWEB:192.168.0.55:60146 => 304 Not Modified
2016.02.01 22:10:27 4: FHEMWEB:192.168.0.55:60146 GET /fhem/FileLog_logWrapper?XHR=1&inform=type=status;filter=;since=1454361024;fmt=JSON&fw_id=181×tamp=1454361094957; BUFLEN:0
2016.02.01 22:10:49 4: Connection closed for FHEMWEB:192.168.0.55:60146: EOF
2016.02.01 22:10:56 4: FHEMWEB:192.168.0.55:60147 GET /fhem/FileLog_logWrapper?dev=Logfile&type=text&file=fhem-2016-

freestyler

jetzt spiele ich die Original 37_harmony.pm wieder ein und reboote...

justme1968

und was steht während dessen im event monitor ?
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

https://github.com/sponsors/justme-1968