script.service.hue icon indicating copy to clipboard operation
script.service.hue copied to clipboard

Link to Philips Hue Bridge Pro fails

Open heitbaum opened this issue 1 month ago • 1 comments

Describe the bug Connectivity to Philips Hue Bridge Pro requires https.

To Reproduce Steps to reproduce the behavior:

  1. Try to link a Philips Hue Bridge Pro
  2. edit hue.py to use https (follow the 301)
  3. link still fails on the same line as #329 error
[SCRIPT.SERVICE.HUE] *** EXCEPTION ***:  Type: <class 'AttributeError'>,
File "/storage/.kodi/addons/script.service.hue/resources/lib/hue.py", line 295, in _check_version

In debugging software_version = self.get_attribute_value(self.devices, self.bridge_id, ['product_data', 'software_version']) further. {software_version} = None

Expected behavior A clear and concise description of what you expected to happen.

Link succeeds

Screenshots If applicable, add screenshots to help explain your problem.

System (please complete the following information):

  • OS: [e.g. Windows, Linux, LibreElec, Android] LibreELEC
  • System Version [e.g. 10] 13
  • Kodi Version [e.g. 19] 22

Logs Issues cannot be investigated without logs. See the Wiki on how to provide them.

Output from tcpdump

        GET /api/0/config HTTP/1.1
        Host: 192.168.0.21
        User-Agent: python-requests/2.31.0
        Accept-Encoding: gzip, deflate
        Accept: */*
        Connection: keep-alive

        HTTP/1.1 301 Moved Permanently
        Server: nginx
        Date: Sat, 22 Nov 2025 07:39:29 GMT
        Content-Type: text/html
        Content-Length: 162
        Connection: keep-alive
        Location: https://192.168.0.21/api/0/config
        X-Frame-Options: SAMEORIGIN
        X-Content-Type-Options: nosniff
        Referrer-Policy: no-referrer
        
        <html>
        <head><title>301 Moved Permanently</title></head>
        <body>
        <center><h1>301 Moved Permanently</h1></center>
        <hr><center>nginx</center>
        </body>
        </html>

        POST /api/ HTTP/1.1
        Host: 192.168.0.21
        User-Agent: python-requests/2.31.0
        Accept-Encoding: gzip, deflate
        Accept: */*
        Connection: keep-alive
        Content-Length: 28

        HTTP/1.1 301 Moved Permanently
        Server: nginx
        Date: Sat, 22 Nov 2025 07:39:31 GMT
        Content-Type: text/html
        Content-Length: 162
        Connection: keep-alive
        Location: https://192.168.0.21/api/
        X-Frame-Options: SAMEORIGIN
        X-Content-Type-Options: nosniff
        Referrer-Policy: no-referrer
        
        <html>
        <head><title>301 Moved Permanently</title></head>
        <body>
        <center><h1>301 Moved Permanently</h1></center>
        <hr><center>nginx</center>
        </body>
        </html>

Additional context Add any other context about the problem here.

Quick diff to get past the https issue.

--- hue.py  2025-11-22 19:00:20.441959690 +1100
+++ hue.py       2025-11-22 18:45:08.335082954 +1100
@@ -54,7 +54,7 @@
         for attempt in range(MAX_RETRIES):
             # Prepare the URL for the request
             log(f"[SCRIPT.SERVICE.HUE] v2 ip: {self.settings_monitor.ip}, key: {self.settings_monitor.key}")
-            base_url = self.base_url if not discovery else f"http://{self.discoveredIP}/api/"
+            base_url = self.base_url if not discovery else f"https://{self.discoveredIP}/api/"
             url = urljoin(base_url, resource)
             #log(f"[SCRIPT.SERVICE.HUE] v2 make_request: base_url: {base_url}, url: {url}, method: {method}, kwargs: {kwargs}")
             try:

heitbaum avatar Nov 22 '25 08:11 heitbaum