ljmerza / light-entity-card

Control any light or switch entity
MIT License
237 stars 40 forks source link

Light Entity Card doesn't show features #63

Closed fenderle closed 3 years ago

fenderle commented 3 years ago

For some integrations (in this example Shelly) the card doesn't show the features of the device, like eg. the brightness slider. I realized the Shelly integration doesn't set the supported_features attribute correctly (its always 0) and I raised an issue there.

However the dev over at Homeassistant states that supported_features is being deprecated (see here)

Currently I can only turn the lights on and off, but not dim them, etc. Would it be possible to add a flag which just shows all features which are enabled for the entity in the card?

pmfernandes commented 3 years ago

I'm also having the same problem with Tasmota flashed RGBW led strip.

fenderle commented 3 years ago

Same happens with the Elgato Key Light integration

fenderle commented 3 years ago

Yes, that makes the slider show up but it disappears again as soon as you change the state. On 8. Jun 2021, 06:01 +0200, LegionX-Code @.***>, wrote:

Hello, @fenderle, @pmfernandes You said you cannot see the feature sliders? for brightness/W ect? Just check something for me here:

• > head into HA "lovelace", • > then select "developer tools" • > then select "states tab" • > then find the entity your looking (what ever its ID or friendly name) • > then click on it, scroll back up to top of tab, you should see "State attributes (YAML, optional)" • > Look for "supported_features" & check it is set to: 145 • > Can you see slider now? it may provide more info than you need right now, but lets start here first.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

LegionX-Code commented 3 years ago

@fenderle @pmfernandes I'll assume you have the card configured correctly for this device as you said it was previously working, Edit UI, Edit Card, selected the features you require.

So were on the same page, The user input sends Command but light updates the State - not user updates state.

Is your light (entity) reporting it current "state" to HA?
Reporting separately "(ON/OFF)", "brightness", "hs", color mode, in the correct format?

If not, consider this:

(a) If your device is not reporting it's current "state" back to HA, the card will close as it thinks the entity (light) is MIA.

  1. HA sends "command" to light.
  2. Light receives .cmd, then turns on
  3. Light reports back to HA its current "state".
  4. HA Entity (light) says, ok I've received an "state" update
  5. I'll update the card to "ON". or If a valid brightness was received it would update the slider.

Even thou you turned it on, it still requires confirmation. If it was updated from another source it would update the "state" and adjust the slider or color wheel to suit.

So if the card is not holding open after you send (1).cmd, then see if you can see how the device is reporting it current state (3) back to HA.

The card is closing as it doesn't know the "state" of the light, after sending the .cmd, so it assumes it is MIA or Disconnected (closing the card out of sight until it receives a current state back from the light).

As soon as the light reports to HA it's "State" 1.ON/OFF, 2.Brightness, 3 hs, 4.RGBW ect, the card will open all the other features you mentioned.

or

(b) Have you tried ticking "Persist Features" on the card, this forces the card to stay open even if no current "state" is returned from the light.

If this option gets you out of trouble there is a sync issue.. if you update the light from another device it will not update it current "state" to HA - so the light might be off, but the card says it on.

fenderle commented 3 years ago

The lights work perfectly well with the standard HomeAssistant light card. According to an issue I opened over at the HomeAssistant Github they move away from the supported_features attribute with more and more integrations ditching support for it. So please move Light Entity Card towards color modes.

https://developers.home-assistant.io/docs/core/entity/light/#support-feature lists almost all of them as deprecated (which also means they are not guaranteed to be supported)

https://developers.home-assistant.io/docs/core/entity/light/#color-modes is the new way to go I guess

enuzzo commented 3 years ago

Same issue here. HA: core-2021.7.3 Card Version: 4.4.0 Lights: WLED + Hyperion Project - For both, the color wheel has disappeared.

ellipsiss commented 3 years ago

Same again here HA: core-2021.7.3 Card Version: 4.4.0 Lights: Athom Tasmota bulbs running 9.5.0 with Tasmota integration working / installed.

ljmerza commented 3 years ago

try v4.2.3

Bieniu82 commented 3 years ago

try v4.2.3

color wheel still missing with cd1c6db

ljmerza commented 3 years ago

try v4.2.3

color wheel still missing with cd1c6db

Paste all your entity values and config

Bieniu82 commented 3 years ago

Paste all your entity values and config

core-2021.7.3 lights: WLED Card Version: 4.4.0 / master (cd1c6db)

lovelace config:

cards:
  - type: vertical-stack
    cards:
      - entity: light.wled
        type: 'custom:light-entity-card'  
        color_picker: true
        persist_features: true
        effects_list: true
      - entities:
        - input_number.ledspeed
        - input_number.ledintensity
        type: entities    
ljmerza commented 3 years ago

And your entity attributes?

Bieniu82 commented 3 years ago

effect_list:

fribse commented 3 years ago

I don't see the colorwheel either for my WLED instances at the moment :-(

ljmerza commented 3 years ago

supported_features: 36

according to this, your entity does not support the color wheel. Color wheel is 16 so 36 & 16 = 0. I would ask on the HA forums about this if you think it's incorrect.

I don't see the colorwheel either for my WLED instances at the moment :-(

I understand your frustration, but this is not the place to complain - take that to the HA forums, this is GitHub. Add your config and entity values to be constructive in finding this issue out. If not, I'll lock this issue. Same for all these comments essentially saying "same here" or opening duplicate issues.

Bieniu82 commented 3 years ago

according to this, your entity does not support the color wheel. Color wheel is 16 so 36 & 16 = 0. I would ask on the HA forums about this if you think it's incorrect

will raise it there; for now decided to change ha back to core-21.6.6, as other stuff e.g. sms integration seems to be broken tin the newest one; with ha core-21.6.6 the color wheel is back (with both 4.4.0 as well as newest master cd1c6db)

Lennart99 commented 3 years ago

Brightness slider is not being shown for lights that are off even though Persist Features is turned on, Brightness slider is shown when light is turned on.

I am using Home Assistant version 2021.7.4, HACS version 1.13.2 and version 4.4.0 of this card.

image

ljmerza commented 3 years ago

paste your entity attributes

Lennart99 commented 3 years ago
max_mireds: 650
supported_color_modes:
  - color_temp
is_deconz_group: false
friendly_name: Lamp TV
supported_features: 40
ljmerza commented 3 years ago

latest is v4.4.2

Lennart99 commented 3 years ago

I can't find that version on HACS, unfortunately I also tried to install master, but that does not seem to work either

Lennart99 commented 3 years ago

Fixed for me with 4.4.4 Thank you

fenderle commented 3 years ago

Works for me with 4.4.4. Thank you for your work. Closing this issue.