https://github.com/nareddyt/ha-templight-sensor
Home Assistant custom integration to extract out light attributes (color temp, brightness, etc.) into separate sensors.
https://github.com/nareddyt/ha-templight-sensor
hacs home-assistant homeassistant integration light templates
Last synced: 2 months ago
JSON representation
Home Assistant custom integration to extract out light attributes (color temp, brightness, etc.) into separate sensors.
- Host: GitHub
- URL: https://github.com/nareddyt/ha-templight-sensor
- Owner: nareddyt
- License: apache-2.0
- Created: 2022-09-07T03:37:11.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-11-06T18:17:32.000Z (over 2 years ago)
- Last Synced: 2025-02-28T20:09:43.657Z (2 months ago)
- Topics: hacs, home-assistant, homeassistant, integration, light, templates
- Language: Python
- Homepage:
- Size: 695 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TempLight Sensor
[](https://github.com/hacs/integration)
_Home Assistant custom integration to extract out light attributes (color temp, brightness, etc.) into separate diagnostic sensors._

- [TempLight Sensor](#templight-sensor)
- [Overview](#overview)
- [Installing](#installing)
- [Configuration](#configuration)
- [Benefits](#benefits)
- [No More Custom Template Sensors](#no-more-custom-template-sensors)
- [Save Attribute History](#save-attribute-history)
- [Easier Automations & Frontend Views](#easier-automations--frontend-views)
- [Supported Attributes](#supported-attributes)
- [Supported Entities](#supported-entities)
- [FAQ](#faq)
- [Naming](#naming)
- [Read Only](#read-only)## Overview
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.## Installing
1) Install HACS.
1) Add this GitHub repository as a custom repository in your HACS install.
1) Search for `TempLight Sensor` in HACS and install it.
1) Restart Home Assistant.All _supported_ lights in your Home Assistant install will now have diagonstic TempLight Sensors associated with them.
## Configuration
There is no configuration! TempLight Sensors are automatically added for all _supported_ lights in your Home Assistant install.
## Benefits
A few reasons these diagonstic sensors are useful:
### No More Custom Template Sensors
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.
### Save Attribute History
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.

### Easier Automations & Frontend Views
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.

## Supported Attributes
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` attributePlease 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`.
## Supported Entities
TempLight Sensors are automatically created for the following entities:
1) `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.
## FAQ
### Naming
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`.
### Read Only
TempLight Sensors are diagnostic sensors.
They only output the underlying value. They do not support overwriting the value in the underlying entity.