Giter Club home page Giter Club logo

hass-luxor's Introduction

Luxor Component for Home Assistant

hacs

Component to integrate with FXLuminaire's Luxor lighting system.

This will make all Luxor groups available as light entities, exposing the brightness functionality. Unfortunately colors cannot be exposed due to the way Luxor defines and utilizes them.

Additionally it will expose all themes as scene entities.

hass-luxor's People

Contributors

briancmpbll avatar cpcowart avatar davidz25 avatar dcramer avatar digitalbites avatar dronenb avatar sdwilsh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

hass-luxor's Issues

Consider Renaming Scenes

One huge issue with integrations is when they clutter your hass install. The default names of the scenes being the theme names isnt great in my use case (e.g. i have a theme called "Dark" and "Astro"). Maybe it'd be better to name them X Theme.

After adding and restarting with HACS, it is not available to add

I've added this repository via HACS, installed the integration (197697b), but it doesn't show up when I try to add it in Home Assistant.

It's being loaded based on this log entry:

2022-08-30 16:56:37.136 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration luxor which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant

Entities issues

Just installed in HA 2023.4.1. Provided the IP of the controller, and it was found. The integration lists one device, but says there are no entities associated with that device.

The entities (and scenes) were created and do work to turn the lights on/off. However, but they don't have any associated device, and when you click on the Settings option in Settings > Devices & Services > Entities > light entity, it gives an error: "This entity () does not have a unique ID, there its settings cannot be managed from the UI." Lastly, the entities are marked as "Read Only" in the Status column of the entity list as well (even though the status can be changed).

Also, it does not appear that the entity updates if the status of the light was changed outside of home assistant (ie through the Luxor app or a Luxor-managed schedule).

Feature requests:

  • Configurable polling interval for all entities to keep light status up to date.
  • Luxor Groups (aka Lights) include a parent Device object in the Integration. Include a device sensor that indicates last update time.
  • Associate Luxor Scenes with the Controller Device
  • Create a Device Service command for Light devices to apply a "Luxor Color Preset" to the light.
  • Create a Device Service command for the Controller device to change the color of a Luxor Color Preset

Really happy to see this working and the progress. Let me know if I can help test any improvements. THANKS!

Quickly changing on/off status of multiple groups fails to complete

HA version 2023.8.3/latest

Thank you for such a great integration. This worked right away for me, but when I started to integrate some of the groups into my scenes in home assistant I noticed an issue.

When you in rapid secession turn on, off or any combination there of of multiple groups - it appears the controller is abandoning the subsequent requests. first one wins and then there is an error in the logs that it disconnects (although it continues to work for later single status change calls). You can still turn on/off other groups one at a time.

Another example of this is having a card setup in the front end with the header toggle available. As soon as you toggle it only one of the groups will change status with the same error.

Log output when it successfully turns on/off a light:

2023-08-22 22:25:22.609 DEBUG (MainThread) [custom_components.luxor.scene] Finished fetching luxor_scene data in 0.019 seconds (success: True)
2023-08-22 22:25:22.630 DEBUG (MainThread) [custom_components.luxor.scene] Finished fetching luxor_scene data in 0.021 seconds (success: True)
2023-08-22 22:25:42.382 DEBUG (MainThread) [custom_components.luxor.light] Finished fetching luxor_light data in 0.032 seconds (success: True)
2023-08-22 22:25:42.384 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140624855906624] Server disconnected
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 226, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1974, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2011, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/homeassistant/__init__.py", line 130, in async_handle_turn_service
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/core.py", line 1974, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2011, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service
    return await service.entity_service_call(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 898, in entity_service_call
    task.result()  # pop exception if have
    ^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1199, in async_request_call
    return await coro
           ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 942, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 591, in async_handle_light_off_service
    await light.async_turn_off(**filter_turn_off_params(light, params))
  File "/config/custom_components/luxor/light.py", line 135, in async_turn_off
    api_response = await api_instance.illuminate_group(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/deps/lib/python3.11/site-packages/luxor_openapi_asyncio/api_client.py", line 185, in __call_api
    response_data = await self.request(
                    ^^^^^^^^^^^^^^^^^^^
  File "/config/deps/lib/python3.11/site-packages/luxor_openapi_asyncio/rest.py", line 219, in POST
    return (await self.request("POST", url,
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/deps/lib/python3.11/site-packages/luxor_openapi_asyncio/rest.py", line 166, in request
    r = await self.pool_manager.request(**args)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 560, in _request
    await resp.start(conn)
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 899, in start
    message, payload = await protocol.read()  # type: ignore[union-attr]
                       ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/streams.py", line 616, in read
    await self._waiter
aiohttp.client_exceptions.ServerDisconnectedError: Server disconnected

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1199, in async_request_call
    return await coro
           ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 942, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 591, in async_handle_light_off_service
    await light.async_turn_off(**filter_turn_off_params(light, params))
  File "/config/custom_components/luxor/light.py", line 135, in async_turn_off
    api_response = await api_instance.illuminate_group(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/deps/lib/python3.11/site-packages/luxor_openapi_asyncio/api_client.py", line 185, in __call_api
    response_data = await self.request(
                    ^^^^^^^^^^^^^^^^^^^
  File "/config/deps/lib/python3.11/site-packages/luxor_openapi_asyncio/rest.py", line 219, in POST
    return (await self.request("POST", url,
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/deps/lib/python3.11/site-packages/luxor_openapi_asyncio/rest.py", line 166, in request
    r = await self.pool_manager.request(**args)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 560, in _request
    await resp.start(conn)
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 899, in start
    message, payload = await protocol.read()  # type: ignore[union-attr]
                       ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/streams.py", line 616, in read
    await self._waiter
aiohttp.client_exceptions.ServerDisconnectedError: Server disconnected


Here's the relevant debug lines from the log file:

2023-08-22 22:25:17.287 WARNING (SyncWorker_4) [homeassistant.loader] We found a custom integration luxor which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-08-22 22:25:19.270 INFO (MainThread) [homeassistant.bootstrap] Setting up stage 2: {'application_credentials', 'energy', 'map', 'nws', 'input_boolean', 'assist_pipeline', 'person', 'climate', 'input_button', 'rachio', 'script', 'default_config', 'hardware', 'airvisual_pro', 'media_source', 'input_number', 'lovelace', 'nfandroidtv', 'trace', 'tag', 'ffmpeg', 'analytics', 'mqtt', 'dyson_local', 'template', 'input_text', 'wemo', 'search', 'stream', 'apple_tv', 'myq', 'opower', 'scene', 'config', 'mjpeg', 'automation', 'nodered', 'diagnostics', 'conversation', 'counter', 'device_tracker', 'system_health', 'luxor', 'zone', 'cover', 'media_player', 'light', 'co2signal', 'homekit', 'sun', 'blueprint', 'monoprice', 'zwave_js', 'my', 'timer', 'input_datetime', 'file_upload', 'sensor', 'repairs', 'ecobee', 'ge_home', 'influxdb', 'airvisual', 'tts', 'auth', 'flume', 'ios', 'notify', 'enphase_envoy', 'stt', 'onboarding', 'homeassistant_alerts', 'bhyve', 'device_automation', 'input_select', 'schedule', 'history', 'group', 'version', 'braviatv', 'esphome', 'logbook', 'mobile_app', 'image_upload'}
2023-08-22 22:25:22.201 INFO (MainThread) [homeassistant.setup] Setting up luxor
2023-08-22 22:25:22.201 INFO (MainThread) [homeassistant.setup] Setup of domain luxor took 0.0 seconds
2023-08-22 22:25:22.589 INFO (MainThread) [homeassistant.components.scene] Setting up scene.luxor
2023-08-22 22:25:22.609 DEBUG (MainThread) [custom_components.luxor.scene] Finished fetching luxor_scene data in 0.019 seconds (success: True)
2023-08-22 22:25:22.630 DEBUG (MainThread) [custom_components.luxor.scene] Finished fetching luxor_scene data in 0.021 seconds (success: True)
2023-08-22 22:25:25.081 INFO (MainThread) [homeassistant.components.light] Setting up light.luxor
2023-08-22 22:25:25.256 DEBUG (MainThread) [custom_components.luxor.light] Finished fetching luxor_light data in 0.174 seconds (success: True)
2023-08-22 22:25:25.309 DEBUG (MainThread) [custom_components.luxor.light] Finished fetching luxor_light data in 0.052 seconds (success: True)
2023-08-22 22:25:42.382 DEBUG (MainThread) [custom_components.luxor.light] Finished fetching luxor_light data in 0.032 seconds (success: True)
  File "/config/custom_components/luxor/light.py", line 135, in async_turn_off
  File "/config/deps/lib/python3.11/site-packages/luxor_openapi_asyncio/api_client.py", line 185, in __call_api
  File "/config/deps/lib/python3.11/site-packages/luxor_openapi_asyncio/rest.py", line 219, in POST
  File "/config/deps/lib/python3.11/site-packages/luxor_openapi_asyncio/rest.py", line 166, in request
  File "/config/custom_components/luxor/light.py", line 135, in async_turn_off
  File "/config/deps/lib/python3.11/site-packages/luxor_openapi_asyncio/api_client.py", line 185, in __call_api
  File "/config/deps/lib/python3.11/site-packages/luxor_openapi_asyncio/rest.py", line 219, in POST
  File "/config/deps/lib/python3.11/site-packages/luxor_openapi_asyncio/rest.py", line 166, in request
2023-08-22 22:25:46.420 DEBUG (MainThread) [custom_components.luxor.light] Finished fetching luxor_light data in 0.034 seconds (success: True)
2023-08-22 22:26:46.132 DEBUG (MainThread) [custom_components.luxor.light] Finished fetching luxor_light data in 0.038 seconds (success: True)
2023-08-22 22:27:46.136 DEBUG (MainThread) [custom_components.luxor.light] Finished fetching luxor_light data in 0.042 seconds (success: True)
2023-08-22 22:28:46.144 DEBUG (MainThread) [custom_components.luxor.light] Finished fetching luxor_light data in 0.049 seconds (success: True)

Update: clarification/spelling

Add Option to Disable Scenes

Some people may not want to load up their hass install with the scenes. Add a simple toggle to completely disable syncing them.

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.