t0bst4r / matterbridge-home-assistant

Apache License 2.0
86 stars 11 forks source link

Bug: cannot handle null values #69

Closed Cheerpipe closed 3 months ago

Cheerpipe commented 3 months ago

image

My light attributes when off (light is off when matterbridge throw the eror):

min_color_temp_kelvin: 1700
max_color_temp_kelvin: 6535
min_mireds: 153
max_mireds: 588
effect_list:
  - Alarm
  - Candle Flicker
  - Christmas
  - Date Night
  - Disco
  - Facebook
  - Fast Random Loop
  - Happy Birthday
  - Home
  - LSD
  - Movie
  - Night Mode
  - Police
  - Police2
  - RGB
  - Random Loop
  - Romance
  - Slow Temp
  - Slowdown
  - Stop
  - Strobe color
  - Strobe epilepsy!
  - Sunrise
  - Sunset
  - Tea Time
  - Twitter
  - WhatsApp
supported_color_modes:
  - color_temp
  - hs
  - rgb
effect: null
color_mode: null
brightness: null
color_temp_kelvin: null
color_temp: null
hs_color: null
rgb_color: null
xy_color: null
entity_id:
  - light.dormitorio_pasillo
  - light.dormitorio_ventana
  - light.dormitorio_techo_a
  - light.dormitorio_techo_b
  - light.dormitorio_techo_c
icon: mdi:lightbulb-group
friendly_name: Control maestro luces ambiente
supported_features: 44

When on:

min_color_temp_kelvin: 1700
max_color_temp_kelvin: 6535
min_mireds: 153
max_mireds: 588
effect_list:
  - Alarm
  - Candle Flicker
  - Christmas
  - Date Night
  - Disco
  - Facebook
  - Fast Random Loop
  - Happy Birthday
  - Home
  - LSD
  - Movie
  - Night Mode
  - Police
  - Police2
  - RGB
  - Random Loop
  - Romance
  - Slow Temp
  - Slowdown
  - Stop
  - Strobe color
  - Strobe epilepsy!
  - Sunrise
  - Sunset
  - Tea Time
  - Twitter
  - WhatsApp
supported_color_modes:
  - color_temp
  - hs
  - rgb
effect: null
color_mode: color_temp
brightness: 110
color_temp_kelvin: 5434
color_temp: 184
hs_color:
  - 27.746
  - 13.648
rgb_color:
  - 255
  - 236
  - 220
xy_color:
  - 0.356
  - 0.344
entity_id:
  - light.dormitorio_pasillo
  - light.dormitorio_ventana
  - light.dormitorio_techo_a
  - light.dormitorio_techo_b
  - light.dormitorio_techo_c
icon: mdi:lightbulb-group
friendly_name: Control maestro luces ambiente
supported_features: 44
Cheerpipe commented 3 months ago

matterbridge-home-assistant start without errors and register the light but the exception is thrown as soon as the light goes off

image

It appears the addon can't handle null attributes like brightness when devices goes off.

t0bst4r commented 3 months ago

I have seen a similar behavior with the colors, but no of my lights populate a null brightness when turned off. For me the brightness stays at its level but the state changes to „off“. even in home assistant i can still see the brightness level after turning The light off.

But okay - another edge case to do 😁

tam481 commented 3 months ago

I'm seeing loads of entries in the materbridge logs as well while the lights are off.

16:54:00.008] [MatterbridgeDevice] FROM HA: light.masterbedroom_light changed brightness to null [16:54:03.532] [MatterbridgeDevice] FROM HA: light.50w_pir_cw_floodlight changed brightness to undefined [16:54:03.532] [MatterbridgeDevice] FROM HA: light.masterbedroom_light changed brightness to null [16:54:07.377] [MatterbridgeDevice] FROM HA: light.50w_pir_cw_floodlight changed brightness to undefined [16:54:07.377] [MatterbridgeDevice] FROM HA: light.masterbedroom_light changed brightness to null [16:54:20.790] [MatterbridgeDevice] FROM HA: light.50w_pir_cw_floodlight changed brightness to undefined [16:54:20.790] [MatterbridgeDevice] FROM HA: light.masterbedroom_light changed brightness to null [16:54:23.669] [MatterbridgeDevice] FROM HA: light.50w_pir_cw_floodlight changed brightness to undefined [16:54:23.669] [MatterbridgeDevice] FROM HA: light.50w_pir_cw_floodlight changed brightness to undefined [16:54:23.669] [MatterbridgeDevice] FROM HA: light.masterbedroom_light changed brightness to null [16:54:23.670] [MatterbridgeDevice] FROM HA: light.masterbedroom_light changed brightness to null

t0bst4r commented 3 months ago

Could you give it a try with version 0.5.2 ?

Cheerpipe commented 3 months ago

So far so good.

Tested with Yeelight Color2 bulbs and a WLED led stripe.

Thanks.