aboutsummaryrefslogtreecommitdiff
path: root/examples/meter.py
blob: 757b4f681eec949dceb9493cb3a47bf18cbec97e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import ShellyPy

# try connecting to the Shelly device under that ip
device = ShellyPy.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)