Open wolnlow opened 4 months ago
按照HA的规范,预报数据不再写入状态机,影响效率。如果需要得到预报数据请使用weather.get_forecasts
服务
意思是 官方集成不自带支持 weather.实体了吗? 我的最近提示不可用了,其他senor实体是正常
意思是 官方集成不自带支持 weather.实体了吗? 我的最近提示不可用了,其他senor实体是正常
你的问题和这个不是一个问题,你的问题需要提供更多信息
HA三月更新之后得手动创建一个传感器了
#place it in '/config/templates.yaml'
- trigger:
- platform: time_pattern
hours: /1
minutes: "40"
- platform: homeassistant
event: start
action:
- service: weather.get_forecasts
data:
type: hourly
target:
entity_id: weather.wo_de_jia
response_variable: hourly
sensor:
- name: weather_hourly
state: "{{ states('weather.wo_de_jia') }}"
attributes:
temperature: "{{ state_attr('weather.wo_de_jia', 'temperature') }}"
apparent_temperature: "{{ state_attr('weather.wo_de_jia', 'apparent_temperature') }}"
temperature_unit: "{{ state_attr('weather.wo_de_jia', 'temperature_unit') }}"
humidity: "{{ state_attr('weather.wo_de_jia', 'humidity') }}"
cloud_coverage: "{{ state_attr('weather.wo_de_jia', 'cloud_coverage') }}"
uv_index: "{{ state_attr('weather.wo_de_jia', 'uv_index') }}"
pressure: "{{ state_attr('weather.wo_de_jia', 'pressure') }}"
pressure_unit: "{{ state_attr('weather.wo_de_jia', 'pressure_unit') }}"
wind_bearing: "{{ state_attr('weather.wo_de_jia', 'wind_bearing') }}"
wind_speed: "{{ state_attr('weather.wo_de_jia', 'wind_speed') }}"
wind_speed_unit: "{{ state_attr('weather.wo_de_jia', 'wind_speed_unit') }}"
visibility: "{{ state_attr('weather.wo_de_jia', 'visibility') }}"
visibility_unit: "{{ state_attr('weather.wo_de_jia', 'visibility_unit') }}"
precipitation_unit: "{{ state_attr('weather.wo_de_jia', 'precipitation_unit') }}"
skycon: "{{ state_attr('weather.wo_de_jia', 'skycon') }}"
forecast: "{{ hourly['weather.wo_de_jia'].forecast }}"