Skip to content
This repository has been archived by the owner on Nov 4, 2023. It is now read-only.

No +/- in TYPES.LIGHT #743

Closed
Quarco opened this issue Jul 28, 2021 · 9 comments · Fixed by #746
Closed

No +/- in TYPES.LIGHT #743

Quarco opened this issue Jul 28, 2021 · 9 comments · Fixed by #746

Comments

@Quarco
Copy link

Quarco commented Jul 28, 2021

I use last versions of TileBoard with Home Assitant and zWaveJS.
But I cannot control the light intensity because the + and - are not shown into the tile.

HUE lights (still) get these controls, but somehow I don't get it with my zwave devices.
Anyone else having this problem? Or is it a bug?

(Screenshot are both dimmers, Hal = Hue, Keuken = zwave)

image

@atleso
Copy link

atleso commented Jul 29, 2021

I'm missing the +/- for my knx lights as well. I have no other lights so nothing to compare with. Happened after upgrading HA.

@rchl
Copy link
Collaborator

rchl commented Jul 29, 2021

Can you open /developer-tools/state and screenshot the relevant entity (including the attributes)?

@Quarco
Copy link
Author

Quarco commented Jul 29, 2021

image
image

@rchl
Copy link
Collaborator

rchl commented Jul 29, 2021

And how does your tileboard entity configuration looks like for the tile that is missing the +/- buttons?

@Quarco
Copy link
Author

Quarco commented Jul 29, 2021

image

@atleso
Copy link

atleso commented Jul 29, 2021

HA state attributes:

min_mireds: 166
max_mireds: 370
supported_color_modes:
  - color_temp
color_mode: color_temp
brightness: 90
color_temp: 290
friendly_name: Bedroom 4 (Office) ceiling lights
supported_features: 0

Relevant tile config:

{
               title: 'Bedroom 4 (Office)',
               width: 1,
               height: 3,
               items: [
                  {
                     position: [0, 0],
                     width: 1,
                     type: TYPES.LIGHT,
                     title: 'Ceiling lights',
                     id: 'light.bedroom_4_office_ceiling_lights',
                     states: { off: 'Off',  on: 'NA' },
                     icons: {
                        on: "mdi-lightbulb-on",
                        off: "mdi-lightbulb",
                     },
                     state: function (item, entity) {
                        if (Math.round(entity.attributes.brightness / 2.55)) {
                           return Math.round(entity.attributes.brightness / 2.55) + " %"
                        } else {
                           return "Off"
                        }
                     },
                     sliders: [
                        {
                           title: 'Brightness',
                           field: 'brightness',
                           max: 255,
                           min: 0,
                           step: 5,
                           request: {
                              type: "call_service",
                              domain: "light",
                              service: "turn_on",
                              field: "brightness"
                           }
                        },
                        {
                           title: 'Color temp',
                           field: 'color_temp',
                           max: 370,
                           min: 166,
                           step: 5,
                           request: {
                              type: "call_service",
                              domain: "light",
                              service: "turn_on",
                              field: "color_temp"
                           },
                        }
                     ]
                  },
                  
               ]
            },

@rchl
Copy link
Collaborator

rchl commented Jul 29, 2021

Looks like we need to change how we check whether the light supports brightness changes since the SUPPORT_BRIGHTNESS flag was deprecated in favor of "color mode".

https://github.com/home-assistant/core/blob/1019ee22ff13e5f542e868179d791e6a0d87369a/homeassistant/components/light/__init__.py#L41-L64

@atleso in your case the light doesn't seem to advertise support for brightness change, only color temperature change. Even if it has the brightness attribute... Does it work in native HA UI to change the brightness?
EDIT: No, nevermind, the logic is a bit more complicated and assumes brightness control to be supported in most cases - https://github.com/home-assistant/core/blob/10bfc783651a49ffbe2e7ad8d3e5d5e3223b3180/homeassistant/components/light/__init__.py#L101-L105

@atleso
Copy link

atleso commented Jul 29, 2021

Yes, it works in the native UI, and it also works in Tileboard if I long-press the tile.

image

rchl added a commit that referenced this issue Aug 5, 2021
Take into account the new "supported_color_modes" attributes when
checking if light supports brightness adjustment.

Fixes #743
@Quarco
Copy link
Author

Quarco commented Aug 5, 2021

Great Thanks for looking into this / patch for upcoming release! 👍 @rchl

alphasixtyfive pushed a commit that referenced this issue Aug 6, 2021
…746)

Take into account the new "supported_color_modes" attributes when
checking if light supports brightness adjustment.

Fixes #743
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants