MQTT script send weather - nodinosaur/ha_tv_dashboard_wiki GitHub Wiki
Send (notify) current weather conditions to TV
To add this create a new script, navigate as follows:
Settings
→ Automations & Scenes
→ Scripts
→ + Add Script
→ Create new script
→ Overflow menu (3 dots)
→ Edit in YAML
Change weather.met_office_london_daily
for your daily weather service, i.e. weather.forecast_home
alias: Send Weather by MQTT to TV
sequence:
- service: mqtt.publish
data:
qos: 0
retain: false
topic: tv/dashboard/command
payload_template: |-
weather:
temperature: {{ state_attr('weather.met_office_london_daily', 'temperature') }}
temperature_unit: {{ state_attr('weather.met_office_london_daily', 'temperature_unit') }}
conditions: {{ state_translated('weather.met_office_london_daily') }}
state: {{ states('weather.met_office_london_daily') }}
sun: {{ states('sun.sun') }}
time: {{ states("sensor.time") }}
mode: single
icon: hass:weather-cloudy-arrow-right