Lovelace Card - Light with Profiles

@asa79 thats correct and the reason is that its a core settings file just like configuration.yaml and lovelace.yaml. My card just uses this feature not inventing it.

I now see a lot of ppl dont know about this file (light_profiles.csv) soI will add a small description of its existence in the near future.

for more info on the file for now check out light component: https://www.home-assistant.io/components/light where its mentioned. (this is where I found out about it)

hope this is answer enough :slight_smile:

Where does the light_profiles.csv sit folder wise?

@asa79 inside your config folder, same place as your configuration.yaml and lovelace.yaml files.

(updated main post with this info as well)

Thanks Thomas, I am pretty good with reading the docs, and I think this did need clarifying :slight_smile:

1 Like

Is it possible to use white_value in the profile? I have RGBW lights, if i don’t set any white value it just turns the white leds off. :confused:

1 Like

Hey folks,
I just started setting up this card together with a IKEA LED1623G12 ZigBee bulb. Just brightness choice possible, no RGB, no temperature.
The setup works in general, but…
neither the color highlighting of the current profile works, nor is the switch shown - although it’s clickable and controls the bulb.

Anyone any ideas?

grafik
grafik

I’ve set up the following:
../config/light_profiles.csv

id,x,y,brightness
bright,0.457,0.408,254
background,0.457,0.408,150
dimmed,0.457,0.408,77

../config/ui-lovelace.yaml

resources:
  - type: module
    url: /local/custom-lovelace/light-with-profiles.js

light_profiles:
  bright: '0.457,0.408,254'
  background: '0.457,0.408,150'
  dimmed: '0.457,0.408,77'

  - title: Arbeitszimmer
    path: arbeitszimmer
    icon: mdi:desk-lamp
    cards:
      - type: 'custom:light-with-profiles'
        title: Licht
        entities:
          - entity: light.0x000b57fffe143462_light
            profiles:
              - name: bright
                icon: 'mdi:brightness-5'
              - name: background
                icon: 'mdi:brightness-4'
              - name: dimmed
                icon: 'mdi:brightness-3'

Hey @mcg

I actually had this little issue myself. The card cant see what profile the light is using only the x,y,brightness value. It uses this to compare to the profiles you defined.

So how to solve this.

  1. click a profile on the card
  2. go to developer tools and go to states
  3. find the light on which you switched the profile
  4. see the values it really got (for some reason some lights aint taking the exact values you send)
  5. use the values it actally is using at put that in your config for the card and profiles.csv

this should fix the issue. let me know how it goes

Hey @tcarlsen

thanks for this constructive reply! I checked it and found (obviously) the following: As I just have a withe light bulb there are no rgb-/xy-entries for the color in that particular entity. The brightness has the same value as noted in the profile, though.
Would this automatically mean that the profile highlighting just works with rgb- AND brightness-controllable lights (as all three values are being compared?)

1 Like

every good question. and im not sure :slight_smile:
As off I dont have ani lights without xy I really cant test this.

But what I will try to do is add a debug setting that then will show the value its checking up against

1 Like

@mcg 2.1.0 is out. please go download and enable debug

type: 'custom:light-with-profiles'
title: Lys
debug: true
entities:
  - entity: light.spisestuen
  - entity: light.entreen
  - entity: light.kokken

and tell me what values you get

:heart_eyes:
Well, guess that result’s somehow what we expected :wink:
grafik
But my button is working now!

Any plans to get it added to HACS?

It is in hacs

Forgive me, I simply assumed (first mistake), that since it didn’t have the HACS default badge that it wasn’t in the HACs library. I should have looked before posting (second mistake). Thanks for the reply

1 Like

@mcg please go and upgrade to 2.2.0 I hope I made it possible to make brightness only profiles by setting x,y to 0,0 like this:

light_profiles:
  brightness_only: '0,0,150'

Thanks @tcarlsen, works like a charm now!
grafik

Just another question for my understanding:
Do I define the light profiles once in the ui-lovelace.yaml to have them available in the card and once in the light_profiles.csv to be compared against and make the highlighting possible? Or is there a slimmer way without the need of double documentation?

And maybe just another idea for future development after we now discussed lights with and without RGB: how about RGBW lights with the abilityto control the white temperatures? Or is this currently out of HA’s light profiles scope as there’s just RGB + brightness?

Thanks again and cheers! :slight_smile:

you are defining the light_profiles.csv because its the native way to make and use light profiles in HA
you are defining the profiles you wanna use in the card so the card can compare the values to see which profile is active. Cards dont have access to config files like the light_profiles.csv, so there is no other way around this if you want the active profile to light up.

If you can live with not having the icons show the active profile you can just dont add them in ui-lovelace.yaml. the card will still work, just not show the active profile :slight_smile:

hope the answers your question

1 Like

Im not sure if the native light profiles in HA can use anything else then x,y,brightness

1 Like

Hi,
In home assistant 0.106 there is not light_profiles.csv and lovelace.yaml.
Do we have to add them manually? Also do we have to enable lovelace.yaml mode in order to be able to customize it?

Yes you have to create the files. You always had to. :slight_smile:

I do beleive you can do it without yaml mode