Neues Modul PHTV für Philips Fernseher (inkl. Ambilight)

Begonnen von Loredo, 06 März 2014, 22:09:17

Vorheriges Thema - Nächstes Thema

kurt6908

Hallo Loredo,

ich habe nun meine eigenen Attribute gelöscht.

Ein "get TV power" bringt ein "Off", obwohl TV an ist. In der Attributliste finden sich keine zusätzlichen Authentifizierungswerte wie z.B. device-id oder auth-key.

Im Logfile steht mit "verbose 5" Folgendes:

2017.02.19 11:28:29 5: PHTV TV: called function PHTV_GetStatus()
2017.02.19 11:28:29 5: PHTV TV: called function PHTV_SendCommand()
2017.02.19 11:28:29 5: PHTV TV: API command 'audio/volume' not supported by device.

Gruß

Kurt
3* Raspberry Pi (2 über LTE/VPN), 5* Cul, 3* FS20, 4* FHT, 6* HM, Somfy, Solarlog, WMBus/EnergyCam, AVM FritzBox, 3* AVM Powerline, Alexa, Tasmota/MQTT, Rademacher DuoFern, EPEver HiPower/ModBus, go-eCharger

Loredo

Logischerweise wäre ein Log bei verbose=5 für den Set-Befehl "statusRequest" hilfreich... ::)
Hat meine Arbeit dir geholfen? ⟹ https://paypal.me/pools/c/8gDLrIWrG9

Maintainer:
FHEM-Docker Image, https://github.com/fhem, Astro(Co-Maintainer), ENIGMA2, GEOFANCY, GUEST, HP1000, Installer, LaMetric2, MSG, msgConfig, npmjs, PET, PHTV, Pushover, RESIDENTS, ROOMMATE, search, THINKINGCLEANER

SmartHome

Zitat von: Loredo am 18 Februar 2017, 15:53:17

Das konnte ich bei mir leider nicht reproduzieren.

Hallo Loredo, danke fürs Feedback. Das Modul hat seit dem 17.Februar Abends anscheint nicht mehr funktioniert und die LivingColors wurden über die Bridge und nicht mehr über ambiHue gesteuert.

Seit dem Update heute morgen funktioniert alles wieder perfekt :-)

Geniales Modul

kurt6908

Hallo Loredo,

null problemo....und es schaut besser aus:

set TV statusRequest:

2017.02.19 11:48:01 5: PHTV NN: called function PHTV_Set()
2017.02.19 11:48:01 5: PHTV NN: called function PHTV_Set()
2017.02.19 11:48:01 5: PHTV NN: called function PHTV_Get()
2017.02.19 11:48:07 5: PHTV NN: called function PHTV_Set()
2017.02.19 11:48:07 5: PHTV NN: called function PHTV_Set()
2017.02.19 11:48:07 5: PHTV NN: called function PHTV_Get()
2017.02.19 11:48:23 5: PHTV NN: called function PHTV_Set()
2017.02.19 11:48:23 3: PHTV set NN statusRequest
2017.02.19 11:48:23 5: PHTV NN: called function PHTV_GetStatus()
2017.02.19 11:48:23 5: PHTV NN: called function PHTV_SendCommand()
2017.02.19 11:48:23 4: PHTV NN: REQ audio/volume
2017.02.19 11:48:23 5: PHTV NN: GET https://192.168.69.48:1926/6/audio/volume
2017.02.19 11:48:23 5: PHTV NN: called function PHTV_Set()
2017.02.19 11:48:23 5: PHTV NN: called function PHTV_Set()
2017.02.19 11:48:23 5: PHTV NN: called function PHTV_Get()
2017.02.19 11:48:23 5: PHTV NN: called function PHTV_ReceiveCommand()
2017.02.19 11:48:23 5: PHTV NN: called function PHTV_SendCommand()
2017.02.19 11:48:23 4: PHTV NN: REQ pair/request/{"app_name":"FHEM PHTV","device_name":"fhem","app_id":"org.fhem.PHTV","device_os":"Android","id":"CAGvcuR0UjZKBwNr","type":"native","scope":["read","write","control"]}
2017.02.19 11:48:23 5: PHTV NN: GET https://192.168.69.48:1926/6/pair/request (#HASH)
2017.02.19 11:48:24 5: PHTV NN: called function PHTV_ReceiveCommand()
2017.02.19 11:48:24 4: PHTV NN: RCV TIMEOUT pair/request
2017.02.19 11:48:24 4: PHTV NN: API command 'pair/request' not supported by device.
2017.02.19 11:48:24 5: PHTV NN: called function PHTV_Set()
2017.02.19 11:48:29 5: PHTV NN: called function PHTV_Set()
2017.02.19 11:48:29 5: PHTV NN: called function PHTV_Set()
2017.02.19 11:48:29 5: PHTV NN: called function PHTV_Get()
2017.02.19 11:49:06 5: PHTV NN: called function PHTV_Set()
2017.02.19 11:49:08 5: PHTV NN: called function PHTV_GetStatus()
2017.02.19 11:49:08 5: PHTV NN: called function PHTV_SendCommand()
2017.02.19 11:49:08 4: PHTV NN: REQ audio/volume
2017.02.19 11:49:08 5: PHTV NN: GET https://192.168.69.48:1926/6/audio/volume
2017.02.19 11:49:08 5: PHTV NN: called function PHTV_SendCommand()
2017.02.19 11:49:08 4: PHTV NN: REQ system
2017.02.19 11:49:08 5: PHTV NN: GET https://192.168.69.48:1926/6/system
2017.02.19 11:49:08 5: PHTV NN: called function PHTV_SendCommand()
2017.02.19 11:49:08 4: PHTV NN: REQ ambilight/topology
2017.02.19 11:49:08 5: PHTV NN: GET https://192.168.69.48:1926/6/ambilight/topology
2017.02.19 11:49:08 5: PHTV NN: called function PHTV_SendCommand()
2017.02.19 11:49:08 4: PHTV NN: REQ ambilight/mode
2017.02.19 11:49:08 5: PHTV NN: GET https://192.168.69.48:1926/6/ambilight/mode
2017.02.19 11:49:08 5: PHTV NN: called function PHTV_SendCommand()
2017.02.19 11:49:08 4: PHTV NN: REQ sources
2017.02.19 11:49:08 5: PHTV NN: GET https://192.168.69.48:1926/6/sources
2017.02.19 11:49:08 5: PHTV NN: called function PHTV_SendCommand()
2017.02.19 11:49:08 4: PHTV NN: REQ channels
2017.02.19 11:49:08 5: PHTV NN: GET https://192.168.69.48:1926/6/channels
2017.02.19 11:49:09 5: PHTV NN: called function PHTV_ReceiveCommand()
2017.02.19 11:49:09 5: PHTV NN: called function PHTV_SendCommand()
2017.02.19 11:49:09 5: PHTV NN: API command 'pair/request' not supported by device.
2017.02.19 11:49:09 5: PHTV NN: called function PHTV_Set()
2017.02.19 11:49:09 5: PHTV NN: called function PHTV_ReceiveCommand()
2017.02.19 11:49:09 5: PHTV NN: called function PHTV_SendCommand()
2017.02.19 11:49:09 5: PHTV NN: API command 'pair/request' not supported by device.
2017.02.19 11:49:09 5: PHTV NN: called function PHTV_Set()
2017.02.19 11:49:09 5: PHTV NN: called function PHTV_ReceiveCommand()
2017.02.19 11:49:09 5: PHTV NN: called function PHTV_SendCommand()
2017.02.19 11:49:09 5: PHTV NN: API command 'pair/request' not supported by device.
2017.02.19 11:49:09 5: PHTV NN: called function PHTV_Set()
2017.02.19 11:49:09 5: PHTV NN: called function PHTV_ReceiveCommand()
2017.02.19 11:49:09 4: PHTV NN: RCV channels
2017.02.19 11:49:09 5: PHTV NN: RES ERROR 404 channels
<html>
<head>
   <title>Status page</title>
</head>
<body style="font-family: sans-serif;">
<p style="font-size: 1.2em;font-weight: bold;margin: 1em 0px;">Not Found</p>
<p>The server has not found anything matching the request URI</p>
<p>You can get technical details <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5">here</a>.<br>
Please continue your visit at our <a href="/">home page</a>.
</p>
</body>
</html>

2017.02.19 11:49:09 4: PHTV NN: API command 'channels' not supported by device.
2017.02.19 11:49:09 5: PHTV NN: called function PHTV_ReceiveCommand()
2017.02.19 11:49:09 4: PHTV NN: RCV sources
2017.02.19 11:49:09 5: PHTV NN: RES ERROR 404 sources
<html>
<head>
   <title>Status page</title>
</head>
<body style="font-family: sans-serif;">
<p style="font-size: 1.2em;font-weight: bold;margin: 1em 0px;">Not Found</p>
<p>The server has not found anything matching the request URI</p>
<p>You can get technical details <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5">here</a>.<br>
Please continue your visit at our <a href="/">home page</a>.
</p>
</body>
</html>

2017.02.19 11:49:09 4: PHTV NN: API command 'sources' not supported by device.
2017.02.19 11:49:09 5: PHTV NN: called function PHTV_ReceiveCommand()
2017.02.19 11:49:09 4: PHTV NN: RCV system
2017.02.19 11:49:09 5: PHTV NN: RES system
{"menulanguage":"German","name":"NN","country":"Germany","serialnumber_encrypted":"9Ujg7qk0jWyPF7opK7RsswTePRBq6dZTCFwUIgF\/Q94=\n","softwareversion_encrypted":"mCOnRshweMpSjXKxwNxJ7h+5VzkcYTUeqY70o6lZyWE=\n","model_encrypted":"DWxvf4moWe49A7uQOri7\/LcObzUIvy9HNxMoMMp1gdE=\n","deviceid_encrypted":"rkhmRw5JDPqaZ9h2yQoOdrj\/j26uyo288XumhKsG9Ck=\n","nettvversion":"6.0.2","epgsource":"one","api_version":{"Major":6,"Minor":2,"Patch":0},"featuring":{"jsonfeatures":{"editfavorites":["TVChannels","SatChannels"],"recordings":["List","Schedule","Manage"],"ambilight":["LoungeLight","Hue","Ambilight"],"menuitems":["Setup_Menu"],"textentry":["context_based","initial_string_available","editor_info_available"],"applications":["TV_Apps","TV_Games","TV_Settings"],"pointer":["not_available"],"inputkey":["key"],"activities":["intent"],"channels":["preset_string"],"mappings":["server_mapping"]},"systemfeatures":{"tvtype":"consumer","content":["dmr","dms_tad"],"tvsearch":"intent","pairing_type":"digest_auth_pairing","secured_transport":"true"}}}
2017.02.19 11:49:09 5: PHTV NN: called function PHTV_Set()
2017.02.19 11:49:09 5: PHTV NN: called function PHTV_Set()
2017.02.19 11:49:09 5: PHTV NN: called function PHTV_Set()
2017.02.19 11:49:09 5: PHTV NN: called function PHTV_Get()
2017.02.19 11:49:09 5: PHTV NN: called function PHTV_Set()
2017.02.19 11:49:21 5: PHTV NN: called function PHTV_Set()
2017.02.19 11:49:21 5: PHTV NN: called function PHTV_Set()
2017.02.19 11:49:21 5: PHTV NN: called function PHTV_Get()


- TV steht auf grün und ein "get TV power" ergibt ein in
- (nur) die "device_id" erscheint bei den Attributen
- In den Readings wird z.B. auch der Systemname richtig angezeigt

Schaut doch schon richtig gut aus..

Hier die Readings (aktuelle Werte von 2017-02-19 11:48:24):

ambiHue

off

2017-02-19 09:46:24
ambiLEDLayers

0

2017-01-23 12:40:09
ambiMode

internal

2017-01-23 12:40:07
bri

0

2017-01-23 12:40:07
channel

-

2017-01-23 12:40:07
channelList

-,

2017-01-23 12:40:07
country

Germany

2017-02-19 11:49:09
currentMedia

-

2017-01-23 12:40:07
frequency

-

2017-01-23 12:40:07
hue

0

2017-01-23 12:40:07
input

-

2017-01-23 12:40:07
inputList


2017-01-23 12:40:01
language

German

2017-02-19 11:49:09
level

0 %

2017-01-23 12:40:07
model

0

2017-01-23 12:40:09
mute

-

2017-01-23 12:40:07
onid

-

2017-01-23 12:40:07
pct

0

2017-01-23 12:40:07
power

on

2017-02-19 11:48:23
presence

present

2017-02-18 12:16:23
receiveMode

-

2017-01-23 12:40:07
rgb

000000

2017-01-23 12:40:07
sat

0

2017-01-23 12:40:07
servicename

-

2017-01-23 12:40:07
sid

-

2017-01-23 12:40:07
softwareversion

0

2017-01-23 12:40:09
state

on

2017-02-19 11:49:09
stateAV

on

2017-02-19 11:48:24
systemname

TV

2017-02-19 11:49:09
tsid

-

2017-01-23 12:40:07
volume

-

2017-01-23 12:40:07
volumeStraight

-

2017-01-23 12:40:07


Gruß

Kurt
3* Raspberry Pi (2 über LTE/VPN), 5* Cul, 3* FS20, 4* FHT, 6* HM, Somfy, Solarlog, WMBus/EnergyCam, AVM FritzBox, 3* AVM Powerline, Alexa, Tasmota/MQTT, Rademacher DuoFern, EPEver HiPower/ModBus, go-eCharger

Loredo

#304
Zitat von: kurt6908 am 19 Februar 2017, 12:00:05

2017.02.19 11:48:23 4: PHTV NN: REQ pair/request/{"app_name":"FHEM PHTV","device_name":"fhem","app_id":"org.fhem.PHTV","device_os":"Android","id":"CAGvcuR0UjZKBwNr","type":"native","scope":["read","write","control"]}
2017.02.19 11:48:23 5: PHTV NN: GET https://192.168.69.48:1926/6/pair/request (#HASH)
2017.02.19 11:48:24 5: PHTV NN: called function PHTV_ReceiveCommand()
2017.02.19 11:48:24 4: PHTV NN: RCV TIMEOUT pair/request
2017.02.19 11:48:24 4: PHTV NN: API command 'pair/request' not supported by device.


Der TV lehnt hier den Verbindungsaufbau womöglich schon auf TCP Ebene ab. Da ich keinen solchen TV habe, kann ich selbsts nichts weiter testen.
Du siehst ja, was geschickt wird und kannst das mit deinem Script mal nachstellen und ggf. in 70_PHTV.pm die entsprechenden Zeilen anpassen. Wenn es da Erkenntnisse gibt, baue ich die gerne ein.


Übrigens sind die get-Befehle hier vollkommen unbedeutend und es empfiehlt sich mit einem frischen, leeren FHEM-PHTV-Device zu testen, welches noch nicht gepairt wurde.
Hat meine Arbeit dir geholfen? ⟹ https://paypal.me/pools/c/8gDLrIWrG9

Maintainer:
FHEM-Docker Image, https://github.com/fhem, Astro(Co-Maintainer), ENIGMA2, GEOFANCY, GUEST, HP1000, Installer, LaMetric2, MSG, msgConfig, npmjs, PET, PHTV, Pushover, RESIDENTS, ROOMMATE, search, THINKINGCLEANER

Loredo

#305
Ich habe jetzt nochmals die Reihenfolge bei der Verarbeitung der Antworten auf die Pairing Anfragen abgeändert und ein erweitertes Logging eingebaut.
Entweder morgen per Update verfügbar oder alternativ hier die Datei downloaden und in /opt/fhem/FHEM ersetzen.
Hat meine Arbeit dir geholfen? ⟹ https://paypal.me/pools/c/8gDLrIWrG9

Maintainer:
FHEM-Docker Image, https://github.com/fhem, Astro(Co-Maintainer), ENIGMA2, GEOFANCY, GUEST, HP1000, Installer, LaMetric2, MSG, msgConfig, npmjs, PET, PHTV, Pushover, RESIDENTS, ROOMMATE, search, THINKINGCLEANER

kurt6908

Hallo Loredo,

hier ist der Hash in der ersten Anfrage in "gedumpter" Form aus meinem Perlscript,  welches problemlos funtkioniert:

Perl-Script (dumper):
$VAR1 = '{"device":{"app_name":"ApplicationName","device_name":"heliotrope","app_id":"app.id","device_os":"Android","id":"svpTVfNCQkxue6Cr","type":"native"},"scope":["read","write","control"]}';

Dein Modul PHTV:
{"app_name":"FHEM PHTV","device_name":"fhem","app_id":"org.fhem.PHTV","device_os":"Android","id":"Mtjhhlv3YsylllyF","type":"native","scope":["read","write","control"]}

Unterschied:
Der Hash besteht aus 2*2 Paaren. Bei Dir fehlt beim ersten Paar der Schlüssel "device", es ist nur der erste Wert enthalten.

Hier mein Log nach einem kompletten Neuanlegen des Device mit verbose 5:
2017.02.19 15:42:29 5: PHTV NN: called function PHTV_GetStatus()
2017.02.19 15:42:29 5: PHTV NN: called function PHTV_SendCommand()
2017.02.19 15:42:29 4: PHTV NN: REQ audio/volume
2017.02.19 15:42:29 5: PHTV NN: GET https://192.168.69.48:1926/6/audio/volume
2017.02.19 15:42:29 5: PHTV NN: called function PHTV_ReceiveCommand()
2017.02.19 15:42:29 5: PHTV NN: called function PHTV_SendCommand()
2017.02.19 15:42:29 4: PHTV NN: REQ pair/request/{"app_name":"FHEM PHTV","device_name":"fhem","app_id":"org.fhem.PHTV","device_os":"Android","id":"Mtjhhlv3YsylllyF","type":"native","scope":["read","write","control"]}
2017.02.19 15:42:29 5: PHTV NN: GET https://192.168.69.48:1926/6/pair/request (#HASH)
2017.02.19 15:42:29 5: PHTV NN: called function PHTV_Set()
2017.02.19 15:42:29 5: PHTV NN: called function PHTV_ReceiveCommand()
2017.02.19 15:42:29 4: PHTV NN: ERROR/0 - Pairing not supported
   https://192.168.69.48:1926/6/pair/request: empty answer received
2017.02.19 15:42:29 5: PHTV NN: called function PHTV_Set()PeichlTV2: GET https://192.168.69.48:1926/6/pair/request (#HASH)
2017.02.19 15:42:29 5: PHTV PeichlTV2: called function PHTV_Set()
2017.02.19 15:42:29 5: PHTV PeichlTV2: called function PHTV_ReceiveCommand()
2017.02.19 15:42:29 4: PHTV PeichlTV2: ERROR/0 - Pairing not supported
   https://192.168.69.48:1926/6/pair/request: empty answer received
2017.02.19 15:42:29 5: PHTV PeichlTV2: called function PHTV_Set()

Den "GetStatus" habe ich manuell in der FHEM-Kommandozeile mit "set TV getstatus" ausgeführt, nach dem Neuanlegen war kein entsprechender FHM-GUI-Eintrag da. Nach dem Ausführen ist der GUI-Eintrag für "set TV pin xxx" erschienen, aber leider nix auf dem Fernseher (was ja nachvollziehbar ist)

Gruß

Kurt
3* Raspberry Pi (2 über LTE/VPN), 5* Cul, 3* FS20, 4* FHT, 6* HM, Somfy, Solarlog, WMBus/EnergyCam, AVM FritzBox, 3* AVM Powerline, Alexa, Tasmota/MQTT, Rademacher DuoFern, EPEver HiPower/ModBus, go-eCharger

Loredo

Danke, die Struktur ist aus dem Code leider schwer zu entziffern...


Commit 13450 sollte das korrigieren.
Hat meine Arbeit dir geholfen? ⟹ https://paypal.me/pools/c/8gDLrIWrG9

Maintainer:
FHEM-Docker Image, https://github.com/fhem, Astro(Co-Maintainer), ENIGMA2, GEOFANCY, GUEST, HP1000, Installer, LaMetric2, MSG, msgConfig, npmjs, PET, PHTV, Pushover, RESIDENTS, ROOMMATE, search, THINKINGCLEANER

kurt6908

Hallo Loredo,

Erfolg zmindest teilweise!

Der erste Aufruf funktioniert, am TV erscheint eine PIN zum Eingeben.

Ich habe die PIN auch eingeben und FHEM hat angezeigt, dass das Pairing erfolgreich war:

Zitat2017.02.19 17:11:54 3: PHTV set PhilipsTV statusRequest
2017.02.19 17:11:54 5: PHTV PhilipsTV: called function PHTV_GetStatus()
2017.02.19 17:11:54 5: PHTV PhilipsTV: called function PHTV_SendCommand()
2017.02.19 17:11:54 4: PHTV PhilipsTV: REQ audio/volume
2017.02.19 17:11:54 5: PHTV PhilipsTV: GET https://192.168.69.48:1926/6/audio/volume
2017.02.19 17:11:55 5: PHTV PhilipsTV: called function PHTV_ReceiveCommand()
2017.02.19 17:11:55 5: PHTV PhilipsTV: called function PHTV_SendCommand()
2017.02.19 17:11:55 4: PHTV PhilipsTV: REQ pair/request/{"device":{"app_name":"FHEM PHTV","device_name":"fhem","app_id":"org.fhem.PHTV","device_os":"Android","id":"3U497QzSwPIJDuu7","type":"native"},"scope":["read","write","control"]}
2017.02.19 17:11:55 5: PHTV PhilipsTV: GET https://192.168.69.48:1926/6/pair/request (#HASH)
2017.02.19 17:11:55 5: PHTV PhilipsTV: called function PHTV_ReceiveCommand()
2017.02.19 17:11:55 3: PHTV PhilipsTV: 200 - Pairing enabled
2017.02.19 17:12:08 5: PHTV PhilipsTV: called function PHTV_Set()
2017.02.19 17:12:11 5: PHTV PhilipsTV: called function PHTV_Set()
2017.02.19 17:12:11 5: PHTV PhilipsTV: called function PHTV_Set()
2017.02.19 17:12:11 5: PHTV PhilipsTV: called function PHTV_Get()
2017.02.19 17:12:15 5: PHTV PhilipsTV: called function PHTV_Set()
2017.02.19 17:12:16 5: PHTV PhilipsTV: called function PHTV_SendCommand()
2017.02.19 17:12:16 4: PHTV PhilipsTV: REQ pair/grant/{"auth":{"pin":"5681","auth_signature":"8947e18ba2ce5e9f1947436cf0c407b8d88b6d6e","auth_timestamp":27495,"auth_AppId":1},"device":{"app_name":"FHEM PHTV","device_name":"fhem","app_id":"org.fhem.PHTV","device_os":"Android","id":"3U497QzSwPIJDuu7","type":"native"}}
2017.02.19 17:12:16 5: PHTV PhilipsTV: GET https://3U497QzSwPIJDuu7:8c6eed9356c424f15cb02b5f85550cb7705f08fdaf8e2ff66d1c3164ef75ee5b@192.168.69.48:1926/6/pair/grant (#HASH)
2017.02.19 17:12:16 5: PHTV PhilipsTV: called function PHTV_Set()
2017.02.19 17:12:16 5: PHTV PhilipsTV: called function PHTV_Set()
2017.02.19 17:12:16 5: PHTV PhilipsTV: called function PHTV_Get()
2017.02.19 17:12:16 5: PHTV PhilipsTV: called function PHTV_ReceiveCommand()

Aber:

1.) Für weitere Tests bräuchte ich den zurückgelieferten "auth_key" aus dem ersten Pairing-Post, eventuell in den FHEM-Atrributen, dann kann ich gegen mein Perl-Script testen

2.) Ich glaube der Wert für "auth_signature" im zweiten Hash im zweiten Pairing-Post ist falsch.
Hier muss die Verkettung von "authtimestamp" (aus dem ersten response) und pin (aus der Eingbabe) mit den SecretKey verschlüsselt werden:
- hmac_sha1_hex - Verschlüsselung
- dann den Wert encode_base64
- dann sollte "auth_signature" rauskommen, die dann im zweiten post übergeben wird.

Wenn Du im verbose 5 mal authtimestamp und auth_key, also den Response aus dem ersten post ausgibst, dann kann ich mit meinem Script das richtige "auth_signature" berechnen, solltest Du es nicht aus obigen Perl-Script rauslesen können (sorry für meine komplizierte Programmierung, aber ich kann es nicht anders; dafür steige ich in Deinem Modul nicht durch ;=) aber gemeinsam schaffen wir es )

3.) Die folgenden Datenabfragen und -änderungen müssen mit den kompletten credentials erfolgen, eine Basic Authentifizierung oder User und Passwort in der URL funktionieren nicht.

Gruß

Kurt


3* Raspberry Pi (2 über LTE/VPN), 5* Cul, 3* FS20, 4* FHT, 6* HM, Somfy, Solarlog, WMBus/EnergyCam, AVM FritzBox, 3* AVM Powerline, Alexa, Tasmota/MQTT, Rademacher DuoFern, EPEver HiPower/ModBus, go-eCharger

Loredo

#309
Hat meine Arbeit dir geholfen? ⟹ https://paypal.me/pools/c/8gDLrIWrG9

Maintainer:
FHEM-Docker Image, https://github.com/fhem, Astro(Co-Maintainer), ENIGMA2, GEOFANCY, GUEST, HP1000, Installer, LaMetric2, MSG, msgConfig, npmjs, PET, PHTV, Pushover, RESIDENTS, ROOMMATE, search, THINKINGCLEANER

SmartHome

Zitat von: SmartHome am 19 Februar 2017, 11:54:12
Seit dem Update heute morgen funktioniert alles wieder perfekt :-)

Nach erneutem Einschalten behauptet das Modul dass mein Fernseher kein Ambilight unterstüzt "Device does not seem to support Ambilight "
Sonst funktioniert aber alles. Werde es mit dem Update morgen nochals versuchen

kurt6908

Hallo Loredo,

PERFEKT !!!!

Pairing funktioniert:

- PIN wird am TV angezeigt
- PIN kann eingegeben werden
- auth_signature ist korrekt, wird durch mein Script auch so berechnet.
- auth_key und device_id werden in den Attributen angezeigt
- Mit den angezeigten auth_key und device_id kann ich mit meinem Perl-Script (siehe anderen Beitrag) einige Werte abfragen und TV ausschalten

Nach meiner Ansicht muss jetzt nur noch die Abfrage und die Werteänderung auf

credentials($config{'address'}.':1926', 'XTV', $config{'device_id'} => $config{'auth_key'});

umgestellt werden.

Einen Wunsch hätte ich noch:
Wäre es möglich dass nach einem "set TV statusRequest" und wenn ein Pairing nötig ist, die Pin-Eingabe nicht mit einen set im GUI gemacht wird, sondern mit einem Pop-Up? Nachdem da ein Timeout (siehe erster Request) dahinter steht, wäre es mit dem Pop-Up auffälliger.

Hier der aktuelle Log-Auszug:

2017.02.19 18:39:33 5: PHTV PhilipsTV: called function PHTV_GetStatus()
2017.02.19 18:39:33 5: PHTV PhilipsTV: called function PHTV_SendCommand()
2017.02.19 18:39:33 5: PHTV PhilipsTV: API command 'audio/volume' not supported by device.
2017.02.19 18:39:38 5: PHTV PhilipsTV: called function PHTV_Set()
2017.02.19 18:39:38 3: PHTV set PhilipsTV statusRequest
2017.02.19 18:39:38 5: PHTV PhilipsTV: called function PHTV_GetStatus()
2017.02.19 18:39:38 5: PHTV PhilipsTV: called function PHTV_SendCommand()
2017.02.19 18:39:38 4: PHTV PhilipsTV: REQ audio/volume
2017.02.19 18:39:38 5: PHTV PhilipsTV: GET https://192.168.69.48:1926/6/audio/volume
2017.02.19 18:39:38 5: PHTV PhilipsTV: called function PHTV_Set()
2017.02.19 18:39:38 5: PHTV PhilipsTV: called function PHTV_ReceiveCommand()
2017.02.19 18:39:38 5: PHTV PhilipsTV: called function PHTV_SendCommand()
2017.02.19 18:39:38 4: PHTV PhilipsTV: REQ pair/request/{"device":{"app_name":"FHEM PHTV","device_name":"fhem","app_id":"org.fhem.PHTV","device_os":"Android","id":"OJjcn7gLCVEgsYq8","type":"native"},"scope":["read","write","control"]}
2017.02.19 18:39:38 5: PHTV PhilipsTV: GET https://192.168.69.48:1926/6/pair/request (#HASH)
2017.02.19 18:39:38 5: PHTV PhilipsTV: called function PHTV_ReceiveCommand()
2017.02.19 18:39:39 3: PHTV PhilipsTV: 200 - Pairing enabled
2017.02.19 18:39:39 5: PHTV PhilipsTV: called function PHTV_Set()
2017.02.19 18:39:52 5: PHTV PhilipsTV: called function PHTV_Set()
2017.02.19 18:39:52 5: PHTV PhilipsTV: called function PHTV_Set()
2017.02.19 18:39:52 5: PHTV PhilipsTV: called function PHTV_Get()
2017.02.19 18:39:58 5: PHTV PhilipsTV: called function PHTV_Set()
2017.02.19 18:39:58 5: PHTV PhilipsTV: called function PHTV_SendCommand()
2017.02.19 18:39:58 4: PHTV PhilipsTV: REQ pair/grant/{"auth":{"pin":"3832","auth_signature":"ODYzMTJkYTQ2MGNkZjY2MDdiYzhlYzg4NmEyMjUyMmQ3Y2E5ZGJiNg==","auth_timestamp":32758,"auth_AppId":1},"device":{"app_name":"FHEM PHTV","device_name":"fhem","app_id":"org.fhem.PHTV","device_os":"Android","id":"OJjcn7gLCVEgsYq8","type":"native"}}
2017.02.19 18:39:58 5: PHTV PhilipsTV: GET https://OJjcn7gLCVEgsYq8:3e1b792515145e1e3fc066ad880d0cbafa50f4582824e68c153e12a9edbe132e@192.168.69.48:1926/6/pair/grant (#HASH)
2017.02.19 18:39:58 5: PHTV PhilipsTV: called function PHTV_Set()
2017.02.19 18:39:58 5: PHTV PhilipsTV: called function PHTV_Set()
2017.02.19 18:39:58 5: PHTV PhilipsTV: called function PHTV_Get()
2017.02.19 18:39:59 5: PHTV PhilipsTV: called function PHTV_ReceiveCommand()
2017.02.19 18:39:59 3: PHTV PhilipsTV: 200 - Pairing successful
2017.02.19 18:39:59 5: PHTV PhilipsTV: called function PHTV_Set()
2017.02.19 18:40:02 5: PHTV PhilipsTV: called function PHTV_GetStatus()
2017.02.19 18:40:02 5: PHTV PhilipsTV: called function PHTV_SendCommand()
2017.02.19 18:40:02 4: PHTV PhilipsTV: REQ audio/volume
2017.02.19 18:40:02 5: PHTV PhilipsTV: GET https://OJjcn7gLCVEgsYq8:3e1b792515145e1e3fc066ad880d0cbafa50f4582824e68c153e12a9edbe132e@192.168.69.48:1926/6/audio/volume
2017.02.19 18:40:02 5: PHTV PhilipsTV: called function PHTV_ReceiveCommand()
2017.02.19 18:40:02 4: PHTV PhilipsTV: RCV audio/volume
2017.02.19 18:40:02 5: PHTV PhilipsTV: RES ERROR/403 audio/volume
<html>
<head>
   <title>Status page</title>
</head>
<body style="font-family: sans-serif;">
<p style="font-size: 1.2em;font-weight: bold;margin: 1em 0px;">Forbidden</p>
<p>The server understood the request, but is refusing to fulfill it</p>
<p>You can get technical details <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.4">here</a>.<br>
Please continue your visit at our <a href="/">home page</a>.
</p>
</body>
</html>

2017.02.19 18:40:02 4: PHTV PhilipsTV: API command 'audio/volume' not supported by device.


Gruß

Kurt
3* Raspberry Pi (2 über LTE/VPN), 5* Cul, 3* FS20, 4* FHT, 6* HM, Somfy, Solarlog, WMBus/EnergyCam, AVM FritzBox, 3* AVM Powerline, Alexa, Tasmota/MQTT, Rademacher DuoFern, EPEver HiPower/ModBus, go-eCharger

akr1983

Hallo,

erstmal danke für eure fleißige Coderei. Ich hab versucht auch zwischendurch mich durchzufummeln, aber dafür reichen meine Programmierkenntnisse einfach nicht mehr.

Ich wollte nur mal feedback geben. Ich bekomme das Pairing (zumindest aus FHEM) nicht hin. Im Log steht immer nur, dass er keine SSL Verbindung aufbauen kann da er das Zertifikat nicht prüfen kann. Also evtl. fehlt dort noch irgendwo die Option, dass er die Zertifikate NICHT prüfen soll.

Wenn benötigt, kann ich gerne auch das Logfile dazu posten.

kurt6908

Hallo,

im Perl-Script gibt es dazu den Aufruf

LWP::UserAgent->new(ssl_opts => { verify_hostname => 0 });

Entsprechendes muß auch ins Modul eingebaut werden.

P.S.: Was mich nur wundert, warum bei mir kein entsprechender Fehler in FHEM kommt  ??? .... im Perl-Script kam der Fehler auch, daher dort der obige Eintrag.

Gruß

Kurt
3* Raspberry Pi (2 über LTE/VPN), 5* Cul, 3* FS20, 4* FHT, 6* HM, Somfy, Solarlog, WMBus/EnergyCam, AVM FritzBox, 3* AVM Powerline, Alexa, Tasmota/MQTT, Rademacher DuoFern, EPEver HiPower/ModBus, go-eCharger

Loredo

Zitat von: kurt6908 am 20 Februar 2017, 08:50:14
LWP::UserAgent->new(ssl_opts => { verify_hostname => 0 });

Entsprechendes muß auch ins Modul eingebaut werden.


Das Modul verwendet Fhem's HttpUtils, welche IO::Socket::SSL verwenden. Soweit ich weiß gibt es da unterschiedliche Standardverhalten je nach Perl Version.
Ich habe im Modul einen entsprechendes SSL Argument ergänzt.


Zitat von: kurt6908 am 19 Februar 2017, 18:58:19
Nach meiner Ansicht muss jetzt nur noch die Abfrage und die Werteänderung auf

credentials($config{'address'}.':1926', 'XTV', $config{'device_id'} => $config{'auth_key'});


Das Modul greift auf die aktuelle Digest-Auth Implementierung von Fhem's HttpUtils zurück. Siehe auch hier.
XTV scheint noch ein Realm zu sein, der offenbar eine Rolle spielt. Ich muss mal schauen, wie man den an HttpUtils mit übergibt.
Hat meine Arbeit dir geholfen? ⟹ https://paypal.me/pools/c/8gDLrIWrG9

Maintainer:
FHEM-Docker Image, https://github.com/fhem, Astro(Co-Maintainer), ENIGMA2, GEOFANCY, GUEST, HP1000, Installer, LaMetric2, MSG, msgConfig, npmjs, PET, PHTV, Pushover, RESIDENTS, ROOMMATE, search, THINKINGCLEANER