微信扫码登录
13
125
969
高级会员
- platform: template sensors: number_lights_on: # 开灯数量统计 unique_id: "number_lights_on" friendly_name: "开灯数量" value_template: >- {{ states.light | selectattr('state', 'eq', 'on') | selectattr('attributes.friendly_name', 'search', '灯') | list | count }}
使用道具 举报
8
693
4975
论坛元老
7
349
3758
yuyuye 发表于 2023-2-23 13:22 追加一个过滤: | rejectattr('attributes.friendly_name', 'in', ['指示灯1','指示灯2'])
3
59
291
中级会员
本版积分规则 发表回复 回帖后跳转到最后一页
Archiver|手机版|小黑屋|Hassbian ( 晋ICP备17001384号-1 )
GMT+8, 2026-1-29 05:47 , Processed in 0.053744 second(s), 9 queries , MemCached On.
Powered by Discuz! X3.5
© 2001-2026 Discuz! Team.