diyhue / diyHue

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

Unable to connect diyHue with SleepCycle app #981

Open a-i-ks opened 6 months ago

a-i-ks commented 6 months ago

Issue does not already exist?

I have searched and found no existing issue

Select Environment

Docker

Home Assistant related?

No

Description

I would like to connect my diyHue bridge to the SleepCycle app. The app usually only supports Philips Hue. But since I want to use a non-Hue compatible device to wake me up, I want to use the diyHue bridge for this. Unfortunately, the diyHue bridge is not found in SleepCycle. I have no option there to configure a manual connection via an IP address. An original Philips Hue bridge is found and can be connected. I assume that the diyHue bridge cannot be found correctly via ssdp. In the Hue Essentials app, only the original Philips Hue Bridge appears via Auto Discovery the first time it is started. However, the diyHue can be connected manually in Hue Essentials.

Errorlog:

2024-01-05 21:30:02,699 - werkzeug - INFO - 192.168.178.101 - - [05/Jan/2024 21:30:02] "GET /api/672feeacac0911ee811e0242ac130002/groups/0 HTTP/1.1" 200 -
2024-01-05 21:30:17,605 - configManager.argumentHandler - INFO - Using Host 192.168.178.129:80
2024-01-05 21:30:17,606 - configManager.argumentHandler - INFO - Host MAC given as a7de8995a2ed
2024-01-05 21:30:17,606 - configManager.argumentHandler - INFO - IP range for light discovery: 0-255
2024-01-05 21:30:17,606 - configManager.argumentHandler - INFO - Deconz IP given as 127.0.0.1
2024-01-05 21:30:17,606 - configManager.argumentHandler - INFO - Online Discovery/Remote API Enabled!
2024-01-05 21:30:17,610 - configManager.argumentHandler - INFO - Using Host 192.168.178.129:80
2024-01-05 21:30:17,610 - configManager.argumentHandler - INFO - Host MAC given as a7de8995a2ed
2024-01-05 21:30:17,610 - configManager.argumentHandler - INFO - IP range for light discovery: 0-255
2024-01-05 21:30:17,611 - configManager.argumentHandler - INFO - Deconz IP given as 127.0.0.1
2024-01-05 21:30:17,611 - configManager.argumentHandler - INFO - Online Discovery/Remote API Enabled!
2024-01-05 21:30:17,613 - configManager.argumentHandler - INFO - Debug logging disabled!
2024-01-05 21:30:17,643 - configManager.configHandler - INFO - Config loaded
2024-01-05 21:30:17,777 - services.remoteDiscover - INFO - Starting discovery service
2024-01-05 21:30:17,784 - services.stateFetch - INFO - start lights sync
2024-01-05 21:30:17,787 - services.ssdp - INFO - starting ssdp...
2024-01-05 21:30:17,788 - services.ssdp - INFO - start ssdp broadcast
2024-01-05 21:30:17,789 - services.mdns - INFO - <MDNS> listener started
 * Serving Flask app 'HueEmulator3' (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
2024-01-05 21:30:17,796 - werkzeug - WARNING -  * Running on all addresses.
   WARNING: This is a development server. Do not use it in a production deployment.
2024-01-05 21:30:17,796 - werkzeug - INFO -  * Running on http://172.19.0.2:80/ (Press CTRL+C to quit)
 * Serving Flask app 'HueEmulator3' (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
2024-01-05 21:30:17,804 - werkzeug - WARNING -  * Running on all addresses.
   WARNING: This is a development server. Do not use it in a production deployment.
2024-01-05 21:30:17,805 - werkzeug - INFO -  * Running on https://172.19.0.2:443/ (Press CTRL+C to quit)
2024-01-05 21:30:39,707 - werkzeug - INFO - 192.168.178.101 - - [05/Jan/2024 21:30:39] "GET /api/672feeacac0911ee811e0242ac130002/groups/0 HTTP/1.1" 200 -
2024-01-05 21:30:40,794 - services.stateFetch - INFO - start lights sync

Steps to reproduce

Install diyHue, try to connect to SleepCycle App

Please enter your operating system details here

I have started diyHue with the following Docker compose:

version: '3'
services:
  diyHue:
    image: 'diyhue/core:latest'
    container_name: diyHue
    restart: unless-stopped
    environment:
      - DEBUG=false
      - MAC=a7:de:89:95:a2:ed
      - IP=192.168.178.129
    volumes:
      - '/opt/stacks/diyhue/config:/opt/hue-emulator/config'
    ports:
      - '80:80'
      - '443:443'
      - '1900:1900/udp'
      - '2100:2100/udp'
      - '1982:1982/udp'

What DiyHue version(branch) are you using?

master (latest)

mariusmotea commented 6 months ago

Hi,

From what i know SSDP traffic cannot be forwarded to docker network, so to have it working you need to use host network mode instead to manually specify the binding ports.

a-i-ks commented 6 months ago

Ah, thanks for the information. I will try to install diyHue in host mode and and I'll let you know if it works.

I have made some progress, but unfortunately I have not been able to solve my problem conclusively. In host mode, diyHue is displayed by the Hue Essentials app. This means that the ssdp is now working. Unfortunately, SleepCycle only recognizes my Philips hue bridge. diyHue seems to behave differently than the Philips hue bridge in some point during discovery. But from here on you can only make assumptions because there is no log or similar in the SleepCycle app. What a pity, my use case is probably not feasible.