forked from derco0n/epsolar-tracer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
info.py
executable file
·38 lines (28 loc) · 1.03 KB
/
info.py
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
#!/usr/bin/env python
# -*- coding: iso-8859-15 -*-
# This reads severals values from the EPSolar-charging-controller via RS485-USB-Cable (correct kernel-driver-module needed)
from pyepsolartracer.client import EPsolarTracerClient
from pyepsolartracer.registers import registers, coils
# configure the client logging
import logging
logging.basicConfig()
log = logging.getLogger()
log.setLevel(logging.INFO)
client = EPsolarTracerClient()
client.connect()
response = client.read_device_info()
print("Manufacturer:", repr(response.information[0]))
print("Model:", repr(response.information[1]))
print("Version:", repr(response.information[2]))
response = client.read_input("Charging equipment rated input voltage")
print(str(response))
for reg in registers:
value = client.read_input(reg.name)
print(value)
#if value.value is not None:
# print(client.write_output(reg.name,value.value)
for reg in coils:
value = client.read_input(reg.name)
print(value)
#print(client.write_output(reg.name,value.value)
client.close()