-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathvi_radio_quality_gw3.yaml
178 lines (178 loc) · 6.75 KB
/
vi_radio_quality_gw3.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
title: GW3
path: gw3
#icon: mdi:radio-tower
panel: true
cards:
- type: vertical-stack
cards:
# Gateways
- type: markdown
content: "### <center> Gateways </center>"
- type: "custom:flex-table-card"
clickable: false
entities:
include:
- binary_sensor.*_gateway
sort_by: friendly_name
columns:
- data: friendly_name
name: Friendly Name
modify: '(x+"").replace(/ Gateway$/,"")'
# - data: network_pan_id
# name: Network PAN ID
# modify: 'x == "" ? "-" : x+""'
# - data: radio_tx_power
# name: Radio TX Power
# modify: 'isNaN(parseInt(x, 10)) ? "-" : parseInt(x, 10)'
# - data: radio_channel
# name: Radio Channel
# modify: 'isNaN(parseInt(x, 10)) ? "-" : parseInt(x, 10)'
- data: free_mem
name: Memory Free (KB)
modify: 'isNaN(parseInt(x, 10)) ? "" : parseInt(x, 10)'
- data: load_avg
name: Load Avg (1m, 5m, 15m)
modify: '(x+"").split("|").slice(0, 3).join(", ")'
- data: serial
name: ZB Tx
modify: 'isNaN(parseInt(x.zigbee_tx, 10)) ? 0 : parseInt(x.zigbee_tx, 10)'
- data: serial
name: ZB Rx
modify: 'isNaN(parseInt(x.zigbee_rx, 10)) ? 0 : parseInt(x.zigbee_rx, 10)'
- data: serial
name: ZB Err
modify: 'isNaN(parseInt(x.zigbee_oe, 10)) ? 0 : parseInt(x.zigbee_oe, 10)'
- data: serial
name: BT Tx
modify: 'isNaN(parseInt(x.bluetooth_tx, 10)) ? 0 : parseInt(x.bluetooth_tx, 10)'
- data: serial
name: BT Rx
modify: 'isNaN(parseInt(x.bluetooth_rx, 10)) ? 0 : parseInt(x.bluetooth_rx, 10)'
- data: serial
name: BT Err
modify: 'isNaN(parseInt(x.bluetooth_oe, 10)) ? 0 : parseInt(x.bluetooth_oe, 10)'
- data: rssi
name: RSSI
- data: uptime
name: Gateway Uptime
modify: x+''
- data: last_changed
name: Connected Since
modify: >
var dt = new Date(x);
var hrs = parseInt((Date.now()-Date.parse(x)) / 3600000);
var min = parseInt(((Date.now()-Date.parse(x)) / 60000) % 60);
var sec = parseInt(((Date.now()-Date.parse(x)) / 1000) % 60);
hrs = (hrs < 10) ? "0" + hrs : hrs;
min = (min < 10) ? "0" + min : min;
sec = (sec < 10) ? "0" + sec : sec;
isFinite(dt) ? dt.toLocaleString(['ru-RU', 'en-US']) +
" (Up: " + hrs + ":" + min + ":" + sec + ")" : ""
css:
table+: "padding-top: 15px;"
"tbody tr:nth-child(even)": "background-color: #a2542f6;"
td.left: "padding: 10px 10px 10px 10px"
th.left: "padding: 0px 0px 10px 10px"
# ZigBee
- type: markdown
content: "### <center> ZigBee </center>"
- type: "custom:flex-table-card"
clickable: false
entities:
include:
- sensor.*_zigbee
sort_by: ieee
columns:
- data: friendly_name
name: Friendly Name
modify: 'x.replace(/ Zigbee$/,"")'
- data: device.extra.ieee
name: IEEE
modify: (x+'').toLowerCase()
- data: device.extra.nwk
name: NWK
modify: (x+'').replace(/^0x/,"")
- data: device.extra.nwk_parent
name: Parent
modify: (x+'').replace(/^0x/,"").toLowerCase()
# - data: type
# name: Type
# modify: 'x == "" ? "-" : (x+"").replace(/^-$/, "device")'
- data: device.extra.fw_ver
name: FW
modify: 'x == "" ? "-" : x+""'
- data: msg_received
name: Received
modify: 'isNaN(parseInt(x, 10)) ? 0 : parseInt(x, 10)'
- data: msg_missed
name: Missed
modify: 'isNaN(parseInt(x, 10)) ? 0 : parseInt(x, 10)'
# - data: unresponsive
# name: Unresponsive
# modify: 'isNaN(parseInt(x, 10)) ? 0 : parseInt(x, 10)'
# - data: new_resets
# name: Resets
# modify: 'isNaN(parseInt(x, 10)) ? 0 : parseInt(x, 10)'
- data: device.extra.lqi
name: LQI
modify: 'isNaN(parseInt(x, 10)) ? "" : parseInt(x, 10)'
- data: device.extra.rssi
name: RSSI
modify: 'isNaN(parseInt(x, 10)) ? "" : parseInt(x, 10)'
# - data: last_msg
# name: Last Message
# modify: x+''
- data: device.available
name: Available
modify: 'x === true ? "✓" : "✗"'
- data: state
name: Last Seen
modify: >
var dt = new Date(0,0,0,0,0,0,(Date.now()-Date.parse(x)));
isFinite(dt) ? dt.toTimeString().split(" ")[0] : ""
css:
table+: "padding-top: 15px;"
"tbody tr:nth-child(even)": "background-color: #a2542f6;"
td.left: "padding: 10px 10px 10px 10px"
th.left: "padding: 0px 0px 10px 10px"
###### iframe with the graph of the "last missed" from Grafana ######
###### Query example: SELECT "last_missed" FROM "autogen"."state" WHERE ("domain" = 'sensor') AND $timeFilter GROUP BY "friendly_name" ######
# - type: iframe
# url: !secret graf_url_zigbee_last_missed
# aspect_ratio: 10%
######---------------------------------------------------------######
# Bluetooth
- type: markdown
content: "### <center> Bluetooth </center>"
- type: "custom:flex-table-card"
clickable: false
entities:
include:
- sensor.*_ble
sort_by: mac
columns:
- data: friendly_name
name: Friendly Name
modify: 'x.replace(/ BLE$/,"")'
- data: device.extra.mac
name: MAC
# modify: (x+'').replace(/(.{2}(?!$))/g,"$1:")
- data: device.extra.cloud_fw
name: FW
modify: 'x == "" ? "-" : x+""'
- data: msg_received
name: Received
modify: 'isNaN(parseInt(x, 10)) ? "" : parseInt(x, 10)'
- data: device.available
name: Available
modify: 'x === true ? "✓" : "✗"'
- data: state
name: Last Seen
modify: >
var dt = new Date(0,0,0,0,0,0,(Date.now()-Date.parse(x)));
isFinite(dt) ? dt.toTimeString().split(" ")[0] : ""
css:
table+: "padding-top: 15px;"
"tbody tr:nth-child(even)": "background-color: #a2542f6;"
td.left: "padding: 10px 10px 10px 10px"
th.left: "padding: 0px 0px 10px 10px"