Title: "Attribute as Sensor"
Description: "Create an entity from another entities attribute."
Version: 1.6
Date created: 2023-11-19
Last update: 2025-01-05
- Name: Name of the new entity
- Entity: From which entity you want to get the attribute
- Attribute: Which attribute you want as it's own sensor
- Value template: Use a template to manipulate the retrieved attribute from the source entity
- Icon: Icon to use in frontend
- Device class: Device class (select from list)
- State class: State class (select from list)
- Unit of measurement: UoM to use in frontend (select from list, only temperature, or write your own)
The result of the choosen attribute is available with the variable value.
As example, to divide the attribute value with 100 you can enter your value template as: {{ ( value | int ) / 100 }} (convert the value to an integer and then divide it by 100).
Use HACS to install Add as custom repository to HACS
- Below config-folder create a new folder called
custom_componentsif not already exist. - Below new
custom_componentsfolder create a new folder calledattribute_as_sensor - Upload the files/folders in
custom_components/attribute_as_sensordirectory to the newly created folder. - Restart before proceeding
After installation go to "Devices & services" and then "helper" page in HA, press "+ Create helper" and find "Attribute as Sensor" Follow onscreen information for the required information No restart needed
If not for code, maybe add a language file for your language.
Use string.json provided by the integration as a template for adding another language.