# Loads default set of integrations. Do not remove.
default_config:
tts:
- platform: google_translate
homeassistant:
packages: !include_dir_named packages/
# allowlist_external_dirs:
# - /config
#group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
sensor: !include sensor.yaml
# Load frontend themes from the themes folder
frontend:
# extra_module_url:
# - /hacsfiles/lovelace-card-mod/card-mod.js
themes: !include_dir_merge_named themes
#template: !include sidebar.yaml
#browser_mod:
#lovelace:
# mode: storage
# dashboards:
# mattias-lovelace:
# mode: yaml
# title: Mattias
# icon: mdi:tablet-cellphone
# show_in_sidebar: true
# filename: dashboards/tablet/ui-lovelace.yaml
remote:
- platform: xgimi
name: H3S
host: 192.168.1.115
token: "22D7C7899B9F80FFFFFF0000024B540D"
template:
- sensor:
- name: 一小时天气预警
state: '{% if ("雨" in states.weather.tian_qi.attributes.hourly_forecast[0].text) %}{{states.weather.tian_qi.attributes.hourly_forecast[0].datetime}}降雨概率为:{{states.weather.tian_qi.attributes.hourly_forecast[0].probable_precipitation}}%,可能{{states.weather.tian_qi.attributes.hourly_forecast[0].text}},请多加注意!{% else %}未来一小时无不良天气{% endif %}'
- name: 自然灾害预警最新一条
state: '{% if (states.weather.tian_qi.attributes.warning) %}{{ states.weather.tian_qi.attributes.warning[0].pubTime}}{% else %}当前无自然灾害预警信息{% endif %}'
attributes:
title: "{% if (states.weather.tian_qi.attributes.warning) %}{{ states.weather.tian_qi.attributes.warning[0].title}} {% else %}null{% endif %}"
text: "{% if (states.weather.tian_qi.attributes.warning) %}{{ states.weather.tian_qi.attributes.warning[0].text }} {% else %}null{% endif %}"
pubTime: "{% if (states.weather.tian_qi.attributes.warning) %}{{ states.weather.tian_qi.attributes.warning[0].pubTime}} {% else %}null{% endif %}"
startTime: "{% if (states.weather.tian_qi.attributes.warning) %}{{ states.weather.tian_qi.attributes.warning[0].startTime}} {% else %}null{% endif %}"
endTime: "{% if (states.weather.tian_qi.attributes.warning) %}{{ states.weather.tian_qi.attributes.warning[0].endTime}} {% else %}null{% endif %}"
sender: "{% if (states.weather.tian_qi.attributes.warning) %}{{ states.weather.tian_qi.attributes.warning[0].sender}} {% else %}null{% endif %}"
severity: "{% if (states.weather.tian_qi.attributes.warning) %}{{ states.weather.tian_qi.attributes.warning[0].severity}} {% else %}null{% endif %}"
severityColor: "{% if (states.weather.tian_qi.attributes.warning) %}{{ states.weather.tian_qi.attributes.warning[0].severityColor}} {% else %}null{% endif %}"
level: "{% if (states.weather.tian_qi.attributes.warning) %}{{ states.weather.tian_qi.attributes.warning[0].level}} {% else %}null{% endif %}"
typeName: "{% if (states.weather.tian_qi.attributes.warning) %}{{ states.weather.tian_qi.attributes.warning[0].typeName}} {% else %}null{% endif %}"
all: "{% if (states.weather.tian_qi.attributes.warning) %}{{ states.weather.tian_qi.attributes.warning}} {% else %}null{% endif %}"
复制代码