Advertisement
xangin

weather forecast action

Dec 15th, 2024
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 0.85 KB | None | 0 0
  1. #動作->取得天氣預報的回報
  2. weather.myhomeaccu:
  3.   forecast:
  4.     - datetime: "2024-12-14T23:00:00+00:00"
  5.       cloud_coverage: 74
  6.       precipitation_probability: 11
  7.       uv_index: 2
  8.       wind_bearing: 41
  9.       condition: partlycloudy
  10.       temperature: 17.9
  11.       apparent_temperature: 14.5
  12.       templow: 14.5
  13.       wind_gust_speed: 61.1
  14.       wind_speed: 35.2
  15.       precipitation: 0
  16.       humidity: 67
  17.  
  18. #自動化:
  19.   - action: weather.get_forecasts
  20.     data:
  21.       type: daily
  22.     response_variable: weather #這會用在下面當變數用
  23.     target:
  24.       entity_id: weather.myhomeaccu
  25.   - action: notify.line_notify
  26.     metadata: {}
  27.     data:
  28.       message: >-
  29.         今天氣溫: {{ weather['weather.myhomeaccu'].forecast[0].temperature }}°C,低溫:
  30.         {{ weather['weather.myhomeaccu'].forecast[0].templow }}°C
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement