Home Assistant custom integration to extract out light attributes (color temp, brightness, etc.) into separate diagnostic sensors.
TempLight Sensors are diagonstic sensors that extract out attributes from an underlying light.
This integration creates a few derived sensors for each pre-existing light
entity.
- Install HACS.
- Add this GitHub repository as a custom repository in your HACS install.
- Search for
TempLight Sensor
in HACS and install it. - Restart Home Assistant.
All supported lights in your Home Assistant install will now have diagonstic TempLight Sensors associated with them.
There is no configuration! TempLight Sensors are automatically added for all supported lights in your Home Assistant install.
A few reasons these diagonstic sensors are useful:
You don't need to create your own template sensors to just extract out an attribute as state! It essentially occurs automatically now for any light you add.
By default, Home Assistant does not save your lights' attributes in the database. You cannot query Home Assistant for the previous attribute values - e.g. "How bright was my night light yesterday at 8am?"
By extracting out these attributes to different sensors and tracking their state separately, the values are now saved to the database. You can easily view history for each individual attribute.
Some frontend cards and automations do not support reading a particular attribute for a given sensor. - e.g. Display a frontend card that shows the current color temperature of the bedroom light.
With TempLight Sensors, you can easily use these attributes, as they are now native entity state objects.
The following light attributes are extracted and stored as individual TempLight Sensors:
- Brightness (%) via the
brightness
attribute - Color temperature (Kelvin) via the
color_temp
attribute - Color hue via the
hs_color
attribute - Color saturation via the
hs_color
attribute
Please file a feature request if would like to see other light attributes as sensors.
If the underying light does not support an attribute above (e.g. you have an RGB light that does not have color temperature), the sensor will still be created but show up as Unknown
.
If the light is turned off, all TempLight Sensors will show the last available value. They will not show as Disabled
, Unavailable
, or Unknown
.
TempLight Sensors are automatically created for the following entities:
light
entities that have a unique ID and are registered via the entity and device registry internally.
Please file a feature request if would like to see other supported entities.
Why is this integration called TempLight Sensor?
It is a bit historical: To track attributes as state in Home Assistant, the common advice in the HA community forums is to create a new template_sensor
that extracts that attribute into another sensor.
But also a play on words: Originally this integration was created to track light
attributes. Hence template_sensor
--> templight_sensor
.
TempLight Sensors are diagnostic sensors. They only output the underlying value. They do not support overwriting the value in the underlying entity.