-
Notifications
You must be signed in to change notification settings - Fork 3
/
doc.go
76 lines (68 loc) · 1.78 KB
/
doc.go
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
// Package powerpal provides a basic client for retrieving meter readings from
// the Powerpal readings API for a given device with its authorization token.
// API: https://readings.powerpal.net/documentation
package powerpal
/*
Sample Queries:
GET https://readings.powerpal.net/api/v1/device/<serial> HTTP/2.0
accept: application/json
accept-encoding: gzip, deflate, br
user-agent: Powerpal/1895 CFNetwork/1240.0.4 Darwin/20.5.0
accept-language: en-au
authorization: <token>
Resp:
{
"available_days": 8,
"first_reading_timestamp": 1624954980,
"last_reading_cost": 0.003244248,
"last_reading_timestamp": 1625743740,
"last_reading_watt_hours": 22,
"serial_number": "<serial>",
"total_cost": 40.96497,
"total_meter_reading_count": 13147,
"total_watt_hours": 215354
}
GET https://readings.powerpal.net/api/v1/meter_reading/<serial>?start=1624954980&end=1625743740 HTTP/2.0
accept: application/json
content-type: application/json
accept-encoding: gzip, deflate, br
user-agent: Powerpal/1895 CFNetwork/1240.0.4 Darwin/20.5.0
authorization: <token>
accept-language: en-au
Resp (gzip encoded):
[
{
"cost": 0.002801850,
"is_peak": false,
"pulses": 60,
"samples": 1,
"timestamp": 1624954980,
"watt_hours": 19
},
{
"cost": 0.002801850,
"is_peak": false,
"pulses": 61,
"samples": 1,
"timestamp": 1624955040,
"watt_hours": 19
},
{
"cost": 0.002801850,
"is_peak": false,
"pulses": 61,
"samples": 1,
"timestamp": 1624955100,
"watt_hours": 19
},
...,
{
"cost": 0.003244248,
"is_peak": false,
"pulses": 69,
"samples": 1,
"timestamp": 1625743740,
"watt_hours": 22
}
]
*/