diyhue / diyHue

Main diyHue software repo
https://diyhue.org/
Other
1.52k stars 274 forks source link

Link-Button not working #1020

Closed fendixdev closed 4 weeks ago

fendixdev commented 1 month ago

Issue does not already exist?

I have searched and found no existing issue

Select Environment

Docker

Home Assistant related?

No

Description

I am currently having issues with my diyhue installation. I cannot add my diyhue bridge in the Hue app nor does the link button work.

I have already tried several approaches: complete reinstallation, using Docker, using docker-compose, automatic installation script without Docker, changing the MAC address for the VM, deleting the Philips Hue app along with its cache, changing IP addresses, and trying an older version of diyhue.

The diyHue server is not running on a Raspberry Pi, but on a Debian 12 VM under Proxmox. Everything was working fine until a few days ago when the diyhue bridge suddenly became unreachable in the Philips app without any changes or restarts.

docker-compose.yml

version: '3'
services:
  diyHue:
    image: diyhue/core:latest
    # This makes for more convienient naming, but only allows one instance of the image
    container_name: diyHue
    restart: unless-stopped

    environment:
      # Uncomment to enable debug mode
      DEBUG: true
      # IP and MAC are only needed for running diyHue in the bridge network
      IP: 192.168.178.92
      MAC: BC:24:11:B5:E1:E4
    volumes:
      - /mnt/hue-emulator/export:/opt/hue-emulator/export
    ports:
      - '80:80'
      - '443:443'
      - '1900:1900/udp'
      - '2100:2100/udp'
      - '1982:1982/udp'
    # Alternatively, you can activate host mode by uncommenting the line below and removing all ports and the env vars above
    # network_mode: "host"

docker command

docker run -d --name diyHue --restart=always --network=host -e MAC=BC:24:11:B5:E1:E4 -v /mnt/hue-emulator/config:/opt/hue-emulator/config diyhue/core:latest

HTTPS certificate check

root@192.168.178.92's password:
Linux diyhue 6.1.0-21-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.90-1 (2024-05-03)                                       x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Tue Jun  4 21:22:15 2024 from 192.168.178.100
root@diyhue:~# curl https://127.0.0.1/api/nouser/config -v -k
*   Trying 127.0.0.1:443...
* Connected to 127.0.0.1 (127.0.0.1) port 443 (#0)
* ALPN: offers h2,http/1.1
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
* ALPN: server did not agree on a protocol. Uses default.
* Server certificate:
*  subject: C=NL; O=Philips Hue; CN=BC2411fffeB5E1E4
*  start date: Jan  1 00:00:00 2017 GMT
*  expire date: Jan  1 00:00:00 2038 GMT
*  issuer: C=NL; O=Philips Hue; CN=BC2411fffeB5E1E4
*  SSL certificate verify result: self-signed certificate (18), continuing anywa                                      y.
* using HTTP/1.x
> GET /api/nouser/config HTTP/1.1
> Host: 127.0.0.1
> User-Agent: curl/7.88.1
> Accept: */*
>
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* old SSL session ID is stale, removing
< HTTP/1.1 200 OK
< Content-Type: application/json
< Content-Length: 252
< Access-Control-Allow-Origin: *
< Server: Werkzeug/2.0.3 Python/3.11.2
< Date: Tue, 04 Jun 2024 19:37:47 GMT
<
{"name": "DiyHue Bridge", "datastoreversion": "126", "swversion": "1964117020",                                       "apiversion": "1.64.0", "mac": "BC:24:11:B5:E1:E4", "bridgeid": "BC2411FFFEB5E1E                                      4", "factorynew": false, "replacesbridgeid": null, "modelid": "BSB002", "starter                                      kitid": ""}
* Connection #0 to host 127.0.0.1 left intact

Errorlog:

root@diyhue:~# docker compose up
WARN[0000] /root/docker-compose.yml: `version` is obsolete
[+] Running 1/0
 ✔ Container diyHue  Created                                                                                                                                                          0.0s
Attaching to diyHue
diyHue  | 2024-06-04 19:35:18,192 - configManager.argumentHandler - INFO - Using Host 192.168.178.92:80
diyHue  | 2024-06-04 19:35:18,193 - configManager.argumentHandler - INFO - Host MAC given as BC2411B5E1E4
diyHue  | 2024-06-04 19:35:18,193 - configManager.argumentHandler - INFO - IP range for light discovery: 0-255
diyHue  | 2024-06-04 19:35:18,193 - configManager.argumentHandler - INFO - Deconz IP given as 127.0.0.1
diyHue  | 2024-06-04 19:35:18,194 - configManager.argumentHandler - INFO - Online Discovery/Remote API Enabled!
diyHue  | 2024-06-04 19:35:18,195 - configManager.argumentHandler - INFO - Using Host 192.168.178.92:80
diyHue  | 2024-06-04 19:35:18,196 - configManager.argumentHandler - INFO - Host MAC given as BC2411B5E1E4
diyHue  | 2024-06-04 19:35:18,196 - configManager.argumentHandler - INFO - IP range for light discovery: 0-255
diyHue  | 2024-06-04 19:35:18,196 - configManager.argumentHandler - INFO - Deconz IP given as 127.0.0.1
diyHue  | 2024-06-04 19:35:18,197 - configManager.argumentHandler - INFO - Online Discovery/Remote API Enabled!
diyHue  | 2024-06-04 19:35:18,197 - configManager.argumentHandler - INFO - Debug logging enabled!
diyHue  | 2024-06-04 20:35:18,214 - configManager.configHandler - INFO - Config loaded
diyHue  | 2024-06-04 20:35:18,429 - services.updateManager - INFO - no swversion number update from Philips
diyHue  | 2024-06-04 20:35:18,735 - services.updateManager - INFO - creation_time diyHue : 2024-05-28 19
diyHue  | 2024-06-04 20:35:18,735 - services.updateManager - INFO - publish_time  diyHue : 2024-05-28 19
diyHue  | 2024-06-04 20:35:19,007 - services.updateManager - INFO - creation_time UI : 2024-03-31 16
diyHue  | 2024-06-04 20:35:19,007 - services.updateManager - INFO - publish_time  UI : 2024-03-31 16
diyHue  | 2024-06-04 20:35:19,008 - services.updateManager - INFO - no update for diyHue or UI on github
diyHue  | 2024-06-04 20:35:19,008 - functions.daylightSensor - DEBUG - Daylight Sensor: location is not configured
diyHue  | 2024-06-04 20:35:19,008 - services.remoteDiscover - INFO - Starting discovery service
diyHue  | 2024-06-04 20:35:19,010 - services.stateFetch - INFO - start lights sync
diyHue  | 2024-06-04 20:35:19,011 - services.ssdp - INFO - starting ssdp...
diyHue  | 2024-06-04 20:35:19,011 - services.ssdp - INFO - start ssdp broadcast
diyHue  | 2024-06-04 20:35:19,012 - services.mdns - INFO - <MDNS> listener started
diyHue  | 2024-06-04 20:35:19,015 - services.eventStreamer - DEBUG - {'creationtime': '2024-06-04T19:35:18Z', 'data': [{'children': [], 'grouped_services': [{'rid': 'f0f8704f-c192-4323-babd-e9a2830c8224', 'rtype': 'grouped_light'}], 'services': [{'rid': 'f0f8704f-c192-4323-babd-e9a2830c8224', 'rtype': 'grouped_light'}], 'id': '5e0dab67-843c-5a2e-b9d1-daf78c6a16de', 'id_v1': '/groups/0', 'metadata': {'archetype': 'other', 'name': 'Group 0'}, 'type': 'zone'}], 'id': '9736735c-27d8-4cbf-b644-c497b4d0087c', 'type': 'add'}
diyHue  |  * Serving Flask app 'HueEmulator3' (lazy loading)
diyHue  |  * Environment: production
diyHue  |    WARNING: This is a development server. Do not use it in a production deployment.
diyHue  |    Use a production WSGI server instead.
diyHue  |  * Debug mode: off
diyHue  | 2024-06-04 20:35:19,017 - werkzeug - WARNING -  * Running on all addresses.
diyHue  |    WARNING: This is a development server. Do not use it in a production deployment.
diyHue  | 2024-06-04 20:35:19,018 - werkzeug - INFO -  * Running on http://172.19.0.2:80/ (Press CTRL+C to quit)
diyHue  |  * Serving Flask app 'HueEmulator3' (lazy loading)
diyHue  |  * Environment: production
diyHue  |    WARNING: This is a development server. Do not use it in a production deployment.
diyHue  |    Use a production WSGI server instead.
diyHue  |  * Debug mode: off
diyHue  | 2024-06-04 20:35:19,021 - werkzeug - WARNING -  * Running on all addresses.
diyHue  |    WARNING: This is a development server. Do not use it in a production deployment.
diyHue  | 2024-06-04 20:35:19,022 - werkzeug - INFO -  * Running on https://172.19.0.2:443/ (Press CTRL+C to quit)
diyHue  | 2024-06-04 20:35:19,145 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:35:19] "GET /api/57dc521222a911ef98a50242ac130002/config/swupdate2 HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:35:19,146 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:35:19] "GET /api/57dc521222a911ef98a50242ac130002/groups/0 HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:35:20,302 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:35:20] "GET / HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:35:20,362 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:35:20] "GET /static/css/main.6a208b10.css HTTP/1.1" 304 -
diyHue  | 2024-06-04 20:35:20,363 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:35:20] "GET /static/js/main.bcbb97e2.js HTTP/1.1" 304 -
diyHue  | 2024-06-04 20:35:20,425 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:35:20] "GET /static/media/background.db8a83c2c9e7ce4d1cc5.jpg HTTP/1.1" 304 -
diyHue  | 2024-06-04 20:35:20,435 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:35:20] "GET /static/media/logo.bd3b4e90d91f778081476ad0d68050fe.svg HTTP/1.1" 304 -
diyHue  | 2024-06-04 20:35:20,442 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:35:20] "GET /get-key HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:35:20,443 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:35:20] "GET /static/js/352.363151a1.chunk.js HTTP/1.1" 304 -
diyHue  | 2024-06-04 20:35:20,518 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:35:20] "GET /api/57dc521222a911ef98a50242ac130002/config/swupdate2 HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:35:20,521 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:35:20] "GET /favicon.ico HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:35:20,522 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:35:20] "GET /api/57dc521222a911ef98a50242ac130002/groups/0 HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:35:22,102 - flaskUI.restful - INFO - {'devicetype': 'homebridge-hue#diyhue'}
diyHue  | 2024-06-04 20:35:22,103 - werkzeug - INFO - 192.168.178.92 - - [04/Jun/2024 20:35:22] "POST /api HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:35:25,525 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:35:25] "GET /api/57dc521222a911ef98a50242ac130002/groups/0 HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:35:25,526 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:35:25] "GET /api/57dc521222a911ef98a50242ac130002/config/swupdate2 HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:35:30,527 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:35:30] "GET /api/57dc521222a911ef98a50242ac130002/config/swupdate2 HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:35:30,528 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:35:30] "GET /api/57dc521222a911ef98a50242ac130002/groups/0 HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:35:32,012 - services.stateFetch - INFO - start lights sync
diyHue  | 2024-06-04 20:35:35,526 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:35:35] "GET /api/57dc521222a911ef98a50242ac130002/config/swupdate2 HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:35:35,527 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:35:35] "GET /api/57dc521222a911ef98a50242ac130002/groups/0 HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:35:37,111 - flaskUI.restful - INFO - {'devicetype': 'homebridge-hue#diyhue'}
diyHue  | 2024-06-04 20:35:37,112 - werkzeug - INFO - 192.168.178.92 - - [04/Jun/2024 20:35:37] "POST /api HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:35:40,530 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:35:40] "GET /api/57dc521222a911ef98a50242ac130002/groups/0 HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:35:40,532 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:35:40] "GET /api/57dc521222a911ef98a50242ac130002/config/swupdate2 HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:35:46,387 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:35:46] "GET /api/57dc521222a911ef98a50242ac130002/config/swupdate2 HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:35:46,388 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:35:46] "GET /api/57dc521222a911ef98a50242ac130002/groups/0 HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:35:48,015 - services.stateFetch - INFO - start lights sync
diyHue  | 2024-06-04 20:35:51,400 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:35:51] "GET /api/57dc521222a911ef98a50242ac130002/groups/0 HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:35:51,402 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:35:51] "GET /api/57dc521222a911ef98a50242ac130002/config/swupdate2 HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:35:52,114 - flaskUI.restful - INFO - {'devicetype': 'homebridge-hue#diyhue'}
diyHue  | 2024-06-04 20:35:52,115 - werkzeug - INFO - 192.168.178.92 - - [04/Jun/2024 20:35:52] "POST /api HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:35:56,400 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:35:56] "GET /api/57dc521222a911ef98a50242ac130002/groups/0 HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:35:56,401 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:35:56] "GET /api/57dc521222a911ef98a50242ac130002/config/swupdate2 HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:36:01,398 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:36:01] "GET /api/57dc521222a911ef98a50242ac130002/config/swupdate2 HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:36:01,400 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:36:01] "GET /api/57dc521222a911ef98a50242ac130002/groups/0 HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:36:03,017 - services.stateFetch - INFO - start lights sync
diyHue  | 2024-06-04 20:36:06,393 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:36:06] "GET /api/57dc521222a911ef98a50242ac130002/groups/0 HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:36:06,395 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:36:06] "GET /api/57dc521222a911ef98a50242ac130002/config/swupdate2 HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:36:07,118 - flaskUI.restful - INFO - {'devicetype': 'homebridge-hue#diyhue'}
diyHue  | 2024-06-04 20:36:07,118 - werkzeug - INFO - 192.168.178.92 - - [04/Jun/2024 20:36:07] "POST /api HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:36:11,400 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:36:11] "GET /api/57dc521222a911ef98a50242ac130002/groups/0 HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:36:11,401 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:36:11] "GET /api/57dc521222a911ef98a50242ac130002/config/swupdate2 HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:36:16,389 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:36:16] "GET /api/57dc521222a911ef98a50242ac130002/config/swupdate2 HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:36:16,390 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:36:16] "GET /api/57dc521222a911ef98a50242ac130002/groups/0 HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:36:18,019 - services.stateFetch - INFO - start lights sync
diyHue  | 2024-06-04 20:36:21,395 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:36:21] "GET /api/57dc521222a911ef98a50242ac130002/groups/0 HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:36:21,397 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:36:21] "GET /api/57dc521222a911ef98a50242ac130002/config/swupdate2 HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:36:26,388 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:36:26] "GET /api/57dc521222a911ef98a50242ac130002/groups/0 HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:36:26,390 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:36:26] "GET /api/57dc521222a911ef98a50242ac130002/config/swupdate2 HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:36:31,399 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:36:31] "GET /api/57dc521222a911ef98a50242ac130002/config/swupdate2 HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:36:31,400 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:36:31] "GET /api/57dc521222a911ef98a50242ac130002/groups/0 HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:36:33,022 - services.stateFetch - INFO - start lights sync
diyHue  | 2024-06-04 20:36:36,385 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:36:36] "GET /api/57dc521222a911ef98a50242ac130002/groups/0 HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:36:36,387 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:36:36] "GET /api/57dc521222a911ef98a50242ac130002/config/swupdate2 HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:36:37,104 - werkzeug - INFO - 192.168.178.68 - - [04/Jun/2024 20:36:37] "GET /api/config HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:36:37,304 - flaskUI.restful - INFO - {'devicetype': 'Hue#iPhone', 'generateclientkey': True}
diyHue  | 2024-06-04 20:36:37,305 - werkzeug - INFO - 192.168.178.68 - - [04/Jun/2024 20:36:37] "POST /api HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:36:38,347 - flaskUI.restful - INFO - {'devicetype': 'Hue#iPhone', 'generateclientkey': True}
diyHue  | 2024-06-04 20:36:38,348 - werkzeug - INFO - 192.168.178.68 - - [04/Jun/2024 20:36:38] "POST /api HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:36:39,387 - flaskUI.restful - INFO - {'devicetype': 'Hue#iPhone', 'generateclientkey': True}
diyHue  | 2024-06-04 20:36:39,388 - werkzeug - INFO - 192.168.178.68 - - [04/Jun/2024 20:36:39] "POST /api HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:36:40,404 - flaskUI.restful - INFO - {'devicetype': 'Hue#iPhone', 'generateclientkey': True}
diyHue  | 2024-06-04 20:36:40,405 - werkzeug - INFO - 192.168.178.68 - - [04/Jun/2024 20:36:40] "POST /api HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:36:40,940 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:36:40] "GET /api/57dc521222a911ef98a50242ac130002/groups/0 HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:36:40,941 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:36:40] "GET /api/57dc521222a911ef98a50242ac130002/config/swupdate2 HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:36:41,418 - flaskUI.restful - INFO - {'devicetype': 'Hue#iPhone', 'generateclientkey': True}
diyHue  | 2024-06-04 20:36:41,419 - werkzeug - INFO - 192.168.178.68 - - [04/Jun/2024 20:36:41] "POST /api HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:36:41,810 - flaskUI.restful - DEBUG - [{'success': {'/config/linkbutton': {'lastlinkbuttonpushed': 1717529748}}}]
diyHue  | 2024-06-04 20:36:41,822 - configManager.configHandler - DEBUG - Dump config file /opt/hue-emulator/config/config.yaml
diyHue  | 2024-06-04 20:36:41,823 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:36:41] "PUT /api/57dc521222a911ef98a50242ac130002/config HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:36:42,433 - flaskUI.restful - INFO - {'devicetype': 'Hue#iPhone', 'generateclientkey': True}
diyHue  | 2024-06-04 20:36:42,434 - werkzeug - INFO - 192.168.178.68 - - [04/Jun/2024 20:36:42] "POST /api HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:36:43,465 - flaskUI.restful - INFO - {'devicetype': 'Hue#iPhone', 'generateclientkey': True}
diyHue  | 2024-06-04 20:36:43,466 - werkzeug - INFO - 192.168.178.68 - - [04/Jun/2024 20:36:43] "POST /api HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:36:44,663 - flaskUI.restful - INFO - {'devicetype': 'Hue#iPhone', 'generateclientkey': True}
diyHue  | 2024-06-04 20:36:44,663 - werkzeug - INFO - 192.168.178.68 - - [04/Jun/2024 20:36:44] "POST /api HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:36:45,526 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:36:45] "GET /api/57dc521222a911ef98a50242ac130002/config/swupdate2 HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:36:45,527 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:36:45] "GET /api/57dc521222a911ef98a50242ac130002/groups/0 HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:36:45,720 - flaskUI.restful - INFO - {'devicetype': 'Hue#iPhone', 'generateclientkey': True}
diyHue  | 2024-06-04 20:36:45,721 - werkzeug - INFO - 192.168.178.68 - - [04/Jun/2024 20:36:45] "POST /api HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:36:46,764 - flaskUI.restful - INFO - {'devicetype': 'Hue#iPhone', 'generateclientkey': True}
diyHue  | 2024-06-04 20:36:46,765 - werkzeug - INFO - 192.168.178.68 - - [04/Jun/2024 20:36:46] "POST /api HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:36:47,024 - services.stateFetch - INFO - start lights sync
diyHue  | 2024-06-04 20:36:47,784 - flaskUI.restful - INFO - {'devicetype': 'Hue#iPhone', 'generateclientkey': True}
diyHue  | 2024-06-04 20:36:47,784 - werkzeug - INFO - 192.168.178.68 - - [04/Jun/2024 20:36:47] "POST /api HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:36:48,801 - flaskUI.restful - INFO - {'devicetype': 'Hue#iPhone', 'generateclientkey': True}
diyHue  | 2024-06-04 20:36:48,801 - werkzeug - INFO - 192.168.178.68 - - [04/Jun/2024 20:36:48] "POST /api HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:36:49,313 - flaskUI.restful - DEBUG - [{'success': {'/config/linkbutton': {'lastlinkbuttonpushed': 1717529756}}}]
diyHue  | 2024-06-04 20:36:49,316 - configManager.configHandler - DEBUG - Dump config file /opt/hue-emulator/config/config.yaml
diyHue  | 2024-06-04 20:36:49,317 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:36:49] "PUT /api/57dc521222a911ef98a50242ac130002/config HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:36:49,817 - flaskUI.restful - INFO - {'devicetype': 'Hue#iPhone', 'generateclientkey': True}
diyHue  | 2024-06-04 20:36:49,818 - werkzeug - INFO - 192.168.178.68 - - [04/Jun/2024 20:36:49] "POST /api HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:36:50,523 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:36:50] "GET /api/57dc521222a911ef98a50242ac130002/config/swupdate2 HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:36:50,524 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:36:50] "GET /api/57dc521222a911ef98a50242ac130002/groups/0 HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:36:50,844 - flaskUI.restful - INFO - {'devicetype': 'Hue#iPhone', 'generateclientkey': True}
diyHue  | 2024-06-04 20:36:50,845 - werkzeug - INFO - 192.168.178.68 - - [04/Jun/2024 20:36:50] "POST /api HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:36:51,857 - flaskUI.restful - INFO - {'devicetype': 'Hue#iPhone', 'generateclientkey': True}
diyHue  | 2024-06-04 20:36:51,858 - werkzeug - INFO - 192.168.178.68 - - [04/Jun/2024 20:36:51] "POST /api HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:36:52,872 - flaskUI.restful - INFO - {'devicetype': 'Hue#iPhone', 'generateclientkey': True}
diyHue  | 2024-06-04 20:36:52,873 - werkzeug - INFO - 192.168.178.68 - - [04/Jun/2024 20:36:52] "POST /api HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:36:53,888 - flaskUI.restful - INFO - {'devicetype': 'Hue#iPhone', 'generateclientkey': True}
diyHue  | 2024-06-04 20:36:53,888 - werkzeug - INFO - 192.168.178.68 - - [04/Jun/2024 20:36:53] "POST /api HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:36:54,970 - flaskUI.restful - INFO - {'devicetype': 'Hue#iPhone', 'generateclientkey': True}
diyHue  | 2024-06-04 20:36:54,970 - werkzeug - INFO - 192.168.178.68 - - [04/Jun/2024 20:36:54] "POST /api HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:36:55,525 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:36:55] "GET /api/57dc521222a911ef98a50242ac130002/groups/0 HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:36:55,526 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:36:55] "GET /api/57dc521222a911ef98a50242ac130002/config/swupdate2 HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:36:56,388 - flaskUI.restful - INFO - {'devicetype': 'Hue#iPhone', 'generateclientkey': True}
diyHue  | 2024-06-04 20:36:56,389 - werkzeug - INFO - 192.168.178.68 - - [04/Jun/2024 20:36:56] "POST /api HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:36:57,621 - flaskUI.restful - INFO - {'devicetype': 'Hue#iPhone', 'generateclientkey': True}
diyHue  | 2024-06-04 20:36:57,621 - werkzeug - INFO - 192.168.178.68 - - [04/Jun/2024 20:36:57] "POST /api HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:36:58,645 - flaskUI.restful - INFO - {'devicetype': 'Hue#iPhone', 'generateclientkey': True}
diyHue  | 2024-06-04 20:36:58,645 - werkzeug - INFO - 192.168.178.68 - - [04/Jun/2024 20:36:58] "POST /api HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:36:59,661 - flaskUI.restful - INFO - {'devicetype': 'Hue#iPhone', 'generateclientkey': True}
diyHue  | 2024-06-04 20:36:59,662 - werkzeug - INFO - 192.168.178.68 - - [04/Jun/2024 20:36:59] "POST /api HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:37:00,531 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:37:00] "GET /api/57dc521222a911ef98a50242ac130002/groups/0 HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:37:00,533 - werkzeug - INFO - 192.168.178.100 - - [04/Jun/2024 20:37:00] "GET /api/57dc521222a911ef98a50242ac130002/config/swupdate2 HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:37:00,678 - flaskUI.restful - INFO - {'devicetype': 'Hue#iPhone', 'generateclientkey': True}
diyHue  | 2024-06-04 20:37:00,679 - werkzeug - INFO - 192.168.178.68 - - [04/Jun/2024 20:37:00] "POST /api HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:37:01,707 - flaskUI.restful - INFO - {'devicetype': 'Hue#iPhone', 'generateclientkey': True}
diyHue  | 2024-06-04 20:37:01,708 - werkzeug - INFO - 192.168.178.68 - - [04/Jun/2024 20:37:01] "POST /api HTTP/1.1" 200 -
diyHue  | 2024-06-04 20:37:02,026 - services.stateFetch - INFO - start lights sync

Steps to reproduce

  1. Clean Debian 12 installation
  2. Install docker and docker compose
  3. Run docker command or docker compose
  4. Try to link Hue app with diyhue Bridge

Please enter your operating system details here

       _,met$$$$$gg.          root@diyhue
    ,g$$$$$$$$$$$$$$$P.       -----------
  ,g$$P"     """Y$$.".        OS: Debian GNU/Linux 12 (bookworm) x86_64
 ,$$P'              `$$$.     Host: KVM/QEMU (Standard PC (i440FX + PIIX, 1996) pc-i440fx-8.1)
',$$P       ,ggs.     `$$b:   Kernel: 6.1.0-21-amd64
`d$$'     ,$P"'   .    $$$    Uptime: 4 hours, 59 mins
 $$P      d$'     ,    $$P    Packages: 539 (dpkg)
 $$:      $$.   -    ,d$$'    Shell: bash 5.2.15
 $$;      Y$b._   _,d$P'      Resolution: 1280x800
 Y$$.    `.`"Y$$$$P"'         Terminal: /dev/pts/1
 `$$b      "-.__              CPU: Common KVM (1) @ 1.703GHz
  `Y$$                        GPU: 00:02.0 Vendor 1234 Device 1111
   `Y$$.                      Memory: 313MiB / 3915MiB
     `$$b.
       `Y$$b.
          `"Y$b._

What DiyHue version(branch) are you using?

master (latest)

mariusmotea commented 4 weeks ago

It may sound wired but the clock on the device what you use to click the linkbutton must be in sync with the device where bridge emulator is running. This is because the web-ui of diyhue is also an app andit is sending the current timestamp (on browser device) to bridge emulator config. If the difference between this timestamp and local bridge emulator timestamp is less than 30 seconds then the bridge emulator allow device pairing.

fendixdev commented 4 weeks ago

Both, my server and my phone have the identical time. The server as well as my phone uses a time service to synchronize.

root@diyhue:~# timedatectl
               Local time: Mi 2024-06-05 15:09:36 CEST
           Universal time: Mi 2024-06-05 13:09:36 UTC
                 RTC time: Mi 2024-06-05 13:09:36
                Time zone: Europe/Berlin (CEST, +0200)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

root@diyhue:~# date
Mi 5. Jun 15:09:37 CEST 2024

//Edit

I have been thinking about your tip, so I checked the different times on the server, the Docker container, and the web interface.

Using docker exec -it diyHue bash, I opened the container's console and verified the time with date. I noticed that the container had the wrong time zone set. After adding an environment variable (-e TZ=Europe/Berlin), the container now had the correct internal time, matching the server's time. I also changed the timezone in the bridge settings.

Unfortunately, the connection still wasn't possible.

When I compared the container's time with the time from the web UI, I noticed a discrepancy of approx. 1 minute. Unfortunately, I haven't yet found a way to fix this.

image

//Edit 2

Even after adding the local files, the time in the Web UI lags behind.

- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
mariusmotea commented 4 weeks ago

Can you show logs of the bridge emulator when you press the link button and the hue app try to pair

Do you also have an original Hue Bridge on the same network?

fendixdev commented 4 weeks ago

I have an original Hue Bridge on the same network, I have also tested switching the original Bridge off during the whole process.

When I search for the diyhue bridge, I explicitly search for the IP.

The logs during the pairing process:

[+] Running 2/2
 ✔ Network root_default  Created                                                                                                                              0.1s
 ✔ Container diyHue      Created                                                                                                                              0.1s
Attaching to diyHue
diyHue  | 2024-06-05 21:13:47,923 - configManager.argumentHandler - INFO - Using Host 192.168.178.92:80
diyHue  | 2024-06-05 21:13:47,923 - configManager.argumentHandler - INFO - Host MAC given as bc2411ab00aa
diyHue  | 2024-06-05 21:13:47,923 - configManager.argumentHandler - INFO - IP range for light discovery: 0-255
diyHue  | 2024-06-05 21:13:47,923 - configManager.argumentHandler - INFO - Deconz IP given as 127.0.0.1
diyHue  | 2024-06-05 21:13:47,923 - configManager.argumentHandler - INFO - Online Discovery/Remote API Enabled!
diyHue  | 2024-06-05 21:13:47,925 - configManager.argumentHandler - INFO - Using Host 192.168.178.92:80
diyHue  | 2024-06-05 21:13:47,925 - configManager.argumentHandler - INFO - Host MAC given as bc2411ab00aa
diyHue  | 2024-06-05 21:13:47,925 - configManager.argumentHandler - INFO - IP range for light discovery: 0-255
diyHue  | 2024-06-05 21:13:47,926 - configManager.argumentHandler - INFO - Deconz IP given as 127.0.0.1
diyHue  | 2024-06-05 21:13:47,926 - configManager.argumentHandler - INFO - Online Discovery/Remote API Enabled!
diyHue  | 2024-06-05 21:13:47,926 - configManager.argumentHandler - INFO - Debug logging enabled!
diyHue  | 2024-06-05 21:13:47,926 - configManager.argumentHandler - INFO - Generating certificate
diyHue  | -----
diyHue  | 2024-06-05 21:13:47,977 - configManager.argumentHandler - INFO - Certificate created
diyHue  | 2024-06-05 21:13:47,979 - configManager.configHandler - INFO - Config loaded
diyHue  | 2024-06-05 21:13:48,250 - services.updateManager - INFO - swversion number update from Philips, old: 1962154010 new:1964117020
diyHue  | 2024-06-05 21:13:48,541 - services.updateManager - INFO - creation_time diyHue : 2024-05-28 19
diyHue  | 2024-06-05 21:13:48,541 - services.updateManager - INFO - publish_time  diyHue : 2024-05-28 19
diyHue  | 2024-06-05 21:13:48,843 - services.updateManager - INFO - creation_time UI : 2024-03-31 16
diyHue  | 2024-06-05 21:13:48,843 - services.updateManager - INFO - publish_time  UI : 2024-03-31 16
diyHue  | 2024-06-05 21:13:48,843 - services.updateManager - INFO - no update for diyHue or UI on github
diyHue  | 2024-06-05 21:13:48,844 - functions.daylightSensor - DEBUG - Daylight Sensor: location is not configured
diyHue  | 2024-06-05 21:13:48,844 - services.remoteDiscover - INFO - Starting discovery service
diyHue  | 2024-06-05 21:13:48,845 - services.stateFetch - INFO - start lights sync
diyHue  | 2024-06-05 21:13:48,846 - services.ssdp - INFO - starting ssdp...
diyHue  | 2024-06-05 21:13:48,846 - services.ssdp - INFO - start ssdp broadcast
diyHue  | 2024-06-05 21:13:48,847 - services.mdns - INFO - <MDNS> listener started
diyHue  | 2024-06-05 21:13:48,849 - services.eventStreamer - DEBUG - {'creationtime': '2024-06-05T19:13:47Z', 'data': [{'children': [], 'grouped_services': [{'rid': '80be3ade-9638-49b4-9871-baf02cbccc80', 'rtype': 'grouped_light'}], 'services': [{'rid': '80be3ade-9638-49b4-9871-baf02cbccc80', 'rtype': 'grouped_light'}], 'id': 'ff8b531f-fdd9-5166-b560-cc93c56a3ae1', 'id_v1': '/groups/0', 'metadata': {'archetype': 'other', 'name': 'Group 0'}, 'type': 'zone'}], 'id': '909b5264-2c67-4405-b24a-630d3bdf7d24', 'type': 'add'}
diyHue  |  * Serving Flask app 'HueEmulator3' (lazy loading)
diyHue  |  * Environment: production
diyHue  |    WARNING: This is a development server. Do not use it in a production deployment.
diyHue  |    Use a production WSGI server instead.
diyHue  |  * Debug mode: off
diyHue  |  * Serving Flask app 'HueEmulator3' (lazy loading)
diyHue  |  * Environment: production
diyHue  |    WARNING: This is a development server. Do not use it in a production deployment.
diyHue  |    Use a production WSGI server instead.
diyHue  |  * Debug mode: off
diyHue  | 2024-06-05 21:13:48,854 - werkzeug - WARNING -  * Running on all addresses.
diyHue  |    WARNING: This is a development server. Do not use it in a production deployment.
diyHue  | 2024-06-05 21:13:48,854 - werkzeug - WARNING -  * Running on all addresses.
diyHue  |    WARNING: This is a development server. Do not use it in a production deployment.
diyHue  | 2024-06-05 21:13:48,854 - werkzeug - INFO -  * Running on http://172.18.0.2:80/ (Press CTRL+C to quit)
diyHue  | 2024-06-05 21:13:48,854 - werkzeug - INFO -  * Running on https://172.18.0.2:443/ (Press CTRL+C to quit)
diyHue  | 2024-06-05 21:13:48,894 - werkzeug - INFO - 192.168.178.100 - - [05/Jun/2024 21:13:48] "GET / HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:13:48,961 - werkzeug - INFO - 192.168.178.100 - - [05/Jun/2024 21:13:48] "GET /static/css/main.6a208b10.css HTTP/1.1" 304 -
diyHue  | 2024-06-05 21:13:48,962 - werkzeug - INFO - 192.168.178.100 - - [05/Jun/2024 21:13:48] "GET /static/js/main.bcbb97e2.js HTTP/1.1" 304 -
diyHue  | 2024-06-05 21:13:49,022 - werkzeug - INFO - 192.168.178.100 - - [05/Jun/2024 21:13:49] "GET /static/media/background.db8a83c2c9e7ce4d1cc5.jpg HTTP/1.1" 304 -
diyHue  | 2024-06-05 21:13:49,072 - werkzeug - INFO - 192.168.178.100 - - [05/Jun/2024 21:13:49] "GET /static/js/665.c8715fbe.chunk.js HTTP/1.1" 304 -
diyHue  | 2024-06-05 21:13:49,077 - configManager.configHandler - DEBUG - Dump config file /opt/hue-emulator/config/config.yaml
diyHue  | 2024-06-05 21:13:49,079 - werkzeug - INFO - 192.168.178.100 - - [05/Jun/2024 21:13:49] "GET /static/js/519.fa761dcf.chunk.js HTTP/1.1" 304 -
diyHue  | 2024-06-05 21:13:49,081 - werkzeug - INFO - 192.168.178.100 - - [05/Jun/2024 21:13:49] "GET /static/js/942.35eea4a5.chunk.js HTTP/1.1" 304 -
diyHue  | 2024-06-05 21:13:49,081 - configManager.configHandler - DEBUG - Dump config file /opt/hue-emulator/config/lights.yaml
diyHue  | 2024-06-05 21:13:49,083 - configManager.configHandler - DEBUG - Dump config file /opt/hue-emulator/config/groups.yaml
diyHue  | 2024-06-05 21:13:49,084 - configManager.configHandler - DEBUG - Dump config file /opt/hue-emulator/config/scenes.yaml
diyHue  | 2024-06-05 21:13:49,084 - werkzeug - INFO - 192.168.178.100 - - [05/Jun/2024 21:13:49] "GET /static/js/723.f4be2655.chunk.js HTTP/1.1" 304 -
diyHue  | 2024-06-05 21:13:49,085 - configManager.configHandler - DEBUG - Dump config file /opt/hue-emulator/config/rules.yaml
diyHue  | 2024-06-05 21:13:49,085 - werkzeug - INFO - 192.168.178.100 - - [05/Jun/2024 21:13:49] "GET /static/js/408.090e6b40.chunk.js HTTP/1.1" 304 -
diyHue  | 2024-06-05 21:13:49,086 - configManager.configHandler - DEBUG - Dump config file /opt/hue-emulator/config/resourcelinks.yaml
diyHue  | 2024-06-05 21:13:49,086 - configManager.configHandler - DEBUG - Dump config file /opt/hue-emulator/config/schedules.yaml
diyHue  | 2024-06-05 21:13:49,087 - configManager.configHandler - DEBUG - Dump config file /opt/hue-emulator/config/sensors.yaml
diyHue  | 2024-06-05 21:13:49,088 - configManager.configHandler - DEBUG - Dump config file /opt/hue-emulator/config/behavior_instance.yaml
diyHue  | 2024-06-05 21:13:49,088 - werkzeug - INFO - 192.168.178.100 - - [05/Jun/2024 21:13:49] "GET /get-key HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:13:49,124 - werkzeug - INFO - 192.168.178.100 - - [05/Jun/2024 21:13:49] "GET /static/media/logo.bd3b4e90d91f778081476ad0d68050fe.svg HTTP/1.1" 304 -
diyHue  | 2024-06-05 21:13:49,143 - werkzeug - INFO - 192.168.178.100 - - [05/Jun/2024 21:13:49] "GET /api/bcfbd818236f11efb7870242ac120002/config/swupdate2 HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:13:49,144 - werkzeug - INFO - 192.168.178.100 - - [05/Jun/2024 21:13:49] "GET /api/bcfbd818236f11efb7870242ac120002/groups/0 HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:13:49,147 - werkzeug - INFO - 192.168.178.100 - - [05/Jun/2024 21:13:49] "GET /api/bcfbd818236f11efb7870242ac120002 HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:13:49,219 - werkzeug - INFO - 192.168.178.100 - - [05/Jun/2024 21:13:49] "GET /favicon.ico HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:13:51,152 - werkzeug - INFO - 192.168.178.100 - - [05/Jun/2024 21:13:51] "GET /api/bcfbd818236f11efb7870242ac120002 HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:13:52,293 - werkzeug - INFO - 192.168.178.100 - - [05/Jun/2024 21:13:52] "GET /favicon.ico HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:13:52,303 - werkzeug - INFO - 192.168.178.100 - - [05/Jun/2024 21:13:52] "GET /static/js/352.363151a1.chunk.js HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:13:54,157 - werkzeug - INFO - 192.168.178.100 - - [05/Jun/2024 21:13:54] "GET /api/bcfbd818236f11efb7870242ac120002/config/swupdate2 HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:13:54,158 - werkzeug - INFO - 192.168.178.100 - - [05/Jun/2024 21:13:54] "GET /api/bcfbd818236f11efb7870242ac120002/groups/0 HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:13:59,153 - werkzeug - INFO - 192.168.178.100 - - [05/Jun/2024 21:13:59] "GET /api/bcfbd818236f11efb7870242ac120002/groups/0 HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:13:59,154 - werkzeug - INFO - 192.168.178.100 - - [05/Jun/2024 21:13:59] "GET /api/bcfbd818236f11efb7870242ac120002/config/swupdate2 HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:14:00,846 - services.stateFetch - INFO - start lights sync
diyHue  | 2024-06-05 21:14:04,156 - werkzeug - INFO - 192.168.178.100 - - [05/Jun/2024 21:14:04] "GET /api/bcfbd818236f11efb7870242ac120002/groups/0 HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:14:04,157 - werkzeug - INFO - 192.168.178.100 - - [05/Jun/2024 21:14:04] "GET /api/bcfbd818236f11efb7870242ac120002/config/swupdate2 HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:14:09,156 - werkzeug - INFO - 192.168.178.100 - - [05/Jun/2024 21:14:09] "GET /api/bcfbd818236f11efb7870242ac120002/config/swupdate2 HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:14:09,158 - werkzeug - INFO - 192.168.178.100 - - [05/Jun/2024 21:14:09] "GET /api/bcfbd818236f11efb7870242ac120002/groups/0 HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:14:11,847 - services.stateFetch - INFO - start lights sync
diyHue  | 2024-06-05 21:14:14,149 - werkzeug - INFO - 192.168.178.100 - - [05/Jun/2024 21:14:14] "GET /api/bcfbd818236f11efb7870242ac120002/config/swupdate2 HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:14:14,151 - werkzeug - INFO - 192.168.178.100 - - [05/Jun/2024 21:14:14] "GET /api/bcfbd818236f11efb7870242ac120002/groups/0 HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:14:19,155 - werkzeug - INFO - 192.168.178.100 - - [05/Jun/2024 21:14:19] "GET /api/bcfbd818236f11efb7870242ac120002/config/swupdate2 HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:14:19,156 - werkzeug - INFO - 192.168.178.100 - - [05/Jun/2024 21:14:19] "GET /api/bcfbd818236f11efb7870242ac120002/groups/0 HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:14:21,502 - werkzeug - INFO - 192.168.178.68 - - [05/Jun/2024 21:14:21] "GET /api/config HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:14:21,548 - flaskUI.restful - INFO - {'devicetype': 'Hue#iPhone', 'generateclientkey': True}
diyHue  | 2024-06-05 21:14:21,549 - werkzeug - INFO - 192.168.178.68 - - [05/Jun/2024 21:14:21] "POST /api HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:14:22,561 - flaskUI.restful - INFO - {'devicetype': 'Hue#iPhone', 'generateclientkey': True}
diyHue  | 2024-06-05 21:14:22,561 - werkzeug - INFO - 192.168.178.68 - - [05/Jun/2024 21:14:22] "POST /api HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:14:23,574 - flaskUI.restful - INFO - {'devicetype': 'Hue#iPhone', 'generateclientkey': True}
diyHue  | 2024-06-05 21:14:23,575 - werkzeug - INFO - 192.168.178.68 - - [05/Jun/2024 21:14:23] "POST /api HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:14:24,148 - werkzeug - INFO - 192.168.178.100 - - [05/Jun/2024 21:14:24] "GET /api/bcfbd818236f11efb7870242ac120002/config/swupdate2 HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:14:24,149 - werkzeug - INFO - 192.168.178.100 - - [05/Jun/2024 21:14:24] "GET /api/bcfbd818236f11efb7870242ac120002/groups/0 HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:14:24,589 - flaskUI.restful - INFO - {'devicetype': 'Hue#iPhone', 'generateclientkey': True}
diyHue  | 2024-06-05 21:14:24,590 - werkzeug - INFO - 192.168.178.68 - - [05/Jun/2024 21:14:24] "POST /api HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:14:25,359 - flaskUI.restful - DEBUG - [{'success': {'/config/linkbutton': {'lastlinkbuttonpushed': 1717614809}}}]
diyHue  | 2024-06-05 21:14:25,362 - configManager.configHandler - DEBUG - Dump config file /opt/hue-emulator/config/config.yaml
diyHue  | 2024-06-05 21:14:25,362 - werkzeug - INFO - 192.168.178.100 - - [05/Jun/2024 21:14:25] "PUT /api/bcfbd818236f11efb7870242ac120002/config HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:14:25,605 - flaskUI.restful - INFO - {'devicetype': 'Hue#iPhone', 'generateclientkey': True}
diyHue  | 2024-06-05 21:14:25,605 - werkzeug - INFO - 192.168.178.68 - - [05/Jun/2024 21:14:25] "POST /api HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:14:25,849 - services.stateFetch - INFO - start lights sync
diyHue  | 2024-06-05 21:14:26,624 - flaskUI.restful - INFO - {'devicetype': 'Hue#iPhone', 'generateclientkey': True}
diyHue  | 2024-06-05 21:14:26,624 - werkzeug - INFO - 192.168.178.68 - - [05/Jun/2024 21:14:26] "POST /api HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:14:27,639 - flaskUI.restful - INFO - {'devicetype': 'Hue#iPhone', 'generateclientkey': True}
diyHue  | 2024-06-05 21:14:27,640 - werkzeug - INFO - 192.168.178.68 - - [05/Jun/2024 21:14:27] "POST /api HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:14:28,655 - flaskUI.restful - INFO - {'devicetype': 'Hue#iPhone', 'generateclientkey': True}
diyHue  | 2024-06-05 21:14:28,656 - werkzeug - INFO - 192.168.178.68 - - [05/Jun/2024 21:14:28] "POST /api HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:14:29,144 - werkzeug - INFO - 192.168.178.100 - - [05/Jun/2024 21:14:29] "GET /api/bcfbd818236f11efb7870242ac120002/config/swupdate2 HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:14:29,145 - werkzeug - INFO - 192.168.178.100 - - [05/Jun/2024 21:14:29] "GET /api/bcfbd818236f11efb7870242ac120002/groups/0 HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:14:29,670 - flaskUI.restful - INFO - {'devicetype': 'Hue#iPhone', 'generateclientkey': True}
diyHue  | 2024-06-05 21:14:29,670 - werkzeug - INFO - 192.168.178.68 - - [05/Jun/2024 21:14:29] "POST /api HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:14:30,689 - flaskUI.restful - INFO - {'devicetype': 'Hue#iPhone', 'generateclientkey': True}
diyHue  | 2024-06-05 21:14:30,689 - werkzeug - INFO - 192.168.178.68 - - [05/Jun/2024 21:14:30] "POST /api HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:14:31,706 - flaskUI.restful - INFO - {'devicetype': 'Hue#iPhone', 'generateclientkey': True}
diyHue  | 2024-06-05 21:14:31,706 - werkzeug - INFO - 192.168.178.68 - - [05/Jun/2024 21:14:31] "POST /api HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:14:32,724 - flaskUI.restful - INFO - {'devicetype': 'Hue#iPhone', 'generateclientkey': True}
diyHue  | 2024-06-05 21:14:32,724 - werkzeug - INFO - 192.168.178.68 - - [05/Jun/2024 21:14:32] "POST /api HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:14:33,740 - flaskUI.restful - INFO - {'devicetype': 'Hue#iPhone', 'generateclientkey': True}
diyHue  | 2024-06-05 21:14:33,740 - werkzeug - INFO - 192.168.178.68 - - [05/Jun/2024 21:14:33] "POST /api HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:14:34,146 - werkzeug - INFO - 192.168.178.100 - - [05/Jun/2024 21:14:34] "GET /api/bcfbd818236f11efb7870242ac120002/config/swupdate2 HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:14:34,147 - werkzeug - INFO - 192.168.178.100 - - [05/Jun/2024 21:14:34] "GET /api/bcfbd818236f11efb7870242ac120002/groups/0 HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:14:34,759 - flaskUI.restful - INFO - {'devicetype': 'Hue#iPhone', 'generateclientkey': True}
diyHue  | 2024-06-05 21:14:34,760 - werkzeug - INFO - 192.168.178.68 - - [05/Jun/2024 21:14:34] "POST /api HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:14:35,776 - flaskUI.restful - INFO - {'devicetype': 'Hue#iPhone', 'generateclientkey': True}
diyHue  | 2024-06-05 21:14:35,777 - werkzeug - INFO - 192.168.178.68 - - [05/Jun/2024 21:14:35] "POST /api HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:14:36,317 - flaskUI.restful - DEBUG - [{'success': {'/config/linkbutton': {'lastlinkbuttonpushed': 1717614820}}}]
diyHue  | 2024-06-05 21:14:36,319 - configManager.configHandler - DEBUG - Dump config file /opt/hue-emulator/config/config.yaml
diyHue  | 2024-06-05 21:14:36,320 - werkzeug - INFO - 192.168.178.100 - - [05/Jun/2024 21:14:36] "PUT /api/bcfbd818236f11efb7870242ac120002/config HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:14:36,795 - flaskUI.restful - INFO - {'devicetype': 'Hue#iPhone', 'generateclientkey': True}
diyHue  | 2024-06-05 21:14:36,795 - werkzeug - INFO - 192.168.178.68 - - [05/Jun/2024 21:14:36] "POST /api HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:14:36,850 - services.stateFetch - INFO - start lights sync
diyHue  | 2024-06-05 21:14:37,809 - flaskUI.restful - INFO - {'devicetype': 'Hue#iPhone', 'generateclientkey': True}
diyHue  | 2024-06-05 21:14:37,810 - werkzeug - INFO - 192.168.178.68 - - [05/Jun/2024 21:14:37] "POST /api HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:14:38,829 - flaskUI.restful - INFO - {'devicetype': 'Hue#iPhone', 'generateclientkey': True}
diyHue  | 2024-06-05 21:14:38,829 - werkzeug - INFO - 192.168.178.68 - - [05/Jun/2024 21:14:38] "POST /api HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:14:39,150 - werkzeug - INFO - 192.168.178.100 - - [05/Jun/2024 21:14:39] "GET /api/bcfbd818236f11efb7870242ac120002/config/swupdate2 HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:14:39,151 - werkzeug - INFO - 192.168.178.100 - - [05/Jun/2024 21:14:39] "GET /api/bcfbd818236f11efb7870242ac120002/groups/0 HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:14:39,843 - flaskUI.restful - INFO - {'devicetype': 'Hue#iPhone', 'generateclientkey': True}
diyHue  | 2024-06-05 21:14:39,843 - werkzeug - INFO - 192.168.178.68 - - [05/Jun/2024 21:14:39] "POST /api HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:14:40,856 - flaskUI.restful - INFO - {'devicetype': 'Hue#iPhone', 'generateclientkey': True}
diyHue  | 2024-06-05 21:14:40,856 - werkzeug - INFO - 192.168.178.68 - - [05/Jun/2024 21:14:40] "POST /api HTTP/1.1" 200 -
diyHue  | 2024-06-05 21:14:41,872 - flaskUI.restful - INFO - {'devicetype': 'Hue#iPhone', 'generateclientkey': True}
diyHue  | 2024-06-05 21:14:41,873 - werkzeug - INFO - 192.168.178.68 - - [05/Jun/2024 21:14:41] "POST /api HTTP/1.1" 200 -
mariusmotea commented 4 weeks ago

If you try Hue Essentials app it will pair?

fendixdev commented 4 weeks ago

If you try Hue Essentials app it will pair?

Didn't worked unfortunately.

hendriksen-mark commented 4 weeks ago

diyHue | 2024-06-05 21:14:36,317 - flaskUI.restful - DEBUG - [{'success': {'/config/linkbutton': {'lastlinkbuttonpushed': 1717614820}}}] 1717614820 = 2024/06/05 21:13:40 Python time = 2024-06-05 21:14:36 In diyhue 30 seconds is added to 21:13:40 so pairing is possible until 21:14:10. This is in the past for python so it is a timing issue.

fendixdev commented 4 weeks ago

diyHue | 2024-06-05 21:14:36,317 - flaskUI.restful - DEBUG - [{'success': {'/config/linkbutton': {'lastlinkbuttonpushed': 1717614820}}}] 1717614820 = 2024/06/05 21:13:40 Python time = 2024-06-05 21:14:36 In diyhue 30 seconds is added to 21:13:40 so pairing is possible until 21:14:10. This is in the past for python so it is a timing issue.

Thank you, then it is still a problem with time.

How can I fix the time lag? Can I extend the time to connect?

hendriksen-mark commented 4 weeks ago

Javascript (the webui) uses date.now, this comes from the local machine running the webui(the browser you push link) you can add 1 minute to youre time to fix this. Also 1 thing i noticed with windows is that over time the clock is out of sync and i have to re sync the clock every month.

fendixdev commented 4 weeks ago

Javascript (the webui) uses date.now, this comes from the local machine running the webui(the browser you push link) you can add 1 minute to youre time to fix this. Also 1 thing i noticed with windows is that over time the clock is out of sync and i have to re sync the clock every month.

Genius. Let me set up a new VM and I'll test two approaches I have:

  1. Increase last_button_press + 30 to last_button_press + 90 in BridgeEmulator/flaskUI/restful.py with async Windows time and try to connect.
  2. Resync windows time with different ntp server and don't change the last_button_press value.
fendixdev commented 4 weeks ago

I was able to partially solve the problem. I didn't know that the timestamp from the local system was relevant.

Anyway, thanks to a tip from hendriksen-mark, I checked my Windows clock, and indeed the time was asynchronous compared to the atomic clock. I then set the NTP server to de.pool.ntp.org and synchronized the time.

With both synchronized and unsynchronized time and a changed value of the last_button_press variable (in my case from 30 seconds to 90 seconds), I was able to connect to the bridge. I tested the same with the Docker variant, leaving the value at the default value of 30 seconds. Despite the synchronized and correct time, there was no successful synchronization.

I then used my MacBook to click the link button, and surprisingly, a connection with the Hue app was immediately established.

It would definitely be helpful to update the documentation to mention that the local system time is relevant for establishing the connection. Thank you both for your quick responses and good ideas <3