nonnac/Hass-Savant

LightStatusMessage parsing bugs

rohrsh opened this issue · 1 comments

I found this tool today and I'm super excited about it.

I have Savant controlling Home Assistant well. And Savant is receiving on/off states from Home Assistant. The only aspect I can't get working is dimmer values from Home Assistant updating to Savant.

Some observations:

If your light is a Home Assistant light group, this will pick up all of the entity_id's within the JSON. This results in numerous state variables appearing in Savant, and I'm not confident they are mapping the right values.

e.g.
image

I also think a field for "brightness" may be necessary.

Sample terminal output

Note:

  • multiple entity_id's with one light (group) ... these children end up being stored in Savant states
  • brightness field
20:34:53.367 SAVANT Output Message: HTTP Request (URL: http://x.x.x.x:8123/api/states/light.group_study_lights, Type: GET, Header Fields: {Authorization = "Bearer XXXXXX"; "Content-Type" = "application/json"; Host = "x.x.x.x:8123"; }, Body: )

20:34:53.448 SAVANT Output Message: api/states/light.group_study_lights

20:34:53.448 Component Output Message: HTTP Response (Status Code: 200, Status String: 200, Header Fields: {"Content-Length" = 916; "Content-Type" = "application/json"; Date = "Wed, 01 Jun 2022 11:04:53 GMT"; Server = "Python/3.9 aiohttp/3.8.1"; }), HTTP Response: {"entity_id": "light.group_study_lights", "state": "on", "attributes": {"min_mireds": 111, "max_mireds": 666, "effect_list": ["effect_colorloop", "effect_pulse", "effect_stop"], "supported_color_modes": ["brightness", "color_temp", "hs", "onoff", "xy"], "color_mode": "color_temp", "brightness": 255, "color_temp": 505, "hs_color": [30.693, 95.645], "rgb_color": [255, 135, 11], "xy_color": [0.601, 0.381], "entity_id": ["light.study_wall_east", "light.study_wall_west", "light.unknown_study_cupboard_lts_279", "light.unknown_study_downlights_277", "light.ir", "light.computer_screen_light_3"], "icon": "mdi:lightbulb-group", "friendly_name": "GROUP Study Lights", "supported_features": 44}, "last_changed": "2022-06-01T10:27:07.979070+00:00", "last_updated": "2022-06-01T11:04:14.894517+00:00", "context": {"id": "01811eefff186f92c42a7941df8cd8db", "parent_id": null, "user_id": "b84567bba631420285af85af376273d9"}}