forked from Jan200101/ShellyPy
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmeter.py
More file actions
17 lines (13 loc) · 655 Bytes
/
Copy pathmeter.py
File metadata and controls
17 lines (13 loc) · 655 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import shelly
# try connecting to the Shelly device under that ip
device = shelly.Shelly("192.168.68.121")
# WILL throw an exception if the device is not reachable, gives a bad response or requires a login
deviceMeter = device.meter(0) #request meter information
print(deviceMeter['power']) #print power information
print(deviceMeter['overpower']) #print overpower information
print(deviceMeter['is_valid']) #print is_valid information
print(deviceMeter['timestamp']) #print timestamp information
print(deviceMeter['counters']) #print counters information
print(deviceMeter['total']) #print total information
device.update()
print(device)