MQTT script send weather - nodinosaur/ha_tv_dashboard_wiki GitHub Wiki

Send (notify) current weather conditions to TV

Select Home Assistant Instance

To add this create a new script, navigate as follows:

SettingsAutomations & ScenesScripts+ Add ScriptCreate new scriptOverflow 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

Additional info:

  • Call the script from a button as shown here

  • Add voice functionality as shown here