找回密码
 立即注册
楼主: d380025303

[流程系列] 利用ikuai实时检测设备在线情况&HA操作设备连/断网

  [复制链接]

0

主题

44

回帖

315

积分

中级会员

积分
315
金钱
271
HASS币
0
发表于 2024-6-4 09:04:35 | 显示全部楼层
膜拜大神!
回复

使用道具 举报

1

主题

42

回帖

185

积分

注册会员

积分
185
金钱
142
HASS币
0
发表于 2024-7-8 15:45:36 | 显示全部楼层
看上去好高大上,慢慢学习~
回复

使用道具 举报

0

主题

67

回帖

566

积分

高级会员

积分
566
金钱
499
HASS币
0
发表于 2024-7-11 17:45:09 | 显示全部楼层
我把楼主的代码加了上传和下载的展示  大家可以参考下

type: markdown
content: >
  ## 路由已连接设备清单


  | 设备名称 | 在线时长 | 下载量 | 上传量 |

  | :------ | ------: | ------: | ------: |

  {% for state in states.sensor %}{% if
  state.entity_id.startswith('sensor.sensor_') %}{% if state.state == 'online'
  %}| {{ state.attributes.friendly_name }} | {{ state.attributes.uptime }} | {{ state.attributes.total_down }} | {{ state.attributes.total_up }} |

  {% endif %}{% endif %}{% endfor %}



  ## 路由下线设备清单


  {% for state in states.sensor %}{% if
  state.entity_id.startswith('sensor.sensor_') %}{% if state.state != 'online'
  %} <font color="#cccccc">{{ state.attributes.friendly_name }} </font>{% endif
  %}{% endif %}{% endfor %}



111111111111111.png
回复

使用道具 举报

0

主题

67

回帖

566

积分

高级会员

积分
566
金钱
499
HASS币
0
发表于 2024-7-11 18:06:46 | 显示全部楼层
这个是上传和下载添加了颜色显示

type: markdown
content: >
  ## 路由已连接设备清单


  | 设备名称 | 在线时长 | 下载量 | 上传量 |

  | :------ | ------: | ------: | ------: |

  {% for state in states.sensor %}{% if
  state.entity_id.startswith('sensor.sensor_') %}{% if state.state == 'online'
  %}| {{ state.attributes.friendly_name }} | {{ state.attributes.uptime }} | <font color="#00bc12">{{ state.attributes.total_down }} </font> | <font color="#ef7a82">{{ state.attributes.total_up }} </font> |

  {% endif %}{% endif %}{% endfor %}



  ## 路由下线设备清单


  {% for state in states.sensor %}{% if
  state.entity_id.startswith('sensor.sensor_') %}{% if state.state != 'online'
  %} <font color="#cccccc">{{ state.attributes.friendly_name }} </font>{% endif
  %}{% endif %}{% endfor %}
回复

使用道具 举报

fyf 

0

主题

7

回帖

60

积分

注册会员

积分
60
金钱
53
HASS币
0
发表于 2024-7-17 09:49:26 | 显示全部楼层
666顶顶顶,这个好,感谢
回复

使用道具 举报

0

主题

11

回帖

90

积分

注册会员

积分
90
金钱
79
HASS币
0
发表于 2024-9-20 17:44:42 | 显示全部楼层
node-red-contrib-crypto-js-dynamic
回复

使用道具 举报

0

主题

11

回帖

88

积分

注册会员

积分
88
金钱
77
HASS币
0
发表于 2024-9-24 11:26:47 | 显示全部楼层
学习了
回复

使用道具 举报

0

主题

12

回帖

74

积分

注册会员

积分
74
金钱
62
HASS币
0
发表于 2024-12-6 08:52:23 | 显示全部楼层
感谢分享
回复

使用道具 举报

0

主题

8

回帖

48

积分

新手上路

积分
48
金钱
40
HASS币
0
发表于 2025-1-23 17:53:59 | 显示全部楼层
感谢分享
回复

使用道具 举报

0

主题

9

回帖

90

积分

注册会员

积分
90
金钱
81
HASS币
0
发表于 2025-1-26 09:07:22 | 显示全部楼层
学习一下
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2025-5-1 14:03 , Processed in 0.353962 second(s), 23 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

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