Advertisement
adorobis

weather forecast template sensors

Oct 18th, 2024
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.61 KB | None | 0 0
  1. - trigger:
  2. - platform: time_pattern
  3. hours: /1
  4. - platform: homeassistant
  5. event: start
  6. action:
  7. - service: weather.get_forecasts
  8. data:
  9. type: daily
  10. target:
  11. entity_id: weather.home
  12. response_variable: daily
  13. sensor:
  14. - name: Forecast Bibice Daily
  15. state: "{{ states('weather.home') }}"
  16. attributes:
  17. temperature: "{{ state_attr('weather.home', 'temperature') }}"
  18. dew_point: "{{ state_attr('weather.home', 'dew_point') }}"
  19. temperature_unit: "{{ state_attr('weather.home', 'temperature_unit') }}"
  20. humidity: "{{ state_attr('weather.home', 'humidity') }}"
  21. cloud_coverage: "{{ state_attr('weather.home', 'cloud_coverage') }}"
  22. pressure: "{{ state_attr('weather.home', 'pressure') }}"
  23. pressure_unit: "{{ state_attr('weather.home', 'pressure_unit') }}"
  24. wind_bearing: "{{ state_attr('weather.home', 'wind_bearing') }}"
  25. wind_speed: "{{ state_attr('weather.home', 'wind_speed') }}"
  26. wind_speed_unit: "{{ state_attr('weather.home', 'wind_speed_unit') }}"
  27. visibility_unit: "{{ state_attr('weather.home', 'visibility_unit') }}"
  28. precipitation_unit: "{{ state_attr('weather.home', 'precipitation_unit') }}"
  29. forecast: "{{ daily['weather.home'].forecast }}"
  30.  
  31. - trigger:
  32. - platform: time_pattern
  33. hours: /1
  34. - platform: homeassistant
  35. event: start
  36. action:
  37. - service: weather.get_forecasts
  38. data:
  39. type: hourly
  40. target:
  41. entity_id: weather.home
  42. response_variable: hourly
  43. sensor:
  44. - name: Forecast Bibice Hourly
  45. state: "{{ states('weather.home') }}"
  46. attributes:
  47. temperature: "{{ state_attr('weather.home', 'temperature') }}"
  48. dew_point: "{{ state_attr('weather.home', 'dew_point') }}"
  49. temperature_unit: "{{ state_attr('weather.home', 'temperature_unit') }}"
  50. humidity: "{{ state_attr('weather.home', 'humidity') }}"
  51. cloud_coverage: "{{ state_attr('weather.home', 'cloud_coverage') }}"
  52. pressure: "{{ state_attr('weather.home', 'pressure') }}"
  53. pressure_unit: "{{ state_attr('weather.home', 'pressure_unit') }}"
  54. wind_bearing: "{{ state_attr('weather.home', 'wind_bearing') }}"
  55. wind_speed: "{{ state_attr('weather.home', 'wind_speed') }}"
  56. wind_speed_unit: "{{ state_attr('weather.home', 'wind_speed_unit') }}"
  57. visibility_unit: "{{ state_attr('weather.home', 'visibility_unit') }}"
  58. precipitation_unit: "{{ state_attr('weather.home', 'precipitation_unit') }}"
  59. forecast: "{{ hourly['weather.home'].forecast }}"
  60.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement