hass-emulated-hue / core

Hue Emulation for Home Assistant
Apache License 2.0
318 stars 55 forks source link

The Emulated Hue (dev) ist not starting #550

Closed carsten-h closed 2 months ago

carsten-h commented 4 months ago

Description

I moved my Home Assistant OS Installation from a Pi 4 into a Proxmox VM. I only restored the backup that I took from the Pi 4 into the VM.

On the Pi 4 the "Emulated Hue (dev)" was working fine. But inside the VM I only get the attached messages and the Add-on stops working.

I tried the non (dev) version also. This starts up but I can not connect with my Harmony Hub. The App for configuration only tells me "error". :-( I can see in the log that the Harmony Hub is getting contact and all the data that is needed, but then nothing more. Very strange.

It worked before on the Pi 4 for years without any problem!

Expected behavior

The Add-On should run. :-)

Reproduction steps

Install the original OVA for Home Assistant OS in a VM and then the Add-On.

Relevant log output

core-master/.devcontainer/setup.sh
core-master/.github/
core-master/.github/ISSUE_TEMPLATE/
core-master/.github/ISSUE_TEMPLATE/bug-report.yml
core-master/.github/ISSUE_TEMPLATE/config.yml
core-master/.github/ISSUE_TEMPLATE/feature-request.yml
core-master/.github/dependabot.yml
core-master/.github/release-drafter.yml
core-master/.github/workflows/
core-master/.github/workflows/docker-build.yaml
core-master/.github/workflows/release-drafter.yml
core-master/.github/workflows/stale.yml
core-master/.github/workflows/test.yml
core-master/.github/workflows/update-swversion.yml
core-master/.gitignore
core-master/.pre-commit-config.yaml
core-master/.vscode/
core-master/.vscode/extensions.json
core-master/.vscode/launch.json.EXAMPLE
core-master/.vscode/settings.json
core-master/LICENSE
core-master/Notes.md
core-master/README.md
core-master/docker-compose.example.yml
core-master/docker/
core-master/docker/Dockerfile
core-master/docker/Dockerfile.dev
core-master/docker/publish.py
core-master/docker/rootfs-dev/
core-master/docker/rootfs-dev/etc/
core-master/docker/rootfs-dev/etc/cont-init.d/
core-master/docker/rootfs-dev/etc/cont-init.d/20-install.sh
core-master/docker/rootfs/
core-master/docker/rootfs/etc/
core-master/docker/rootfs/etc/cont-init.d/
core-master/docker/rootfs/etc/cont-init.d/00-set-vars.sh
core-master/docker/rootfs/etc/services.d/
core-master/docker/rootfs/etc/services.d/emulated-hue/
core-master/docker/rootfs/etc/services.d/emulated-hue/finish
core-master/docker/rootfs/etc/services.d/emulated-hue/run
core-master/emulated_hue/
core-master/emulated_hue/__init__.py
core-master/emulated_hue/__main__.py
core-master/emulated_hue/apiv1.py
core-master/emulated_hue/const.py
core-master/emulated_hue/controllers/
core-master/emulated_hue/controllers/__init__.py
core-master/emulated_hue/controllers/config.py
core-master/emulated_hue/controllers/devices.py
core-master/emulated_hue/controllers/entertainment.py
core-master/emulated_hue/controllers/homeassistant.py
core-master/emulated_hue/controllers/models.py
core-master/emulated_hue/controllers/scheduler.py
core-master/emulated_hue/definitions.json
core-master/emulated_hue/discovery.py
core-master/emulated_hue/ssl_cert.py
core-master/emulated_hue/utils.py
core-master/emulated_hue/web.py
core-master/emulated_hue/web_static/
core-master/emulated_hue/web_static/debug/
core-master/emulated_hue/web_static/debug/clip.css
core-master/emulated_hue/web_static/debug/clip.html
core-master/emulated_hue/web_static/debug/clip.js
core-master/emulated_hue/web_static/description.xml
core-master/emulated_hue/web_static/favicon.ico
core-master/emulated_hue/web_static/hue_logo_0.png
core-master/pyproject.toml
core-master/requirements-dev.txt
core-master/requirements.txt
[13:25:13] INFO: Installed successfully!
cont-init: info: /etc/cont-init.d/20-install.sh exited 0
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun emulated-hue (no readiness notification)
s6-rc: info: service legacy-services successfully started
[13:25:13] INFO: Starting Emulated Hue...
Traceback (most recent call last):
  File "<frozen runpy>", line 189, in _run_module_as_main
  File "<frozen runpy>", line 148, in _get_module_details
  File "<frozen runpy>", line 112, in _get_module_details
  File "/app/emulated_hue/__init__.py", line 4, in <module>
    from . import controllers
  File "/app/emulated_hue/controllers/__init__.py", line 5, in <module>
    from .config import Config
  File "/app/emulated_hue/controllers/config.py", line 20, in <module>
    from .devices import force_update_all
  File "/app/emulated_hue/controllers/devices.py", line 13, in <module>
    from .models import ALL_STATES, Controller, EntityState
  File "/app/emulated_hue/controllers/models.py", line 104, in <module>
    ALL_STATES: list = list(vars(EntityState).get("__fields__"))
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not iterable
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped

This is the output of the non (dev) version:

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
cont-init: info: running /etc/cont-init.d/00-set-vars.sh
cont-init: info: /etc/cont-init.d/00-set-vars.sh exited 0
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun emulated-hue (no readiness notification)
s6-rc: info: service legacy-services successfully started
[13:37:02] INFO: Starting Emulated Hue...
2024-02-28 13:37:03,097 DEBUG aiorun -- Entering run()
2024-02-28 13:37:03,097 DEBUG aiorun -- Creating default executor
2024-02-28 13:37:03,098 INFO  emulated_hue.controllers.config -- Auto detected listen IP address is 192.168.178.108
2024-02-28 13:37:03,098 WARNING emulated_hue.controllers.config -- Non default http/https ports detected. Hue apps require the bridge at the default ports 80/443, use at your own risk.
2024-02-28 13:37:03,103 DEBUG getmac -- Raw MAC found: None
2024-02-28 13:37:03,103 DEBUG getmac -- Raw MAC found: 02:cf:7a:77:18:cc

2024-02-28 13:37:03,109 INFO  hass_client -- Connected to Home Assistant ws (version 2024.2.5)
2024-02-28 13:37:03,154 INFO  emulated_hue.web -- Started HTTP webserver on port 80
2024-02-28 13:37:03,177 INFO  emulated_hue.web -- Started HTTPS webserver on port 4443
2024-02-28 13:37:03,180 DEBUG asyncio -- Using selector: EpollSelector
2024-02-28 13:37:52,124 DEBUG emulated_hue.apiv1 -- [192.168.178.106] POST /api/
2024-02-28 13:37:52,125 DEBUG emulated_hue.apiv1 -- {"devicetype":"Harmony Hub"}
2024-02-28 13:37:52,125 INFO  emulated_hue.controllers.config -- Link request detected - Use the Homeassistant frontend to confirm this link request.
2024-02-28 13:37:54,565 DEBUG emulated_hue.apiv1 -- [192.168.178.106] POST /api/
2024-02-28 13:37:54,565 DEBUG emulated_hue.apiv1 -- {"devicetype":"Harmony Hub"}
2024-02-28 13:37:55,160 DEBUG emulated_hue.apiv1 -- [192.168.178.191] GET /link/ICZ7d7lvsk21u0UFWA4HlzMC53GNgtLe
2024-02-28 13:37:55,161 INFO  emulated_hue.controllers.config -- Link mode is enabled for the next 5 minutes.
2024-02-28 13:37:56,924 DEBUG emulated_hue.apiv1 -- [192.168.178.106] POST /api/
2024-02-28 13:37:56,925 DEBUG emulated_hue.apiv1 -- {"devicetype":"Harmony Hub"}
2024-02-28 13:37:56,925 INFO  emulated_hue.apiv1 -- Client Harmony Hub registered
2024-02-28 13:37:56,925 INFO  emulated_hue.controllers.config -- Link mode is disabled.
2024-02-28 13:37:58,097 DEBUG emulated_hue.apiv1 -- [192.168.178.106] GET /api/fIOBogJIMFFPAxU364StOH1aFkSGGTMlZDwbiJt3/lights
2024-02-28 13:37:59,101 DEBUG emulated_hue.apiv1 -- [192.168.178.106] GET /api/fIOBogJIMFFPAxU364StOH1aFkSGGTMlZDwbiJt3/groups
2024-02-28 13:37:59,184 DEBUG emulated_hue.apiv1 -- [192.168.178.106] GET /api/fIOBogJIMFFPAxU364StOH1aFkSGGTMlZDwbiJt3/scenes
2024-02-28 13:37:59,261 DEBUG emulated_hue.apiv1 -- [192.168.178.106] GET /api/fIOBogJIMFFPAxU364StOH1aFkSGGTMlZDwbiJt3/groups
2024-02-28 13:37:59,749 DEBUG emulated_hue.apiv1 -- [192.168.178.106] GET /api/fIOBogJIMFFPAxU364StOH1aFkSGGTMlZDwbiJt3/lights
2024-02-28 13:38:00,057 DEBUG emulated_hue.apiv1 -- [192.168.178.106] GET /api/fIOBogJIMFFPAxU364StOH1aFkSGGTMlZDwbiJt3/lights
2024-02-28 13:38:00,193 DEBUG emulated_hue.apiv1 -- [192.168.178.106] GET /api/fIOBogJIMFFPAxU364StOH1aFkSGGTMlZDwbiJt3/groups
2024-02-28 13:38:10,308 DEBUG emulated_hue.apiv1 -- [192.168.178.106] GET /api/fIOBogJIMFFPAxU364StOH1aFkSGGTMlZDwbiJt3/lights
2024-02-28 13:38:10,628 DEBUG emulated_hue.apiv1 -- [192.168.178.106] GET /api/fIOBogJIMFFPAxU364StOH1aFkSGGTMlZDwbiJt3/lights
2024-02-28 13:38:11,549 DEBUG emulated_hue.apiv1 -- [192.168.178.106] GET /api/fIOBogJIMFFPAxU364StOH1aFkSGGTMlZDwbiJt3/groups

Operating system

HassOS

Install method

HassOS Addon

Version

0.3.0

Dev Version

master or ""

Any other information that may be helpful

No response

alexyao2015 commented 4 months ago

Try clearing out you data from your /config/hass-emulated-hue directory and restart and repair?

carsten-h commented 4 months ago

I deinstalled the dev Add-On and deleted the folder. Then I installed it, configured it and started it, but the folder is not created.

Then I deinstalled it, installed the normal Add-On, configured it and started it. The folder is created, but the Harmony Hub still gets an error after pairing (I pressed the virtual button). Maybe the Harmony Hub has a problem too.

alexyao2015 commented 4 months ago

It seems like the Dev addon is crashing because it's not able to read one of your entities. Can you look through your light entities and disable them until the dev addon starts without an error? Once you find the culprit can you then post the details of the entity from developer tools -> state?

alexyao2015 commented 4 months ago

Ignore that last comment! I think I might have an idea of how to fix this

github-actions[bot] commented 2 months ago

This issue has been marked as stale due to no activity and will be closed in 7 days.

childofkorn666 commented 1 month ago

Has this been fixed? I'm getting the exact same problem trying to start the dev version, but the normal version runs perfectly fine.