2016-12-23 18:27:52 +00:00
You can use this code to quickly create files from the template editor in HA . I use it mainly for ` emulated_hue ` and to quickly add in new Customize options to all things HA !
2016-12-22 21:53:31 +00:00
2017-02-11 05:50:53 +00:00
For the sandbox .
{ % set trigger = { 'entity_id' : 'sensor.downstairs_thermostat_hvac_state' , 'to_state' : 'cooling' } % }
2017-02-01 16:35:45 +00:00
#########################################################
Create fast Customize for groups , sensors , covers etc ...
2016-12-22 21:53:31 +00:00
2017-02-01 16:35:45 +00:00
{ % for state in states . sensor -% }
2016-12-22 21:53:31 +00:00
{ % if loop . first % }
{ % elif loop . last % }
{ % else % }
{ % endif % }
2016-12-23 18:27:52 +00:00
{{ - state . entity_id }}:
friendly_name : '{{ state.attributes.friendly_name|replace("_"," ",)|title() if state.attributes.friendly_name is defined else state.name|replace("_"," ",)|title() }}'
2016-12-22 21:53:31 +00:00
emulated_hue : {{ state . attributes . emulated_hue if state . attributes . emulated_hue is defined else 'False' }}
2016-12-23 18:27:52 +00:00
hidden : {{ state . attributes . hidden if state . attributes . hidden is defined else "False" }}
{{ 'icon: ' + state . attributes . icon if state . attributes . icon is defined }}
2017-02-01 16:35:45 +00:00
{{ 'homebridge_cover_type: ' + state . attributes . homebridge_cover_type if state . attributes . homebridge_cover_type is defined }}
2016-12-23 18:27:52 +00:00
{ % endfor -% }
2016-12-22 21:53:31 +00:00
#########################################################
Create fast Customize for lights . yaml
{ % for state in states . light -% }
{ % if loop . first % }
{ % elif loop . last % }
{ % else % }
{ % endif % }
{{ state . entity_id }}:
2016-12-23 18:23:28 +00:00
friendly_name : '{{ state.attributes.friendly_name|replace("_"," ",)|title() if state.attributes.friendly_name is defined else state.name|replace("_"," ",)|title() }}'
{{ - 'icon: ' + state . attributes . icon if state . attributes . icon is defined }}
emulated_hue : {{ state . attributes . emulated_hue if state . attributes . emulated_hue is defined else 'False' }}
2016-12-23 18:27:52 +00:00
hidden : {{ state . attributes . hidden if state . attributes . hidden is defined else "False" }}
2016-12-23 18:23:28 +00:00
{ %- endfor -% }
#########################################################
Create fast Customize for Input_Boolean . yaml
{ % for state in states . input_boolean -% }
{ % 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() }}'
{{ - 'icon: ' + state . attributes . icon if state . attributes . icon is defined }}
2016-12-22 21:53:31 +00:00
emulated_hue : {{ state . attributes . emulated_hue if state . attributes . emulated_hue is defined else 'False' }}
2016-12-23 18:27:52 +00:00
hidden : {{ state . attributes . hidden if state . attributes . hidden is defined else "False" }}
{ %- endfor -% }
#########################################################
Create fast Customize for Scripts . yaml
{ % for state in states . script -% }
{ % 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() }}'
{{ - 'icon: ' + state . attributes . icon if state . attributes . icon is defined }}
emulated_hue : {{ state . attributes . emulated_hue if state . attributes . emulated_hue is defined else 'False' }}
hidden : {{ state . attributes . hidden if state . attributes . hidden is defined else "False" }}
{ %- endfor -% }
#########################################################
Create fast Customize for scenes . yaml
{ % for state in states . scene -% }
{ % 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() }}'
{{ - 'icon: ' + state . attributes . icon if state . attributes . icon is defined }}
emulated_hue : {{ state . attributes . emulated_hue if state . attributes . emulated_hue is defined else 'False' }}
2016-12-22 21:53:31 +00:00
{ %- endfor -% }