Git Product home page Git Product logo

core's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

core's Issues

Install takes forever on HASS virtual machine

I tried to install the addon on official HASS virtual machine which runs on QNAP.
It starts installing but no error, no result after:

20-09-21 21:15:49 INFO (SyncWorker_5) [supervisor.docker.addon] Start build 62c7908d/amd64-addon-emulated_hue:0.0.4

It never finishes. Any idea?

Unable to Start hass_emulated_hue

Hello, I have installed hass_emulated_hue when I start it it say this error

2020-04-25 15:12:52,387 INFO Set uid to user 0 succeeded
2020-04-25 15:12:52,391 INFO supervisord started with pid 6
2020-04-25 15:12:53,399 INFO spawned: 'hue' with pid 8
2020-04-25 15:12:54,333 INFO  emulated_hue.config -- Listen IP address not specified, auto-detected address is 10.10.20.24
2020-04-25 15:12:55,336 INFO success: hue entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
**2020-04-25 15:12:56,597 ERROR emulated_hue.hue_api -- Failed to create HTTP server at port 80: [Errno 98] error while attempting to bind on address ('10.10.20.24', 80): address in use**
2020-04-25 15:12:56,609 INFO  emulated_hue.hue_api -- Started HTTPS webserver on port 443

with netstat on the raspberry don't seems there is some services in listening on the port 80

simple webinterface UI

Add a simple webinterface where some basic stuff can be controlled:

  • link button enable/disable
  • control the entertainment packages throttling
  • clip api debugger perhaps ?
  • edit light config instead of having to manually edit emulated_hue.json

Can't be installed on vanilla Home Asisstant

Plugin can't be installed on non hass.io home assistant. Not even using HACS. Manual installation steps or HACS compatible repository will be wonderfull.

Great job, by the way.

Unable to install

Hello,
Im not able to install the addon. I followed the instructions but Im getting this error everytime:
image

Can't add bridge in Android Hue App

Fresh install, 0.0.6 version on RPI 3b 32 bit.
Emulated_Hue is detected in HUE app, link request notification appears, but after enabling link, error shows in log and pairing in hue app fails:

2020-12-30 22:54:25,867 DEBUG emulated_hue.api -- POST /api/
2020-12-30 22:54:25,868 DEBUG emulated_hue.api -- {'devicetype': 'Hue 3#Xiaomi MI 8 SE', 'generateclientkey': True}
2020-12-30 22:54:25,869 ERROR aiohttp.server -- Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
    resp = await self._request_handler(request)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_app.py", line 499, in _handle
    resp = await handler(request)
  File "/app/emulated_hue/api.py", line 79, in wrapped_func
    return await func(cls, request, request_data)
  File "/app/emulated_hue/api.py", line 183, in async_post_auth
    userdetails = await self.config.async_create_user(request_data["devicetype"])
  File "/app/emulated_hue/config.py", line 265, in async_create_user
    for item in all_users.values():
AttributeError: 'NoneType' object has no attribute 'values'

Philips TV not discovering emulated hue

Hi, I have non Android Philips TV that doesn't discover emulated hue bridge for use with Ambilight+Hue.

I have also diyHue setup and diyHue bridge is working with my TV. I think that problem is with SSDP discovery.

This is ssdp from emulated hue:

[+] ('192.168.1.211', 57234)
HTTP/1.1 200 OK
CACHE-CONTROL: max-age=60
EXT:
LOCATION: http://192.168.1.211:80/description.xml
SERVER: FreeRTOS/6.0.5, UPnP/1.0, IpBridge/0.1
hue-bridgeid: 1234
ST: urn:schemas-upnp-org:device:basic:1
USN: uuid:Socket-1_0-221438K0100073::urn:schemas-upnp-org:device:basic:1

And this from diyHue:

[+] ('192.168.1.211', 1900)
HTTP/1.1 200 OK
HOST: 239.255.255.250:1900
EXT:
CACHE-CONTROL: max-age=100
LOCATION: http://192.168.1.211:80/description.xml
SERVER: Linux/3.14.0 UPnP/1.0 IpBridge/1.20.0
hue-bridgeid: B827EBFFFEB31E9E
ST: upnp:rootdevice
USN: uuid:2f402f80-da50-11e1-9b23-b827ebb31e9e::upnp:rootdevice


[+] ('192.168.1.211', 1900)
HTTP/1.1 200 OK
HOST: 239.255.255.250:1900
EXT:
CACHE-CONTROL: max-age=100
LOCATION: http://192.168.1.211:80/description.xml
SERVER: Linux/3.14.0 UPnP/1.0 IpBridge/1.20.0
hue-bridgeid: B827EBFFFEB31E9E
ST: uuid:2f402f80-da50-11e1-9b23-b827ebb31e9e
USN: uuid:2f402f80-da50-11e1-9b23-b827ebb31e9e


[+] ('192.168.1.211', 1900)
HTTP/1.1 200 OK
HOST: 239.255.255.250:1900
EXT:
CACHE-CONTROL: max-age=100
LOCATION: http://192.168.1.211:80/description.xml
SERVER: Linux/3.14.0 UPnP/1.0 IpBridge/1.20.0
hue-bridgeid: B827EBFFFEB31E9E
ST: urn:schemas-upnp-org:device:basic:1
USN: uuid:2f402f80-da50-11e1-9b23-b827ebb31e9e

I'm using both on the same host (ofcourse not simultaneously), so the IP is the same...

description.xml looks almost the same - differnece that UDN match ssdp USN in diyHue, this is from Emulated Hue:

<root xmlns="urn:schemas-upnp-org:device-1-0">
<specVersion>
<major>1</major>
<minor>0</minor>
</specVersion>
<URLBase>http://192.168.1.211:80/</URLBase>
<device>
<deviceType>urn:schemas-upnp-org:device:Basic:1</deviceType>
<friendlyName>Home Assistant</friendlyName>
<manufacturer>Signify</manufacturer>
<manufacturerURL>http://www.philips.com</manufacturerURL>
<modelDescription>Philips hue Personal Wireless Lighting</modelDescription>
<modelName>Philips hue bridge 2015</modelName>
<modelNumber>BSB002</modelNumber>
<modelURL>http://www.meethue.com</modelURL>
<serialNumber>B682D3FFFE45AC29</serialNumber>
<UDN>uuid:2f402f80-da50-11e1-9b23-b682d345ac29</UDN>
<presentationURL>index.html</presentationURL>
<iconList>
<icon>
<mimetype>image/png</mimetype>
<height>48</height>
<width>48</width>
<depth>24</depth>
<url>hue_logo_0.png</url>
</icon>
<icon>
<mimetype>image/png</mimetype>
<height>120</height>
<width>120</width>
<depth>24</depth>
<url>hue_logo_3.png</url>
</icon>
</iconList>
</device>
</root>

and this from diyHue:

<root xmlns="urn:schemas-upnp-org:device-1-0">
<specVersion>
<major>1</major>
<minor>0</minor>
</specVersion>
<URLBase>http://192.168.1.211:80/</URLBase>
<device>
<deviceType>urn:schemas-upnp-org:device:Basic:1</deviceType>
<friendlyName>Philips hue (192.168.1.211)</friendlyName>
<manufacturer>Signify</manufacturer>
<manufacturerURL>http://www.philips.com</manufacturerURL>
<modelDescription>Philips hue Personal Wireless Lighting</modelDescription>
<modelName>Philips hue bridge 2015</modelName>
<modelNumber>BSB002</modelNumber>
<modelURL>http://www.meethue.com</modelURL>
<serialNumber>b827ebb31e9e</serialNumber>
<UDN>uuid:2f402f80-da50-11e1-9b23-b827ebb31e9e</UDN>
<presentationURL>index.html</presentationURL>
<iconList>
<icon>
<mimetype>image/png</mimetype>
<height>48</height>
<width>48</width>
<depth>24</depth>
<url>hue_logo_0.png</url>
</icon>
</iconList>
</device>
</root>

I'm using diyHue currently but prefer Emulated Hue because of better HA integration.

Unable to link to Hue app

When trying to link to Hue app, it just times out (even thou I enabled Link mode from HA)

Any ideas?

Save alert state

Alerts are currently sent directly to HA and always returns none regardless of the actual state. Save a received state to the config or to memory for future retrieval.

Hue Entertainment - Lights not responding

Describe the bug

Hello,
I just tried to set up the Hue entertainment areas. It works fine so far, you can set it up and save it. While arranging the lights, they react, but as soon as you get to the part about testing the synchronisation, the lights stay exactly as they were before. No change whatsoever. The lights can be controlled otherwise. (I have tried it with different lights, but the same thing happened with all of them).

Steps to Reproduce

  1. Go To Settings
  2. Click on Entertainment-Areas
  3. Create Area
  4. Select a Light
  5. Arrange the light
  6. Click on Next 2x

Expected behavior

The light symbols should light up in different colours in the app, but the lights remain the same as when they were arranged.

Logs

Hardware Info:

  • Architecture (Ex: x86, ARM):
  • Addon version (Ex: stable or dev): dev
    • Value of "tag_commit_or_branch" if using dev: master
  • OS (Ex: Windows 10, Ubuntu Buster): HassOS (Running in HyperV on Windows10)
  • Hardware (Ex: PC, Raspberry Pi 1/2/3/Zero): PC

Additional context

I'm trying to connect it to Razer Synapse, the lights are also recognised perfectly there, but none of the lights change no matter what I set.

Android official App finds bridge, immediately switches to no new bridge found, iPhone works perfectly

Hey,
so I am using a Raspberry Pi 4 with a Raspbee and Home Assistant 0.116.3 (HassOS 4.13, supervisor 247) and added the Emulated HUE Integration v0.0.4. The Integration seems to start fine, logs show:

2020-10-15 16:37:39,614 INFO Set uid to user 0 succeeded
2020-10-15 16:37:39,618 INFO supervisord started with pid 6
2020-10-15 16:37:40,625 INFO spawned: 'hue' with pid 8
2020-10-15 16:37:41,628 INFO success: hue entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2020-10-15 16:37:41,671 INFO emulated_hue.config -- Listen IP address not specified, auto-detected address is 192.168.178.36
2020-10-15 16:37:42,870 INFO emulated_hue.hue_api -- Started HTTP webserver on port 80
2020-10-15 16:37:42,882 INFO emulated_hue.hue_api -- Started HTTPS webserver on port 443

So I downloaded the official Philips Hue App (Version 3.43.0 from Sep. 17th 2020) from the Google Play Store on my Pixel 2 Xl (running Android 11) and try to connect to the bridge. It searches for bridges after a couple seconds finds a bridge, but immediately turns back to

Screenshot_20201015-185327

No new Hue Bridge found

Screenshot_20201015-185302

The Integration seems to recognize the attempted connection by the app according to the log and the notification

2020-10-15 16:52:33,248 INFO emulated_hue.config -- Link request detected - Use the Homeassistant frontend to confirm this link request.

I can enable Link Mode by clicking on the link in the notification, and the log shows that it should be active

2020-10-15 16:58:00,251 INFO emulated_hue.config -- Link mode is enabled for the next 60 seconds.

However, the hue app keeps showing the same behavior and immerdiattly shows no new bridge found. I've tried the help and manual IP function, but that didn't work either. I also reset the Addon, the Pi/Home Assistant as well as my phone without any change. Any idea what the issue could be?

So then I took my girlfriends iPhone and if found the emulated bridge, let me chose it and link succesfully without any problems.

Any idea what could cause the issue with the Android App? Is the App itself or perhaps Android 11?

Many thanks and best regards

Refactor api into a module

Api.py is getting long due to all the API endpoints being grouped together into a single file. Perhaps convert it to a module instead with endpoints broken into separate files for Lights API, Groups API, etc., similar to how Hue documentation is setup.

Error after a reboot of Home Assistant

Hello, I have Home Assistant in Docker on a Pi 4, the emulated hue is working well (Hue app and Philips TV) but when I reboot Home Assistant nothing is working anymore. Here is my log:

2020-08-29 15:54:47,407 WARNING emulated_hue.hue_api -- Link mode is not enabled!
2020-08-29 15:54:47,425 WARNING emulated_hue.hue_api -- Link mode is not enabled!
2020-08-29 15:54:47,454 WARNING emulated_hue.hue_api -- Link mode is not enabled!
2020-08-29 15:54:47,478 WARNING emulated_hue.hue_api -- Link mode is not enabled!
2020-08-29 15:54:47,502 WARNING emulated_hue.hue_api -- Link mode is not enabled!
2020-08-29 15:56:05,446 WARNING aiohttp.websocket -- websocket connection is closing.
2020-08-29 15:56:05,446 WARNING asyncio -- socket.send() raised exception.
2020-08-29 15:56:06,618 WARNING emulated_hue.hue_api -- Invalid request: <Request GET / >
2020-08-29 15:56:28,845 WARNING aiohttp.websocket -- websocket connection is closing.
2020-08-29 15:56:28,846 WARNING asyncio -- socket.send() raised exception.

The only way I found to make it work again is to uninstall it and reinstall it. I don't want to have to do that at every reboot 😅

Thank you in advance for your help! 😀

Unable to pair with iPhone

Hub shows in hue app and notification appears in HA but when enable link mode it doesn’t pair and then the hub is no longer found on searches after that.

'all 4 hue' app will not connect to emulated bridge

getting most philips apps to pair with the emulated bridge requires a little bit of finesse, but they will eventually connect. i must have tried over 40 times with the 'all 4 hue' app on multiple android devices in every automatic iteration or manual sequence i could think of with no luck. it's the only app that absolutely refuses to recognize there's a hub at the specified ip address. the emulated bridge doesn't even flash a notification in lovelace to indicate that anything connected. i've even tried initiating a connection with a different app (on the same phone) to get the notification, killing said app, pressing the simulated button before and after switching over to 'all 4 hue' to start the automatic and manual discovery processes. the app has no problems connecting to a physical philips v2 bridge on the same or an alternate network.

Hue Sync does not find bridge

Since the Entertainment Zones are working so much better now (can actually add all my desired lights to them, ty :)) I tried syncing to Phillips HueSync for PC to get my "Ambilight" going. Unfotunately the program can not finde the bridge. I just searches the bridge forever. The prompt for link mode is triggered, but it never connects.

Addon won't start on new repository

Rpi 3b+ 32 bit

I have updated repository to https://github.com/hass-emulated-hue/hassio-repo and tried beta and stable addon, after trying to start only this will log and it interrupts:

/init: 11: /init: /bin/importas: Exec format error
/init: 12: export: /usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin: bad variable name

dev doesn't build:

21-01-04 15:05:25 INFO (SyncWorker_2) [supervisor.docker.addon] Starting build for 7c966942/armv7-addon-emulated-hue-dev:dev
21-01-04 15:06:06 ERROR (SyncWorker_2) [supervisor.docker.addon] Can't build 7c966942/armv7-addon-emulated-hue-dev:dev: The command '/bin/sh -c wget -O base.tar.gz https://github.com/hass-emulated-hue/s6-overlay-base/archive/master.tar.gz     && /base     && tar zxvf base.tar.gz --strip 1 -C /base' returned a non-zero code: 127
21-01-04 15:06:06 ERROR (SyncWorker_2) [supervisor.docker.addon] Build log:
Step 1/11 : FROM alpine:latest as downloader
 ---> 857a3eeeed97
Step 2/11 : RUN wget -O base.tar.gz https://github.com/hass-emulated-hue/s6-overlay-base/archive/master.tar.gz     && /base     && tar zxvf base.tar.gz --strip 1 -C /base
 ---> Running in 23e31f5f8f20
Connecting to github.com (140.82.121.3:443)

Connecting to codeload.github.com (140.82.121.9:443)

saving to 'base.tar.gz'

base.tar.gz          100% |********************************|  1360  0:00:00 ETA
'base.tar.gz' saved

/bin/sh: /base: not found

Removing intermediate container 23e31f5f8f20

21-01-04 15:06:06 ERROR (MainThread) [asyncio] Task exception was never retrieved
future: <Task finished name='Task-10609592' coro=<Job.__call__.<locals>.wrapper() done, defined at /usr/src/supervisor/supervisor/jobs/decorator.py:38> exception=AddonsError()>
Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/docker/addon.py", line 413, in _build
    image, log = self.sys_docker.images.build(
  File "/usr/local/lib/python3.8/site-packages/docker/models/images.py", line 287, in build
    raise BuildError(chunk['error'], result_stream)
docker.errors.BuildError: The command '/bin/sh -c wget -O base.tar.gz https://github.com/hass-emulated-hue/s6-overlay-base/archive/master.tar.gz     && /base     && tar zxvf base.tar.gz --strip 1 -C /base' returned a non-zero code: 127
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/addons/__init__.py", line 182, in install
    await addon.instance.install(store.version, store.image)
  File "/usr/src/supervisor/supervisor/utils/__init__.py", line 33, in wrap_api
    return await method(api, *args, **kwargs)
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/supervisor/supervisor/docker/addon.py", line 400, in _install
    self._build(tag)
  File "/usr/src/supervisor/supervisor/docker/addon.py", line 433, in _build
    raise DockerError() from err
supervisor.exceptions.DockerError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/jobs/decorator.py", line 63, in wrapper
    raise err
  File "/usr/src/supervisor/supervisor/jobs/decorator.py", line 61, in wrapper
    return await self._method(*args, **kwargs)
  File "/usr/src/supervisor/supervisor/addons/__init__.py", line 185, in install
    raise AddonsError() from err
supervisor.exceptions.AddonsError

Unable to limit entries

i*m trying to limit the entries that emualted_hue registeres as I have a LOT of IHC entries.

No matter what I do, the configuration is not registered from configuration.yaml or the config setting in the add-in. I've tried to set expose_by_default: false but this does not help. I've tried to set all light entries to hidden - this does not help.

Udklip

I the analyzed your code and it seems that you are taking the configuration from emulated_hue.json. Where is this file located? It is not in the config directory.

Udklip2

It seems like it ignores all configuration.

can't connect Hue Essentials app

first of all: thanks for this amazing program! this could really fill the last gap now I've switched from Hue gateway to Home Assistant.

I am able to connect via the official Hue app (although I get that update error someone else made an issue about already)

Too bad I cannot connect with the hue essentials app! I get errors both automatically (left) as manually (right)
https://imgur.com/kI5mvZ3

any tip?

Choppy Ambilight Transissions with Yeelight

Hi,
I‘m having some smoothness issues with Emulated Hue and Ambilight with my Yeelight bulbs. I‘ve enabled music mode on the bulbs and changed transition times (0ms-1000ms in 100ms steps). Any ideas what I can try?

Refactor business logic into controller(s)

As this project started relatively small, the business logic for sending commands to HA and process internal "HUE only" commands is now contained into the Hue api. It's time to move this intro separate controllers so we have the benefit of cleaner code and reusable code.

  1. controller for all business logic to HA (such as issue light command, throtling etc.)
  2. controller for all "HUE only" business logic, like the localstorage, scenes etc.

The API will then be just a definition of endpoints, calling actions on he controllers.

Invalid request

Hi

thanks for great addon ! I'm testing it with few light, and found some WARNING in logs, lights seems to work fine except of that.
WARNING emulated_hue.api -- Invalid request: <Request POST /api/ba5bca5d868e448f8e74/groups/ > --> {'lights': ['6', '7', '9', '32'], 'type': 'LightGroup'}

Im testing with Philiph tv PUS8535.

[BUG] Bridge not found on Philips Android Ambilight TV

Describe the bug
When I try to connect this emulated bridge with my Ambilight Philips Android TV, you can't select the lights you want to use for the entertainment mode, instead EmulatedHue throws an exception.

Steps to Reproduce

  1. On Android TV (with Philips Ambilight) goto Settings -> Ambilight + Hue -> Setup
  2. Select Home Assistant (the Emulated Bridge) as the Bridge
  3. TV shows dialog to confirm settings with bridge button press
  4. Notification in HomeAssistant, with working link to click emulated button
  5. TV accepts button press and goes to next screen where you can usually select the lights you want to use, but instead there's a text saying "No bridge"
  6. EmulatedHue throws exceptions

Expected behavior

Logs

2021-01-07 23:31:40,444 INFO  emulated_hue.config -- Auto detected listen IP address is 192.168.69.199
2021-01-07 23:31:40,476 INFO  hass-client -- Connecting to hassio/homeassistant
2021-01-07 23:31:40,480 INFO  emulated_hue.api -- Started HTTP webserver on port 80
2021-01-07 23:31:40,497 INFO  hass-client -- Connected to hassio/homeassistant
2021-01-07 23:31:40,574 INFO  emulated_hue.api -- Started HTTPS webserver on port 443
2021-01-07 23:34:18,044 INFO  emulated_hue.config -- Link request detected - Use the Homeassistant frontend to confirm this link request.
2021-01-07 23:34:21,862 INFO  emulated_hue.config -- Link mode is enabled for the next 5 minutes.
2021-01-07 23:34:21,871 INFO  emulated_hue.api -- Client 55PUS7354/12 registered
2021-01-07 23:34:21,914 ERROR aiohttp.server -- Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
    resp = await self._request_handler(request)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_app.py", line 499, in _handle
    resp = await handler(request)
  File "/app/emulated_hue/api.py", line 89, in wrapped_func
    return await func(cls, request)
  File "/app/emulated_hue/api.py", line 460, in get_full_state
    "lights": await self.__async_get_all_lights(),
  File "/app/emulated_hue/api.py", line 768, in __async_get_all_lights
    result[light_id] = await self.__async_entity_to_hue(entity, light_config)
  File "/app/emulated_hue/api.py", line 753, in __async_entity_to_hue
    for key, value in device["identifiers"]:
ValueError: too many values to unpack (expected 2)
2021-01-07 23:34:25,924 INFO  emulated_hue.api -- Stop Entertainment mode for group 6 - params: {'stream': {'active': False}}
2021-01-07 23:34:25,944 INFO  emulated_hue.entertainment -- Start HUE Entertainment Service on UDP port 2100.
2021-01-07 23:34:26,166 ERROR aiohttp.server -- Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
    resp = await self._request_handler(request)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_app.py", line 499, in _handle
    resp = await handler(request)
  File "/app/emulated_hue/api.py", line 89, in wrapped_func
    return await func(cls, request)
  File "/app/emulated_hue/api.py", line 460, in get_full_state
    "lights": await self.__async_get_all_lights(),
  File "/app/emulated_hue/api.py", line 768, in __async_get_all_lights
    result[light_id] = await self.__async_entity_to_hue(entity, light_config)
  File "/app/emulated_hue/api.py", line 753, in __async_entity_to_hue
    for key, value in device["identifiers"]:
ValueError: too many values to unpack (expected 2)
2021-01-07 23:39:21,864 INFO  emulated_hue.config -- Link mode is disabled.

Hardware Info:

  • Architecture: x86_64 (HomeAssistant in VM)
  • Addon version: 0.0.11 stable
  • OS: Official Home Assistant ISO (Linux)
  • Hardware: PC

Thanks in advance for your help :)

F.Lux Pairing Issues

Describe the bug

F.lux will not pair

GET /api
GET /api//lights

We need to determine the correct response for those endpoints

Steps to Reproduce

Expected behavior

Logs

Hardware Info:

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

Additional context

Can't install on HassOS 4.14 RPI3b+ 32 bit

Install will fail every time with completely system hang-up after about 10 minutes after:

[supervisor.docker.addon] Starting build for 62c7908d/armv7-addon-emulated_hue:0.0.4

After hard reboot, addon will fail to start:

20-10-21 10:24:03 ERROR (SyncWorker_1) [supervisor.docker] Image 62c7908d/armv7-addon-emulated_hue not exists for addon_62c7908d_emulated_hue
20-10-21 10:24:03 WARNING (MainThread) [supervisor.addons] Can't start Add-on 62c7908d_emulated_hue

I can press "rebiuild" button on supervisor addon page, after about 20 minutes:

20-10-21 10:31:46 ERROR (SyncWorker_1) [supervisor.docker] Image 62c7908d/armv7-addon-emulated_hue not exists for addon_62c7908d_emulated_hue
20-10-21 10:34:29 INFO (SyncWorker_2) [supervisor.docker.interface] Removeing image 62c7908d/armv7-addon-emulated_hue with latest and None
20-10-21 10:34:29 INFO (SyncWorker_6) [supervisor.docker.addon] Starting build for 62c7908d/armv7-addon-emulated_hue:0.0.4
20-10-21 11:06:25 ERROR (SyncWorker_6) [supervisor.docker.addon] Can't build 62c7908d/armv7-addon-emulated_hue:0.0.4: The command '/bin/sh -c apk add --no-cache --virtual .build-dependencies         build-base         cmake         libuv-dev         libffi-dev         python3-dev         openssl-dev         git     && apk add --no-cache         python3         openssl         supervisor     && mkdir /usr/local/app     && git clone https://github.com/marcelveldt/hass_emulated_hue.git     && pip3 install         --no-cache-dir         -r hass_emulated_hue/requirements.txt     && cp -R hass_emulated_hue/emulated_hue /usr/local/app/     && cp hass_emulated_hue/run.py /usr/local/app/run.py     && apk del --no-cache --purge .build-dependencies     && find /usr/local         \( -type d -a -name test -o -name tests -o -name '__pycache__' \)         -o \( -type f -a -name '*.pyc' -o -name '*.pyo' \)         -exec rm -rf '{}' +     && rm -f -r         /root/.cache         /root/.cmake         /tmp/*         hass_emulated_hue' returned a non-zero code: 1
20-10-21 11:06:25 ERROR (MainThread) [asyncio] Task exception was never retrieved
future: <Task finished name='Task-1517' coro=<AddonManager.rebuild() done, defined at /usr/src/supervisor/supervisor/addons/__init__.py:279> exception=AddonsError()>
Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/docker/addon.py", line 413, in _build
    image, log = self.sys_docker.images.build(
  File "/usr/local/lib/python3.8/site-packages/docker/models/images.py", line 287, in build
    raise BuildError(chunk['error'], result_stream)
docker.errors.BuildError: The command '/bin/sh -c apk add --no-cache --virtual .build-dependencies         build-base         cmake         libuv-dev         libffi-dev         python3-dev         openssl-dev         git     && apk add --no-cache         python3         openssl         supervisor     && mkdir /usr/local/app     && git clone https://github.com/marcelveldt/hass_emulated_hue.git     && pip3 install         --no-cache-dir         -r hass_emulated_hue/requirements.txt     && cp -R hass_emulated_hue/emulated_hue /usr/local/app/     && cp hass_emulated_hue/run.py /usr/local/app/run.py     && apk del --no-cache --purge .build-dependencies     && find /usr/local         \( -type d -a -name test -o -name tests -o -name '__pycache__' \)         -o \( -type f -a -name '*.pyc' -o -name '*.pyo' \)         -exec rm -rf '{}' +     && rm -f -r         /root/.cache         /root/.cmake         /tmp/*         hass_emulated_hue' returned a non-zero code: 1
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/addons/__init__.py", line 303, in rebuild
    await addon.instance.install(addon.version)
  File "/usr/src/supervisor/supervisor/utils/__init__.py", line 32, in wrap_api
    return await method(api, *args, **kwargs)
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/supervisor/supervisor/docker/addon.py", line 400, in _install
    self._build(tag)
  File "/usr/src/supervisor/supervisor/docker/addon.py", line 424, in _build
    raise DockerError() from err
supervisor.exceptions.DockerError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/addons/__init__.py", line 305, in rebuild
    raise AddonsError() from err
supervisor.exceptions.AddonsError

Persistent config

Is your feature request related to a problem? Please describe.

Yes - its frustrating when I lost my config over and over :)

Describe the feature that you would like to be added

Please add possibility to export/import config or move caonfig file to shared folder outside docker container so it will survive addon reinstall/switching branches

Describe alternatives you've considered

I was able to backup and restore my config few times, but not not always I remember to do it... It is also not easy for casual user.

Describe your use case for this feature

I think that better will be to use shared folder for config and cert files

Additional context

...

Unable to install from within hassio

Hi!
I am trying to install this addon - using the supervisor ( running hassio version: 0.105.3 on Ubuntu 18.04.4 LTS )

But i get an error - saying: Failed to install addon, [object Object]

hue_bridge

I am not sure if its because i am running on ubuntu - or because have allready used port 80 and 443 by other docker containers?

br Ronni

Official Hue app asking for update

Hello, I installed the new version 0.0.5, on my HassOS 5.9 with Home assistant version 2020.12.1.
Everything goes smooth as butter until after I connected with it with the 'link button'.
The app tells me there is an update available.

I tried rebooting and reinstalling the addon but to no avail.

Hub Discovery Not Working

HueManic and Sleep as Android from the same developer will not find the bridge automatically. It seems likely that the issue is related to incorrect data in the SSDP response as the emulator responds but the app does not find it.

Manual pairing now works with the #51

Ambilight+Hue flashy transitions

Hey,

so I finally managed to migrate my Hue lights to deConz and install your add-on. Connecting it to my Android TV was easy and worked pretty well (yay!).

However, watching TV, I noticed that the colors of the lights simply jump and have no transition, which makes it annoying to use, sadly.

Is it possible to add a transition? I will try to have a look at the source this weekend.

And thanks a lot for your effort!

Bridge Discovery within apps

First up thanks for this addon - I have been chasing a method to use my HA lights in certain hue apps for ages in an attempt to move all my remaining hue lights to HA and drop the hue hub.

In particular I'm trying to get the Hue Disco (iOS) app working. I've tried to add the emulated bridge but there is no manual entry and discovery fails, it only sees my existing hue bridge. the only app I'm able to get working with the emulated hue bridge is the Hue Essentials App which supports manually entering a bridge ip.

For comparison, here is the discovery info picked up by ZeroConf Browser for the Hue bridge vs my the hass emulated bridge

Hue:
Screen Shot 2020-02-13 at 10 23 11 AM

HASS:
Screen Shot 2020-02-13 at 10 23 25 AM

Cannot create Entertainment Area in Hue App

Unable to create an Entertainment Area in the Hue iOS App (which is required to be able to add Hue lights to Razer Chroma) because it shows that the lights need a firmware update. Obviously cannot update the light firmware since they're not Philips Hue lights. Using Yeelight lights if it matters.

Also does not work with official Hue Sync app on PC.

hue-4

Philips Hue App require to update the 'Emulated Hue' hub

The Philips Hue App versio 3.37.0 (11071) keeps requesting to update the hub. Most of the features in the app is disabled until the hub is updated (which of course is not possible).

All in all: The Emulated Hue is not functional and working sence HUE App 3.37.0 (11071)

Entities filtering

Hi,

In my use case I'd like family members to control a limited subset of all HA-managed lights, couldn't find a way to whitelist/blacklist entities as I understand all entities from the light domain are by default exposed to the emulated hue. Would be a great feature to add if not available.

Cheers!

F.

Throttling for HA API for Ambilight+Hue

I'm using zigbee2mqtt to control HA lights. When I enable Ambilight+Hue on my Philips TV with emulated Hue, I can see lot of not smooth color changes (instant changes). When I trace mqtt messages, I see that message is sended to lights 3-8 times per second with transition parameter from 0.03 to 0.08s as you can see on the screen from MQTT Explorer:

image

It looks that this is too small amount for transition time, and transition is instant... I think also that throttling doesn't work in Ambilight+Hue mode (8 messages per second is way too much for non Hue bulbs I think...)

diyHue is behaving differently - transition is longer and smooth, and there is less noticable color changes, so color is little laggy comparing to TV ambilight but it feels much smoother

EDIT:
Also I noticed unhandled message in Zigbee2Mqtt sended on toggling Ambilight+Hue off:

Publish 'set' 'effect' to 'Taśma LED RGBW - salon (prawa)' failed: 'Error: 'none' not allowed, choose between: blink,breathe,okay,channel_change,finish_effect,stop_effect'

Hue Entertainment Does Not Automatically Stop

Describe the bug

Hue entertainment does not stop automatically. We need to stop entertainment both after the emulator is shutdown and after we receive a stop request.

Likely need to:

  1. Not store streaming action in config but rather dynamically grab the status from memory.
  2. Use modifying an entertainment group as a signal to stop streaming.

Steps to Reproduce

Expected behavior

Logs

Logs from the official hue app when streaming is stopped.

2021-01-07 20:16:09,695 DEBUG emulated_hue.api -- [10.0.0.160] PUT /api/username/groups/5/action
2021-01-07 20:16:09,695 DEBUG emulated_hue.api -- {'on': True, 'bri': 77, 'xy': [0.4584, 0.41]}

Hardware Info:

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

Additional context

Unable to link Ambilight+Hue

I have tried moving my TV to the same subnet as my Home Assistant - I can search the bridge, but I cannot pair.

When trying, the TV just returns back to setup - the logs doesn't show anything.
Tried clearing data and cache for the Ambilight+Hue app to no avail.

Invalid/unknown request: <Request PUT /api/c013fbe396b847f9a306/groups/ > --> {'stream': {'active': False}}

Describe the bug

I'm getting warning in logs when I'm disabling Ambilight+Hue on non-Android Philips TV

Steps to Reproduce

  1. Turn Ambilight+Hue on
  2. Turn Ambilight+Hue off
  3. Observer Warning in logs

Expected behavior

No warning on disabling Ambilight+Hue

Logs

2021-01-10 12:39:21,495 WARNING emulated_hue.api -- Invalid/unknown request: <Request PUT /api/c013fbe396b847f9a306/groups/ > --> {'stream': {'active': False}}

Hardware Info:

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

Additional context

HA event on HUE entertaiment start

Is your feature request related to a problem? Please describe.

Describe the feature that you would like to be added

I think it would be nice to send some HA event ( or something other ? ) when entertaiment starts. It could be used to prepare lights for increased traffic ( for example in yeelight, turn on music mode, no limit for changes per minute then ). Maybe also react on it somehow ( turning off other lights etc ? ).

Describe alternatives you've considered

Doing automation that would turn on docker with emulated hue, and start music_mode for yeelights I would like to use with hue

Describe your use case for this feature

Additional context

Thanks for great addon !

Fix group 0

Describe the bug

Group 0 should modify all lights in all groups. Currently, group 0 gives an error since its not a registered group.

Steps to Reproduce

Expected behavior

group_conf = await self.config.async_get_storage_value("groups", group_id)

Properly handle group 0 by iterating through all enabled lights in all groups.

Logs

Hardware Info:

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

Additional context

Implement sensors

Sensors endpoint isn't currently supported. This results in Hue essentials effects stored on the bridge not functioning.

Better Logging

Implement DEBUG_V and DEBUG_VV for more control over the log spam from Hue apps.

DEBUG:
Hides all endpoints that are prone to be spammed.

DEBUG_V:
Shows all endpoints

DEBUG_VV:
All endpoints and our response to the request.

Unable to connect

Im running the addon in HassOS but I cant get any of my apps to connect.
The HassOS VM and the all the apps are on the same network so that shouldnt be an issue. When trying to go to "http://hassosip/api/pi/lights" I get "unauthorized" so it seems like the emulator is up and running.

When trying with Hue Essentials (manual connect) I get the notification in HA and are able to activate pairing mode. But it still wont connect.

I've also tried with the MyHarmony Windows application, the Harmony Android app, and Philips Hue app. No success.
The Harmony Android app picks up that there is a Hue brigde on my network, but it never triggers the pairing notification in HA.

Heres what the log says:

2020-10-02 20:35:06,945 INFO  emulated_hue.config -- Link request detected - Use the Homeassistant frontend to confirm this link request.
2020-10-02 20:35:12,277 INFO  emulated_hue.config -- Link mode is enabled for the next 60 seconds.
2020-10-02 20:35:12,721 WARNING emulated_hue.hue_api -- Invalid request: <Request GET /favicon.ico >

Idea: Manual light importing

Disable automatic importing of lights and only add new lights if lights are scanned for. To restore deleted lights, enter a magic "serial" when light scanning that will all lights back.

This would help with users that add new lights but may not want them all to appear in the app, removing the need for any sort of manual configuration.

May replace #46

Entities and rooms with umlauts not working hue app

My kitchen room and entities have an ü in their name (Küche). It seems like the Hue app together with the emulated bridge can't deal with that for some reason (when I used the original Hub umlauts worked). The room containing the ü is shown as others, the light insight has no name. When toggling it the light gets turned on in Hass but the hue app crashes.
IMG_4746
IMG_4747

In sleep cycle the lights are shown correctly so I am not sure if this is anything that can be fixed on your side.
IMG_4748

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.