gicamm / homeassistant-comelit

With Comelit Hub/Vedo integration, you can connect your Home Assistant instance to Comelit Simple Home and Vedo systems.
Apache License 2.0
23 stars 7 forks source link

No dimmable lights #86

Closed mario-rossi78 closed 2 months ago

mario-rossi78 commented 4 months ago

I have two dimmable lights in my comelit system, but the integration sees It like normal light. Can I modify the entity manually?

Tnx

gicamm commented 4 months ago

Hi, dimmable lights are supported by default without any change. However, I cannot rule out that something is bad.

mario-rossi78 commented 3 months ago

Is there a guide to learning how to collect and read the messages from the system? I want to help with the integration, but I don't know where to start.

gicamm commented 3 months ago

You can look at this https://github.com/gicamm/homeassistant-comelit/blob/master/debug/mqtt.md

Just-inc-ace commented 3 months ago

I have the same issue.

When I installed the integration all was working fine at first, now all of the dimmer entities changed into switched light entities, so not dimmable anymore. Switching on and off works fine though. { "req_type":0, "req_sub_type":-1, "obj_id":"DOM#LT#6.1", "out_data": [{ "id":"DOM#LT#6.1", "type":3, "sub_type":4, "sched_status":"0", "status":"1", "powerst":"1", "value":"221", "bright":"221", "presenza_on":"0", "presente":"0", "auto_man_pid_dimmer":"0" }] }

So type is 3 and sub_type is 4 in MQTT. As far as I understood this is sufficient to be detected as dimmer.

Any ideas what to try or where to look?

gicamm commented 3 months ago

@optiluca can you look at this?

Are you having problems with dimmable lights?

optiluca commented 2 months ago

Hi, I'm running the latest code from my fork and am not having any issue with dimmable lights. They continue to be seen as dimmable, and continue do dim correctly.

I have however noticed some kind of stability issue, where occasionally I have to restart HA else HA does not correctly seem to update the state of the various Comelit devices (lights, switches, covers, temperature, humidity etc...). Unfortunately I'm not home at the moment, and won't be for at least another month, so I can't really do any in-depth analysis right now. If it remains unsolved, I'll try to have a double check when I get home!

Just-inc-ace commented 2 months ago

Hi, Thanks for your reply. I found this in my on my system. When I go and check the status of a light via 'Developer Tools' > Status I get following attributes when the light is a dimmer `supported_color_modes:

where it should be `supported_color_modes:

If I check the status of an ON/OFF light I get this values which are correct: `supported_color_modes:

When I go and check the core.entity_registry I see the same {"aliases":[],"area_id":"woonkamer","categories":{},"capabilities":{"supported_color_modes":["b","e","g","h","i","n","r","s","s","t"]},"config_entry_id":null,"created_at":"1970-01-01T00:00:00+00:00","device_class":null,"device_id":null,"disabled_by":null,"entity_category":null,"entity_id":"light.comelit_bij_keuken","hidden_by":null,"icon":"mdi:light-recessed","id":"06f800ee2fc130f9558ba336d1850d2a","has_entity_name":false,"labels":[],"modified_at":"1970-01-01T00:00:00+00:00","name":"Bij keuken","options":{"conversation":{"should_expose":true}},"original_device_class":null,"original_icon":null,"original_name":"comelit_bij-keuken","platform":"comelit","supported_features":0,"translation_key":null,"unique_id":"comelit_DOM#LT#7.2","previous_unique_id":null,"unit_of_measurement":null},

If I change it it gets changed back by the component.

Just-inc-ace commented 2 months ago

I think I solved it: The variable is to give the supported_color_modes is given as a value and not as a set. this causes it to be converted to a set, explaining the behaviour I explained before.

To correct it, on line 33-35 I changed : @property def supported_color_modes(self): return ColorMode.BRIGHTNESS if self._brightness else {ColorMode.ONOFF}

into

@property def supported_color_modes(self): return {ColorMode.BRIGHTNESS} if self._brightness else {ColorMode.ONOFF}

and now all works!

I think for the same reason the lines 37-39 should be changed into @property def color_mode(self): return {ColorMode.BRIGHTNESS} if self._brightness else {ColorMode.ONOFF}

If someone can confirm that this is correct, we can make a pull request.

mario-rossi78 commented 2 months ago

Tnx to everybody.

optiluca commented 1 month ago

FYI, the fix introduced a regression which I resolve here https://github.com/gicamm/homeassistant-comelit/pull/96