Skip to content

Commit 180e433

Browse files
committed
Update example
1 parent 45fa714 commit 180e433

File tree

3 files changed

+32
-19
lines changed

3 files changed

+32
-19
lines changed

example/datadog/dashboard.json

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"type": "query_value",
99
"requests": [
1010
{
11-
"q": "max:go_expvar.hems.watt{host:hems}",
11+
"q": "max:go_expvar.hems.watt{$host}",
1212
"aggregator": "max",
1313
"conditional_formats": [
1414
{
@@ -48,16 +48,23 @@
4848
"type": "timeseries",
4949
"requests": [
5050
{
51-
"q": "avg:go_expvar.hems.watt{host:hems}",
51+
"q": "avg:go_expvar.hems.watt{$host}.rollup(max)",
5252
"display_type": "area",
5353
"style": {
5454
"palette": "dog_classic",
5555
"line_type": "solid",
5656
"line_width": "normal"
57-
}
57+
},
58+
"on_right_yaxis": false
5859
}
5960
],
60-
"custom_links": [],
61+
"yaxis": {
62+
"label": "",
63+
"scale": "linear",
64+
"min": "auto",
65+
"max": "auto",
66+
"include_zero": true
67+
},
6168
"title": "瞬間消費電力推移(4h)",
6269
"title_size": "16",
6370
"title_align": "left",
@@ -80,7 +87,7 @@
8087
"type": "query_value",
8188
"requests": [
8289
{
83-
"q": "max:go_expvar.hems.watt{host:hems}",
90+
"q": "max:go_expvar.hems.watt{$host}",
8491
"aggregator": "last",
8592
"conditional_formats": [
8693
{
@@ -120,7 +127,7 @@
120127
"type": "timeseries",
121128
"requests": [
122129
{
123-
"q": "avg:go_expvar.hems.watt{host:hems}",
130+
"q": "avg:go_expvar.hems.watt{$host}.rollup(max)",
124131
"display_type": "area",
125132
"style": {
126133
"palette": "dog_classic",
@@ -129,7 +136,13 @@
129136
}
130137
}
131138
],
132-
"custom_links": [],
139+
"yaxis": {
140+
"label": "",
141+
"scale": "linear",
142+
"min": "auto",
143+
"max": "auto",
144+
"include_zero": true
145+
},
133146
"title": "瞬間消費電力推移(24h)",
134147
"title_size": "16",
135148
"title_align": "left",
@@ -147,7 +160,13 @@
147160
}
148161
}
149162
],
150-
"template_variables": [],
163+
"template_variables": [
164+
{
165+
"name": "host",
166+
"default": "raspberrypi",
167+
"prefix": "host"
168+
}
169+
],
151170
"layout_type": "free",
152171
"is_read_only": false,
153172
"notify_list": [],
Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,16 @@
11
[Unit]
22
Description=hems
33

4-
# Stop the service when the HEMS USB dongle is disconnected
5-
BindsTo=sys-devices-platform-soc-3f980000.usb-usb1-1\x2d1-1\x2d1.2-1\x2d1.2:1.0-tty-ttyACM0.device
6-
74
# Wait until HEMS USB dongle is connected
8-
After=sys-devices-platform-soc-3f980000.usb-usb1-1\x2d1-1\x2d1.2-1\x2d1.2:1.0-tty-ttyACM0.device
5+
Requires=dev-udg\x2d1\x2dwsne.device
6+
After=dev-udg\x2d1\x2dwsne.device
97

108
[Service]
119
Type=simple
1210
Environment=HEMS_ROUTEB_ID=xxx
1311
Environment=HEMS_PASSWORD=xxx
14-
ExecStart=/home/pi/datadog/hems_linux_arm
12+
Environment=HEMS_DEVICE=/dev/udg-1-wsne
13+
ExecStart=/usr/local/bin/hems_linux_armv7
1514
ExecReload=/bin/kill -HUP $MAINPID
1615
KillMode=control-group
1716
Restart=on-failure
18-
19-
[Install]
20-
# Start when HEMS USB dongle is connected
21-
WantedBy=multi-user.target sys-devices-platform-soc-3f980000.usb-usb1-1\x2d1-1\x2d1.2-1\x2d1.2:1.0-tty-ttyACM0.device
22-
Alias=hems.service
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ACTION=="add",ENV{ID_BUS}=="usb",ENV{DEVNAME}=="/dev/ttyACM0",RUN+="/bin/systemctl --no-block start hems.service"
1+
SUBSYSTEM=="tty",ACTION=="add",ENV{ID_VENDOR_ID}=="0409",ENV{ID_MODEL_ID}=="04c7",ENV{ID_USB_INTERFACE_NUM}=="00",GROUP="dialout",TAG+="systemd",SYMLINK+="udg-1-wsne",NAME="udg-1-wsne",ENV{SYSTEMD_WANTS}+="hems.service"

0 commit comments

Comments
 (0)