Skip to content

0.0.6b1

Pre-release
Pre-release
Compare
Choose a tag to compare
@gadgetchnnel gadgetchnnel released this 25 Nov 13:27
· 83 commits to master since this release

Added an option to set state attributes when templating entity states.
This can be used like this (without using a template):

type: 'custom:card-templater'
card:
  ...
entities:
  - entity: sensor.my_sensor
     state_template: >
       {{ "One" if states.sensor.my_sensor.state == "1" else "Not One" }}
     attributes:
       unit_of_measurement: "Testing"

or like this (using a template):

type: 'custom:card-templater'
card:
  ...
entities:
  - entity: sensor.my_sensor
     state_template: >
       {{ "One" if states.sensor.my_sensor.state == "1" else "Not One" }}
     attributes:
       unit_of_measurement_template: >
         {{ states.sensor.my_sensor.state }}