Git Product home page Git Product logo

homeassistant-pixelblaze's People

Contributors

estiens avatar vutang50 avatar

Stargazers

 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

homeassistant-pixelblaze's Issues

Attribute "Effect" not set ... actually it is empty most of the time.

Version of the custom_component

"websocket-client>=1.0.0",
"pixelblaze-client==0.9.4"

Configuration

Via UI

Describe the bug

The attribute "effect" is not holding always the current effect. Most of the time, this attribute is empty.

Debug log

  {{ states.light.weihnachtsbaum }}

results in

<template TemplateState(<state light.weihnachtsbaum=on; 
effect_list=['SEQUENCER', '1D Aurora Borealis', 'blink fade', 'color twinkles', 
  'Sparkling Tree', 'static random colors', 'Twinkly Stars'], 
  supported_color_modes=[<ColorMode.HS: 'hs'>], 
  color_mode=unknown, 
  brightness=128.000055, 
  effect=, 
  assumed_state=True, 
  icon=mdi:pine-tree, 
  friendly_name=Weihnachtsbaum, 
  supported_features=21 @ 2022-12-08T06:30:02.396731+01:00>)>

Pixelblaze integration using deprecated features

The Pixelblaze integration is using a deprecated feature that will apparently stop working in late 2024.

Configuration

I'm using the integration, not the yaml.

Describe the bug

Logs show that the integration is using a deprecated feature.

Debug log


Logger: homeassistant.components.light
Source: components/light/__init__.py:1194
Integration: Light (documentation, issues)
First occurred: 3:38:06 PM (2 occurrences)
Last logged: 3:38:06 PM

Entity None (<class 'custom_components.pixelblaze.light.PixelblazeEntity'>) is using deprecated supported features values which will be removed in HA Core 2025.1. Instead it should use <LightEntityFeature.EFFECT|1: 5> and color modes, please create a bug report at https://github.com/vutang50/homeassistant-pixelblaze/issues and reference https://developers.home-assistant.io/blog/2023/12/28/support-feature-magic-numbers-deprecation

Pixelblaze integration takes down Home Assistant when Pixelblaze is unresponsive

I apologize up front for this not being a great bug report. If it's not immediately helpful, I can spend some time trying to reproduce it when I have a little more time free. Right now I would have to take down my HA installation and it runs the whole house.

What I know: earlier today I discovered my Home Assistant installation was not working. Specifically, connections to the web server would just hang, automations and scenes weren't responding, etc. The machine was still up, Supervisor was running, I could ssh to it and look at logs, etc. On a reboot, it would come back up briefly and then hang again within a minute or two. The log file had messages about various entity updates taking over 10 seconds, connections timing out, etc., so it wasn't obvious where the problem was. By process of elimination, I removed custom_components until I identified pixelblaze as the one which triggers the problem.

During the incident, the only log entries related to this integration I could find look like:

2023-01-11 11:08:32.051 ERROR (MainThread) [custom_components.pixelblaze.light] Failed to update pixelblaze device Basement Counter [email protected]: Exception: [Errno 110] Operation timed out

It is probably extremely relevant that right now, that PixelBlaze device is in a strange state: it reports itself as alive to discovery, and it serves up its web page, but connections to port 81 for the websocket are immediately reset. This breaks the Pixelblaze client library:

>>> from pixelblaze import *
>>> pb = Pixelblaze("10.1.1.76")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/chris/src/pixelblaze-client/.venv/lib/python3.10/site-packages/pixelblaze/pixelblaze.py", line 243, in __init__
    self._open()
  File "/Users/chris/src/pixelblaze-client/.venv/lib/python3.10/site-packages/pixelblaze/pixelblaze.py", line 398, in _open
    self.ws = websocket.create_connection(uri, sockopt=((socket.SOL_SOCKET, socket.SO_REUSEADDR, 1), (socket.IPPROTO_TCP, socket.TCP_NODELAY, 1),))
  File "/Users/chris/src/pixelblaze-client/.venv/lib/python3.10/site-packages/websocket/_core.py", line 608, in create_connection
    websock.connect(url, **options)
  File "/Users/chris/src/pixelblaze-client/.venv/lib/python3.10/site-packages/websocket/_core.py", line 253, in connect
    self.handshake_response = handshake(self.sock, url, *addrs, **options)
  File "/Users/chris/src/pixelblaze-client/.venv/lib/python3.10/site-packages/websocket/_handshake.py", line 57, in handshake
    status, resp = _get_resp_headers(sock)
  File "/Users/chris/src/pixelblaze-client/.venv/lib/python3.10/site-packages/websocket/_handshake.py", line 145, in _get_resp_headers
    status, resp_headers, status_message = read_headers(sock)
  File "/Users/chris/src/pixelblaze-client/.venv/lib/python3.10/site-packages/websocket/_http.py", line 312, in read_headers
    line = recv_line(sock)
  File "/Users/chris/src/pixelblaze-client/.venv/lib/python3.10/site-packages/websocket/_socket.py", line 131, in recv_line
    c = recv(sock, 1)
  File "/Users/chris/src/pixelblaze-client/.venv/lib/python3.10/site-packages/websocket/_socket.py", line 108, in recv
    bytes_ = _recv()
  File "/Users/chris/src/pixelblaze-client/.venv/lib/python3.10/site-packages/websocket/_socket.py", line 87, in _recv
    return sock.recv(bufsize)
ConnectionResetError: [Errno 54] Connection reset by peer

What I don't understand is how this then results in this integration killing Home Assistant. But it does. Or at least, it did on my machine, today.

I have avoided power cycling my Pixelblaze for the moment, in case I need it to reproduce this. But I assume it should be possible to trigger the same condition by having anything answer on port 81 and then drop the connection. This is what I can try as a followup when I have time to do more.

Turning a pixelblaze back on does not work

Version of the custom_component

797d6d0

Describe the bug

Turning off a pixelblaze with this integration does work but turning it back on does not work as expected. The hass internal state changes to on but the pixelblaze does not turn on.

Debug log


ome-assistant   | 2021-04-19 16:34:17 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [140437571143568] Received {'type': 'call_service', 'domain': 'light', 'service': 'turn_on', 'service_data': {'entity_id': 'light.pixelblaze_terasse'}, 'id': 122}
home-assistant   | 2021-04-19 16:34:17 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=light, service=turn_on, service_data=entity_id=light.pixelblaze_terasse>
home-assistant   | 2021-04-19 16:34:17 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [140437571143568] Received {'type': 'call_service', 'domain': 'light', 'service': 'turn_on', 'service_data': {'entity_id': 'light.pixelblaze_terasse'}, 'id': 123}
home-assistant   | 2021-04-19 16:34:17 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=light, service=turn_on, service_data=entity_id=light.pixelblaze_terasse>
home-assistant   | 2021-04-19 16:34:18 DEBUG (MainThread) [homeassistant.components.light] light.pixelblaze_terasse: set to unsupported color_mode: unknown, supported_color_modes: {'hs'}
home-assistant   | 2021-04-19 16:34:18 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=light.pixelblaze_terasse, old_state=<state light.pixelblaze_terasse=off; effect_list=['SEQUENCER', '2D Wandering Fireball', '3D Rotation / Spotlights', 'blink fade', 'block reflections', 'Bouncer3D', 'color bands', 'color fade pulse', 'color twinkle bounce', 'color twinkles', 'cube fire 3D', 'Example: color hues', 'Example: modes and waveforms', 'Example: time and animation', 'Fancy Scolling Text 2D', 'fast pulse', 'fast pulse 3d', 'firework dust', 'firework rocket sparks', 'Fixed Color', 'Fixed Color HSV', 'glitch bands', 'green ripple reflections', 'honeycomb 3D', 'KITT', 'marching rainbow', 'matrix 2D honeycomb', 'matrix 2D pulse', 'millipede', 'opposites', 'Perlin/Simplex Noise 2D', 'plasma 3D', 'plasma 3D', 'Polar mapping helper 2D / 3D', 'rainbow fonts', 'rainbow fonts 2', 'rainbow melt', 'Red-Green XY 2D Sweep', 'RGBclock 2D', 'scrolling text marquee 2D', 'Shimmer Crossfade 2D', 'slow color shift', 'sound - blinkfade', 'sound - rays', 'sound - spectro kalidastrip', 'sound - spectromatrix optim', 'sparks', 'sparks center', 'spin cycle', 'tixy 2D', 'Wave 2D', 'xorcery 2D/3D'], supported_color_modes=['hs'], assumed_state=True, supported_features=21 @ 2021-04-19T22:34:17.492859+02:00>, new_state=<state light.pixelblaze_terasse=on; effect_list=['SEQUENCER', '2D Wandering Fireball', '3D Rotation / Spotlights', 'blink fade', 'block reflections', 'Bouncer3D', 'color bands', 'color fade pulse', 'color twinkle bounce', 'color twinkles', 'cube fire 3D', 'Example: color hues', 'Example: modes and waveforms', 'Example: time and animation', 'Fancy Scolling Text 2D', 'fast pulse', 'fast pulse 3d', 'firework dust', 'firework rocket sparks', 'Fixed Color', 'Fixed Color HSV', 'glitch bands', 'green ripple reflections', 'honeycomb 3D', 'KITT', 'marching rainbow', 'matrix 2D honeycomb', 'matrix 2D pulse', 'millipede', 'opposites', 'Perlin/Simplex Noise 2D', 'plasma 3D', 'plasma 3D', 'Polar mapping helper 2D / 3D', 'rainbow fonts', 'rainbow fonts 2', 'rainbow melt', 'Red-Green XY 2D Sweep', 'RGBclock 2D', 'scrolling text marquee 2D', 'Shimmer Crossfade 2D', 'slow color shift', 'sound - blinkfade', 'sound - rays', 'sound - spectro kalidastrip', 'sound - spectromatrix optim', 'sparks', 'sparks center', 'spin cycle', 'tixy 2D', 'Wave 2D', 'xorcery 2D/3D'], supported_color_modes=['hs'], color_mode=unknown, assumed_state=True, supported_features=21 @ 2021-04-19T22:34:18.085200+02:00>>
home-assistant   | 2021-04-19 16:34:18 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [140437571143568] Sending {"id": 2, "type": "event", "event": {"event_type": "state_changed", "data": {"entity_id": "light.pixelblaze_terasse", "old_state": {"entity_id": "light.pixelblaze_terasse", "state": "off", "attributes": {"effect_list": ["SEQUENCER", "2D Wandering Fireball", "3D Rotation / Spotlights", "blink fade", "block reflections", "Bouncer3D", "color bands", "color fade pulse", "color twinkle bounce", "color twinkles", "cube fire 3D", "Example: color hues", "Example: modes and waveforms", "Example: time and animation", "Fancy Scolling Text 2D", "fast pulse", "fast pulse 3d", "firework dust", "firework rocket sparks", "Fixed Color", "Fixed Color HSV", "glitch bands", "green ripple reflections", "honeycomb 3D", "KITT", "marching rainbow", "matrix 2D honeycomb", "matrix 2D pulse", "millipede", "opposites", "Perlin/Simplex Noise 2D", "plasma 3D", "plasma 3D", "Polar mapping helper 2D / 3D", "rainbow fonts", "rainbow fonts 2", "rainbow melt", "Red-Green XY 2D Sweep", "RGBclock 2D", "scrolling text marquee 2D", "Shimmer Crossfade 2D", "slow color shift", "sound - blinkfade", "sound - rays", "sound - spectro kalidastrip", "sound - spectromatrix optim", "sparks", "sparks center", "spin cycle", "tixy 2D", "Wave 2D", "xorcery 2D/3D"], "supported_color_modes": ["hs"], "assumed_state": true, "supported_features": 21}, "last_changed": "2021-04-19T20:34:17.492859+00:00", "last_updated": "2021-04-19T20:34:17.492859+00:00", "context": {"id": "dac2336d96efe0c9bdf8e4b4debb5e7c", "parent_id": null, "user_id": "b6e0a5a4cfa2456686391932605d0b97"}}, "new_state": {"entity_id": "light.pixelblaze_terasse", "state": "on", "attributes": {"effect_list": ["SEQUENCER", "2D Wandering Fireball", "3D Rotation / Spotlights", "blink fade", "block reflections", "Bouncer3D", "color bands", "color fade pulse", "color twinkle bounce", "color twinkles", "cube fire 3D", "Example: color hues", "Example: modes and waveforms", "Example: time and animation", "Fancy Scolling Text 2D", "fast pulse", "fast pulse 3d", "firework dust", "firework rocket sparks", "Fixed Color", "Fixed Color HSV", "glitch bands", "green ripple reflections", "honeycomb 3D", "KITT", "marching rainbow", "matrix 2D honeycomb", "matrix 2D pulse", "millipede", "opposites", "Perlin/Simplex Noise 2D", "plasma 3D", "plasma 3D", "Polar mapping helper 2D / 3D", "rainbow fonts", "rainbow fonts 2", "rainbow melt", "Red-Green XY 2D Sweep", "RGBclock 2D", "scrolling text marquee 2D", "Shimmer Crossfade 2D", "slow color shift", "sound - blinkfade", "sound - rays", "sound - spectro kalidastrip", "sound - spectromatrix optim", "sparks", "sparks center", "spin cycle", "tixy 2D", "Wave 2D", "xorcery 2D/3D"], "supported_color_modes": ["hs"], "color_mode": "unknown", "assumed_state": true, "supported_features": 21}, "last_changed": "2021-04-19T20:34:18.085200+00:00", "last_updated": "2021-04-19T20:34:18.085200+00:00", "context": {"id": "d7f5921444b97574e68b3369a898feb7", "parent_id": null, "user_id": "b6e0a5a4cfa2456686391932605d0b97"}}}, "origin": "LOCAL", "time_fired": "2021-04-19T20:34:18.085200+00:00", "context": {"id": "d7f5921444b97574e68b3369a898feb7", "parent_id": null, "user_id": "b6e0a5a4cfa2456686391932605d0b97"}}}
home-assistant   | 2021-04-19 16:34:18 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [140437571143568] Received {'type': 'call_service', 'domain': 'light', 'service': 'turn_off', 'service_data': {'entity_id': 'light.pixelblaze_terasse'}, 'id': 124}
home-assistant   | 2021-04-19 16:34:18 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=light, service=turn_off, service_data=entity_id=light.pixelblaze_terasse>
home-assistant   | 2021-04-19 16:34:18 DEBUG (MainThread) [homeassistant.components.light] light.pixelblaze_terasse: set to unsupported color_mode: unknown, supported_color_modes: {'hs'}
home-assistant   | 2021-04-19 16:34:18 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=light.pixelblaze_terasse, old_state=<state light.pixelblaze_terasse=on; effect_list=['SEQUENCER', '2D Wandering Fireball', '3D Rotation / Spotlights', 'blink fade', 'block reflections', 'Bouncer3D', 'color bands', 'color fade pulse', 'color twinkle bounce', 'color twinkles', 'cube fire 3D', 'Example: color hues', 'Example: modes and waveforms', 'Example: time and animation', 'Fancy Scolling Text 2D', 'fast pulse', 'fast pulse 3d', 'firework dust', 'firework rocket sparks', 'Fixed Color', 'Fixed Color HSV', 'glitch bands', 'green ripple reflections', 'honeycomb 3D', 'KITT', 'marching rainbow', 'matrix 2D honeycomb', 'matrix 2D pulse', 'millipede', 'opposites', 'Perlin/Simplex Noise 2D', 'plasma 3D', 'plasma 3D', 'Polar mapping helper 2D / 3D', 'rainbow fonts', 'rainbow fonts 2', 'rainbow melt', 'Red-Green XY 2D Sweep', 'RGBclock 2D', 'scrolling text marquee 2D', 'Shimmer Crossfade 2D', 'slow color shift', 'sound - blinkfade', 'sound - rays', 'sound - spectro kalidastrip', 'sound - spectromatrix optim', 'sparks', 'sparks center', 'spin cycle', 'tixy 2D', 'Wave 2D', 'xorcery 2D/3D'], supported_color_modes=['hs'], color_mode=unknown, assumed_state=True, supported_features=21 @ 2021-04-19T22:34:18.085200+02:00>, new_state=<state light.pixelblaze_terasse=off; effect_list=['SEQUENCER', '2D Wandering Fireball', '3D Rotation / Spotlights', 'blink fade', 'block reflections', 'Bouncer3D', 'color bands', 'color fade pulse', 'color twinkle bounce', 'color twinkles', 'cube fire 3D', 'Example: color hues', 'Example: modes and waveforms', 'Example: time and animation', 'Fancy Scolling Text 2D', 'fast pulse', 'fast pulse 3d', 'firework dust', 'firework rocket sparks', 'Fixed Color', 'Fixed Color HSV', 'glitch bands', 'green ripple reflections', 'honeycomb 3D', 'KITT', 'marching rainbow', 'matrix 2D honeycomb', 'matrix 2D pulse', 'millipede', 'opposites', 'Perlin/Simplex Noise 2D', 'plasma 3D', 'plasma 3D', 'Polar mapping helper 2D / 3D', 'rainbow fonts', 'rainbow fonts 2', 'rainbow melt', 'Red-Green XY 2D Sweep', 'RGBclock 2D', 'scrolling text marquee 2D', 'Shimmer Crossfade 2D', 'slow color shift', 'sound - blinkfade', 'sound - rays', 'sound - spectro kalidastrip', 'sound - spectromatrix optim', 'sparks', 'sparks center', 'spin cycle', 'tixy 2D', 'Wave 2D', 'xorcery 2D/3D'], supported_color_modes=['hs'], assumed_state=True, supported_features=21 @ 2021-04-19T22:34:18.569541+02:00>>
home-assistant   | 2021-04-19 16:34:18 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [140437571143568] Sending {"id": 2, "type": "event", "event": {"event_type": "state_changed", "data": {"entity_id": "light.pixelblaze_terasse", "old_state": {"entity_id": "light.pixelblaze_terasse", "state": "on", "attributes": {"effect_list": ["SEQUENCER", "2D Wandering Fireball", "3D Rotation / Spotlights", "blink fade", "block reflections", "Bouncer3D", "color bands", "color fade pulse", "color twinkle bounce", "color twinkles", "cube fire 3D", "Example: color hues", "Example: modes and waveforms", "Example: time and animation", "Fancy Scolling Text 2D", "fast pulse", "fast pulse 3d", "firework dust", "firework rocket sparks", "Fixed Color", "Fixed Color HSV", "glitch bands", "green ripple reflections", "honeycomb 3D", "KITT", "marching rainbow", "matrix 2D honeycomb", "matrix 2D pulse", "millipede", "opposites", "Perlin/Simplex Noise 2D", "plasma 3D", "plasma 3D", "Polar mapping helper 2D / 3D", "rainbow fonts", "rainbow fonts 2", "rainbow melt", "Red-Green XY 2D Sweep", "RGBclock 2D", "scrolling text marquee 2D", "Shimmer Crossfade 2D", "slow color shift", "sound - blinkfade", "sound - rays", "sound - spectro kalidastrip", "sound - spectromatrix optim", "sparks", "sparks center", "spin cycle", "tixy 2D", "Wave 2D", "xorcery 2D/3D"], "supported_color_modes": ["hs"], "color_mode": "unknown", "assumed_state": true, "supported_features": 21}, "last_changed": "2021-04-19T20:34:18.085200+00:00", "last_updated": "2021-04-19T20:34:18.085200+00:00", "context": {"id": "d7f5921444b97574e68b3369a898feb7", "parent_id": null, "user_id": "b6e0a5a4cfa2456686391932605d0b97"}}, "new_state": {"entity_id": "light.pixelblaze_terasse", "state": "off", "attributes": {"effect_list": ["SEQUENCER", "2D Wandering Fireball", "3D Rotation / Spotlights", "blink fade", "block reflections", "Bouncer3D", "color bands", "color fade pulse", "color twinkle bounce", "color twinkles", "cube fire 3D", "Example: color hues", "Example: modes and waveforms", "Example: time and animation", "Fancy Scolling Text 2D", "fast pulse", "fast pulse 3d", "firework dust", "firework rocket sparks", "Fixed Color", "Fixed Color HSV", "glitch bands", "green ripple reflections", "honeycomb 3D", "KITT", "marching rainbow", "matrix 2D honeycomb", "matrix 2D pulse", "millipede", "opposites", "Perlin/Simplex Noise 2D", "plasma 3D", "plasma 3D", "Polar mapping helper 2D / 3D", "rainbow fonts", "rainbow fonts 2", "rainbow melt", "Red-Green XY 2D Sweep", "RGBclock 2D", "scrolling text marquee 2D", "Shimmer Crossfade 2D", "slow color shift", "sound - blinkfade", "sound - rays", "sound - spectro kalidastrip", "sound - spectromatrix optim", "sparks", "sparks center", "spin cycle", "tixy 2D", "Wave 2D", "xorcery 2D/3D"], "supported_color_modes": ["hs"], "assumed_state": true, "supported_features": 21}, "last_changed": "2021-04-19T20:34:18.569541+00:00", "last_updated": "2021-04-19T20:34:18.569541+00:00", "context": {"id": "3c8098ef5a01b11b696d98b2ffc7e054", "parent_id": null, "user_id": "b6e0a5a4cfa2456686391932605d0b97"}}}, "origin": "LOCAL", "time_fired": "2021-04-19T20:34:18.569541+00:00", "context": {"id": "3c8098ef5a01b11b696d98b2ffc7e054", "parent_id": null, "user_id": "b6e0a5a4cfa2456686391932605d0b97"}}}

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.