Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No dimmable lights #86

Closed
mario-rossi78 opened this issue Jul 3, 2024 · 9 comments
Closed

No dimmable lights #86

mario-rossi78 opened this issue Jul 3, 2024 · 9 comments
Labels
bug Something isn't working

Comments

@mario-rossi78
Copy link

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

Tnx

@mario-rossi78 mario-rossi78 changed the title No dimmerable lights No dimmable lights Jul 3, 2024
@gicamm
Copy link
Owner

gicamm commented Jul 6, 2024

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

@mario-rossi78
Copy link
Author

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
Copy link
Owner

gicamm commented Jul 29, 2024

@Just-inc-ace
Copy link
Contributor

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
Copy link
Owner

gicamm commented Aug 6, 2024

@optiluca can you look at this?

Are you having problems with dimmable lights?

@optiluca
Copy link
Contributor

optiluca commented Aug 9, 2024

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
Copy link
Contributor

Just-inc-ace commented Aug 10, 2024

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:

  • b
  • e
  • g
  • h
  • i
  • "n"
  • r
  • s
  • s
  • t
    color_mode: brightness
    icon: mdi:light-recessed
    friendly_name: Bij keuken
    supported_features: 0`

where it should be
`supported_color_modes:

  • brightness
    color_mode: brightness
    icon: mdi:light-recessed
    friendly_name: Bij keuken
    supported_features: 0`

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

  • onoff
    color_mode: null
    icon: mdi:light-flood-down
    friendly_name: Voordeur
    supported_features: 0
    `

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
Copy link
Contributor

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
Copy link
Author

Tnx to everybody.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants