hass-emulated-hue/core

404 not found when connecting

phillipsjamesg opened this issue · 8 comments

Describe the bug

I am trying to connect to using the Essentials Hue app. I get the notification, click on it. Then I get greeted by "404: Not Found".

Steps to Reproduce

No major steps.

  1. I Installed Emulated Hue via the addon repo on HomeAssistant OS.
  2. Started the service,
  3. tried to connect using Essentials Hue app
  4. Opened Notification link and that was it.

Expected behavior

I was expecting "connected" or something along those lines.

Logs

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-set-vars.sh: executing... 
[cont-init.d] 00-set-vars.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[03:26:19] INFO: Starting Emulated Hue...
2022-03-20 03:26:22,505 INFO  emulated_hue.config -- Auto detected listen IP address is 10.0.0.60
2022-03-20 03:26:22,650 INFO  hass_client -- Connected to Home Assistant ws (version 2022.3.5)
2022-03-20 03:26:23,287 ERROR emulated_hue.api -- Failed to create HTTP server at port 80: [Errno 98] error while attempting to bind on address ('0.0.0.0', 80): address already in use
2022-03-20 03:26:23,697 INFO  emulated_hue.api -- Started HTTPS webserver on port 443

Hardware Info:

  • Architecture (Ex: x86, ARM): x86
  • Addon version (Ex: stable or dev): Stable
    • Value of "tag_commit_or_branch" if using dev: n/a
  • OS (Ex: Windows 10, Ubuntu Buster): HomeAssistantOS
  • Hardware (Ex: PC, Raspberry Pi 1/2/3/Zero): PC

Additional context

I have restarted homeassistant and rebooted the system itself. Nothing seems to help. It's like something isn't being installed during installation.

Something is already using port 80 as it says in the logs.

Well dur.. I missed that completely last night. Guess I'll do digging and see if i can't figure out what. Thanks

Quick question and probably stupid. It's showing the server is using port 80. Is there something i can do to make this work?

You'll need to figure out what's using it. You can change the port from 80 to something else but a lot of apps require port 80 and 443

using: netstat -lp | grep :80, i get:

tcp        0      0 10.0.0.60:80            0.0.0.0:*               LISTEN      -

I can't find anything that is using the port. Any suggestions would be nice. If not, I guess close the issue since it's on my end. Thanks

EDIT: Notice you mention there is a docker version. Can I run this in a separate docker instance and point it to HA?

You may want to try the following suggestions here. https://unix.stackexchange.com/questions/106561/finding-the-pid-of-the-process-using-a-specific-port

You can run it on a separate host if you prefer. Another option is you can using a reverse proxy on your home assistant machine as well to proxy to the emulated hue while still allowing access to home assistant (if it's served on port 80). I personally use it with a reverse proxy.

Hey I appreciate the help. I did find that resource earlier today but, it didn't work for me. Earlier I was thinking about what I did last night and I realized I didn't include a step. I did install the stable version, uninstall and then installed the dev and I was getting the same issues and reverted back to stable. So when uninstalling it's like it never gave up port 80 originally. It was late at night when playing with it and completely forgot I had.

I gave up and running it in my HomeAssistant and put it in a docker instance on a macvlan so it has it's own network and can use the port 80 without interruption. I used the following:

  hass-emulated-hue:
    container_name: emulated_hue
    networks:
      default:
       ipv4_address: 10.0.0.52
    environment:
      - HASS_TOKEN=xxxxxx
      - HASS_URL=http://10.0.0.60:8123
    image: ghcr.io/hass-emulated-hue/core:refactor

Now everything is working as advertised. Last question. Can it connect to the Hue Sync app by chance or is it using the wrong API currently?

I appreciate the awesome software.

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