本帖最后由 hudan717 于 2022-8-4 12:38 编辑
日常发现一个好玩的小卡片,整体效果如下
卡片单独效果
当然如果觉得元素重复的话,也可以单独把chips拆开来配合天气使用
卡片名称:Sun card hacs直接搜索即可 Git地址:https://github.com/AitorDB/home-assistant-sun-card
当然问题是有的,原卡片不支持中文,请在7楼领取汉化包
效果就是这样的
当然,上面这些东西的前提是你有装了对应的集成,太阳集成搜索"sun",月亮集成搜索“moon”
整体代码如下,按需自取
square: false
columns: 1
type: grid
cards:
- type: vertical-stack
cards:
- type: custom:mushroom-chips-card
chips:
- type: template
content: >-
日出 {% if states.sun.sun %} {{
(as_timestamp(states.sun.sun.attributes.next_rising)) |
timestamp_custom(('%H:%M') )}} {% endif %}
icon: mdi:weather-sunset-up
icon_color: '#e3d123'
- type: template
content: >-
日落 {% if states.sun.sun %} {{
(as_timestamp(states.sun.sun.attributes.next_setting)) |
timestamp_custom(('%H:%M') )}} {% endif %}
icon: mdi:weather-sunset-down
icon_color: '#e75454'
- type: entity
entity: sensor.moon
icon_color: '#c4c8b7'
- type: custom:weather-card
entity: weather.dong_qian_hu
houer_forecast: false
show_forecast: true
icon: /hacsfiles/lovelace-colorfulclouds-weather-card/icons/animated/
name: ''
secondary_info_attribute: humidity
- square: false
columns: 1
type: grid
cards:
- type: custom:sun-card
showElevation: false
showAzimuth: false
language: de
|