Skip to content

Instantly share code, notes, and snippets.

@chadbaldwin
Created April 28, 2022 20:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chadbaldwin/379423080faae3aefcb5fc7d807e1716 to your computer and use it in GitHub Desktop.
Save chadbaldwin/379423080faae3aefcb5fc7d807e1716 to your computer and use it in GitHub Desktop.
HomeAssistant Round template sensor example
# configuration.yaml
template:
- sensor:
- name: new_entity_id
device_class: power
unit_of_measurement: W # watts
state: "{{ states('sensor.target_entity_id') | default(0, true) | round(2, default=0) }}"
# customize.yaml
sensor.new_entity_id:
friendly_name: Friendly Name (Rounded)
@chadbaldwin
Copy link
Author

[reserving first comment]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment