Skip to content

Instantly share code, notes, and snippets.

@hannesbe
Last active January 2, 2019 19:02
Show Gist options
  • Save hannesbe/addc9496fbfd2b6f9b57092a6223f51d to your computer and use it in GitHub Desktop.
Save hannesbe/addc9496fbfd2b6f9b57092a6223f51d to your computer and use it in GitHub Desktop.
Home Assistant Jinja template to create fast customize for groups, sensors, covers etc... Just change that first line below 'sensor' to 'group', 'covers' etc..
{% for state in states.sensor -%}
{% if loop.first %}
{% elif loop.last %}
{% else %}
{% endif %}
{{- state.entity_id }}:
friendly_name: '{{ state.attributes.friendly_name|replace("_"," ",)|title() if state.attributes.friendly_name is defined else state.name|replace("_"," ",)|title() }}'
emulated_hue_hidden: {{state.attributes.emulated_hue_hidden if state.attributes.emulated_hue_hidden is defined else 'False' }}
hidden: {{state.attributes.hidden if state.attributes.hidden is defined else "False"}}
homebridge_hidden: {{state.attributes.homebridge_hidden if state.attributes.homebridge_hidden is defined else "true"}}
{{'icon: '+ state.attributes.icon if state.attributes.icon is defined}}
{{'homebridge_cover_type: '+ state.attributes.homebridge_cover_type if state.attributes.homebridge_cover_type is defined}}
{{'assumed_state: '+ state.attributes.assumed_state if state.attributes.assumed_state is defined}}
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment