效果
安装前
-
列表条目
你要从插件商店安装Lovelace-UI. -
配置空调的个个传感器和控制设备
举个栗子(用的是H大的红外遥控器,走的mqtt):
iobroker的每个信息和功能控制都是单独的设备. 需要自己配置每个单独的传感器和控制开关 -
配置模式控制设备
工具你自己空调设备支持哪些模式就添加哪些模式
"states": {
"heat": "heat",
"auto": "auto",
"cool": "cool",
"off": "off"
},
- 配置Lovelace实体
你需要什么信息就配置哪个传感器, 你要控制哪些就配置哪些设备
后面这个按钮是让这个条目配置成Lovelace认可的实体.
前面选择实体类型
对于信息读取类的条目我们通常配置的是sensor类型的实体, 比如当前温度, 当前状态
数值调节选择的是input_number类型的实体, 比如调节温度
模式的选择是使用input_select类型,
安装卡片
进入Lovelack程序,进入定制卡页面
把附件里的js文件拖放到这个界面,保存并且重启Lovelace.
配置卡片
进入Lovelace界面,配置UI . 添加卡片.最下面的手动添加卡片
cards:
- type: 'custom:thermostat-card'
title: 工作间
states:
mode: sensor.irmqtt8f5880_ac_stat_mode
current_temp: sensor.irmqtt8f5880_ac_stat_current_temp
tage_temp: sensor.irmqtt8f5880_ac_stat_temp
cmnd:
mode: input_select.irmqtt8f5880_ac_cmnd_mode
settemp: input_number.irmqtt8f5880_ac_cmnd_temp
modes:
heat:
name: 制热
icon: 'mdi:fire'
cool:
name: 制冷
icon: 'mdi:snowflake'
dry:
name: 除湿
icon: 'mdi:water-percent'
auto:
name: 自动
icon: 'mdi:atom'
'off':
name: 关
icon: 'mdi:power'
- type: entities
entities:
- entity: input_select.irmqtt8f5880_ac_cmnd_mode
name: 模式
- entity: input_number.irmqtt8f5880_ac_cmnd_temp
name: 温度
- entity: switch.irmqtt8f5880_ac_cmnd_power
name: 开关
- entity: sensor.irmqtt8f5880_ac_stat_current_temp
name: 当前温度
- entity: sensor.irmqtt8f5880_ac_stat_temp
name: 目标温度
- entity: sensor.irmqtt8f5880_ac_stat_mode
name: 当前模式
- entity: sensor.irmqtt8f5880_ac_stat_swingv
name: 摆风模式
title: 工作间空调
type: horizontal-stack
需要注意的是其中 modes:
配置的内容, 我卡片并没有完全做好, 主要是没时间.
先玩起来
thermostat-card.zip (8.5 KB)