Permalink
Browse files

Fix weather automation for 0.85 breaking changes

  • Loading branch information...
aderusha committed Jan 10, 2019
1 parent 4959dd5 commit f9ef043dbce53d8b37f6c6ebddbe9e1b53702857
BIN -134 Bytes (99%) Home_Assistant/hasppackages.tar.gz
Binary file not shown.
@@ -6,7 +6,7 @@ automation:
- alias: hasp_plate01_p2_Weather
trigger:
- platform: state
entity_id: weather.metno
entity_id: weather.met_no
- platform: state
entity_id: 'binary_sensor.plate01_connected'
- platform: homeassistant
@@ -23,12 +23,12 @@ automation:
- service: mqtt.publish
data:
topic: 'hasp/plate01/command/p[2].b[6].txt'
payload_template: '"{{state_attr("weather.metno","temperature")|int}}°F"'
payload_template: '"{{state_attr("weather.met_no","temperature")|int}}°F"'
- service: mqtt.publish
data:
topic: 'hasp/plate01/command/p[2].b[7].font'
payload_template: '{% if states.weather.metno.state|length <= 6 -%}3{% elif (states.weather.metno.state|length > 6) and (states.weather.metno.state|length <= 10) %}2{% elif (states.weather.metno.state|length > 10) and (states.weather.metno.state|length <= 15) %}1{% else %}0{%- endif %}'
payload_template: '{% if states.weather.met_no.state|length <= 6 -%}3{% elif (states.weather.met_no.state|length > 6) and (states.weather.met_no.state|length <= 10) %}2{% elif (states.weather.met_no.state|length > 10) and (states.weather.met_no.state|length <= 15) %}1{% else %}0{%- endif %}'
- service: mqtt.publish
data:
topic: 'hasp/plate01/command/p[2].b[7].txt'
payload_template: '"{{states.weather.metno.state|wordwrap(20, wrapstring="\\r")|title}}"'
payload_template: '"{{states.weather.met_no.state|wordwrap(20, wrapstring="\\r")|title}}"'

0 comments on commit f9ef043

Please sign in to comment.