diyhue / diyHue

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

Support for Natural Light scene in Hue app #930

Open mattmon opened 10 months ago

mattmon commented 10 months ago

Issue does not already exist?

I have searched and found no existing issue

Select Environment

Docker

Home Assistant related?

No

Description

Thanks for this great piece of software; diyHue is setup and working great as an addon in my Home Assistant.

Saving dynamic scenes from the Hue app to diyHue works, I can even activate them through Home Assistant's Hue integration.

Though, I'm having a problem with the 'Natural Daylight" scene; which I suspect is special in some way, given the '24H' badge on it's icon in the Hue app.

Screenshot-20230829-161346-Hue

Errorlog:

2023-08-29 16:33:39,505 - werkzeug - INFO - 192.168.0.35 - - [29/Aug/2023 16:33:39] "GET /api/f1097f7431b311eebef6001e0643266b/groups/0 HTTP/1.1" 200 - 2023-08-29 16:33:39,653 - werkzeug - INFO - 192.168.0.227 - - [29/Aug/2023 16:33:39] "GET /clip/v2/resource/bridge HTTP/1.1" 200 - 2023-08-29 16:33:40,685 - werkzeug - INFO - 192.168.0.227 - - [29/Aug/2023 16:33:40] "GET /clip/v2/resource/bridge HTTP/1.1" 200 - 2023-08-29 16:33:41,728 - werkzeug - INFO - 192.168.0.227 - - [29/Aug/2023 16:33:41] "GET /clip/v2/resource/bridge HTTP/1.1" 200 - 2023-08-29 16:33:42,784 - werkzeug - INFO - 192.168.0.227 - - [29/Aug/2023 16:33:42] "GET /clip/v2/resource/bridge HTTP/1.1" 200 - 2023-08-29 16:33:43,831 - werkzeug - INFO - 192.168.0.227 - - [29/Aug/2023 16:33:43] "GET /clip/v2/resource/bridge HTTP/1.1" 200 - 2023-08-29 16:33:44,507 - werkzeug - INFO - 192.168.0.35 - - [29/Aug/2023 16:33:44] "GET /api/f1097f7431b311eebef6001e0643266b/groups/0 HTTP/1.1" 200 - 2023-08-29 16:33:44,790 - flaskUI.v2restapi - DEBUG - {'metadata': {'name': 'Natural light', 'image': {'rid': 'eb014820-a902-4652-8ca7-6e29c03b87a1', 'rtype': 'public_image'}}, 'group': {'rid': '06f2e09b-21b5-5dcd-8254-c41c3eb2276d', 'rtype': 'room'}, 'week_timeslots': [{'timeslots': [{'start_time': {'kind': 'time', 'time': {'hour': 7, 'minute': 0, 'second': 0}}, 'target': {'rid': 'da8aa66f-e39e-486b-95b8-a78de2760121', 'rtype': 'scene'}}, {'start_time': {'kind': 'time', 'time': {'hour': 10, 'minute': 0, 'second': 0}}, 'target': {'rid': 'ab238b66-af2a-4514-8bcc-f97cdd4fff1d', 'rtype': 'scene'}}, {'start_time': {'kind': 'time', 'time': {'hour': 16, 'minute': 0, 'second': 0}}, 'target': {'rid': '291da21e-d587-4b82-80e5-b468c6769e6e', 'rtype': 'scene'}}, {'start_time': {'kind': 'time', 'time': {'hour': 20, 'minute': 0, 'second': 0}}, 'target': {'rid': '391b9156-2a17-4a00-9c80-4dc42246bd99', 'rtype': 'scene'}}, {'start_time': {'kind': 'time', 'time': {'hour': 22, 'minute': 0, 'second': 0}}, 'target': {'rid': '96f26ba8-6338-43bd-b248-82873c3d1f50', 'rtype': 'scene'}}, {'start_time': {'kind': 'time', 'time': {'hour': 0, 'minute': 0, 'second': 0}}, 'target': {'rid': 'f3625dde-5a8b-40ef-9c28-f9d9e954f18a', 'rtype': 'scene'}}], 'recurrence': ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday']}], 'transition_duration': 60000, 'recall': {'action': 'activate'}} [2023-08-29 16:33:44,791] ERROR in app: Exception on /clip/v2/resource/smart_scene [POST] Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1516, in full_dispatch_request rv = self.dispatch_request() File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1502, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(req.view_args) File "/usr/local/lib/python3.8/site-packages/flask_restful/init.py", line 467, in wrapper resp = resource(*args, *kwargs) File "/usr/local/lib/python3.8/site-packages/flask/views.py", line 84, in view return current_app.ensure_sync(self.dispatch_request)(args, kwargs) File "/usr/local/lib/python3.8/site-packages/flask_restful/init.py", line 582, in dispatch_request resp = meth(*args, **kwargs) File "/opt/hue-emulator/flaskUI/v2restapi.py", line 465, in post "rid": newObject.id_v2, AttributeError: 'NoneType' object has no attribute 'id_v2' 2023-08-29 16:33:44,792 - werkzeug - INFO - 192.168.0.227 - - [29/Aug/2023 16:33:44] "POST /clip/v2/resource/smart_scene HTTP/1.1" 500 - 2023-08-29 16:33:44,904 - werkzeug - INFO - 192.168.0.227 - - [29/Aug/2023 16:33:44] "GET /clip/v2/resource/bridge HTTP/1.1" 200 -

Steps to reproduce

try saving Natural Light scene to hub from Hue app

Please enter your operating system details here

Home Assistant Addon

What DiyHue version(branch) are you using?

master (latest)