Hey - does anyone know how I can show the history of a bulb’s colour temperature over time? I have the kelvins auto updated based on the outside light / time of day but I’d like to see how it does over time. I can’t find a way to do this. Any clues?
Is the colour temperature an attribute of your bulb’s entity? If so, create a template sensor to pull that attribute into the state of the new sensor, and you can track that with a history graph.
If you need more details, we need to see your bulb entity: what it’s called, and what the colour temperature attribute is called.
great! if i put this into the template section of developer tools i get the current kelvin value. does that help?
{{ state_attr(‘light.virtual_led_01’, ‘color_temp_kelvin’) }}
Yes. Now create a Template Sensor (under Helpers) and put that exact template into the State Template box (copy from your template editor, not the text above as you didn’t format it as code for the forum).
Set the Unit to K
and you will be able to have a history graph.
Like this (shows unknown for me as I don’t have your bulb):
Or do it in YAML like a boss.
configuration.yaml
template:
- sensor:
- name: "Virtual LED 01 Colour Temp"
state: "{{ state_attr('light.virtual_led_01', 'color_temp_kelvin') }}"
unit_of_measurement: "K"
Heh. Fixed.
Superb! Thank you both for your help, much appreciated.