找回密码
 立即注册
查看: 1473|回复: 0

[已解决] Lovelace值的问题

[复制链接]

22

主题

124

回帖

982

积分

高级会员

积分
982
金钱
836
HASS币
0
发表于 2023-7-9 22:48:59 | 显示全部楼层 |阅读模式
本帖最后由 flamestsui 于 2023-7-10 10:57 编辑
title: 我的家
    path: home
    title: Home
    badges: []
    cards:
      - type: custom:flex-horseshoe-card
        entities:
          - entity: climate.lumi_v2_2fbb_air_conditioner
例如:当空调关闭的时候,显示off
当开启,显示cool

我要如何把off换成”关闭“
“cool”,换成“制冷”呢?

Snipaste_2023-07-09_22-45-47.png


我自己找到方法解决了。
自定义一个sensor就可以
- platform: template
  sensors:
    airconditioningtemperature:
      friendly_name: "当前温度"
      value_template: >-
              {% if is_state('climate.lumi_v2_2fbb_air_conditioner', 'off') %}
              0
              {% else %}
              {{ state_attr('climate.lumi_v2_2fbb_air_conditioner', 'temperature') }}
              {% endif %}
    airconditioningstate:
      friendly_name: "当前状态"
      value_template: >-
              {% if is_state('climate.lumi_v2_2fbb_air_conditioner', 'off') %}
              关闭
              {% elif is_state('climate.lumi_v2_2fbb_air_conditioner', 'cool') %}
              制冷
              {% elif is_state('climate.lumi_v2_2fbb_air_conditioner', 'heat') %}
              制热
              {% elif is_state('climate.lumi_v2_2fbb_air_conditioner', 'auto') %}
              自动
              {% elif is_state('climate.lumi_v2_2fbb_air_conditioner', 'dry') %}
              除湿
              {% elif is_state('climate.lumi_v2_2fbb_air_conditioner', 'fan_only') %}
              送风
              {% else %}
              未知
              {% endif %}


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian ( 晋ICP备17001384号-1 )

GMT+8, 2025-5-6 14:29 , Processed in 0.080788 second(s), 26 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表