-
Notifications
You must be signed in to change notification settings - Fork 6
/
example.py
35 lines (31 loc) · 962 Bytes
/
example.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
from pysolarfocus import ApiVersions, SolarfocusAPI, Systems
# Create the Solarfocus API client
solarfocus = SolarfocusAPI(
ip="solarfocus", system=Systems.VAMPAIR, api_version=ApiVersions.V_23_020 # adapt IP-Address # change to Systems.Therminator
) # select Solarfocus version
if not solarfocus.connect():
print("Connecting to solarfocus failed.")
exit(1)
# Fetch the values
if not solarfocus.update():
print("Updating solarfocus failed.")
exit(1)
# Print the values
print(solarfocus)
print(solarfocus.heating_circuits[0])
print("\n")
print(solarfocus.boilers[0])
print("\n")
print(solarfocus.buffers[0])
print("\n")
if solarfocus.system in [Systems.THERMINATOR, Systems.ECOTOP]:
print(solarfocus.biomassboiler)
if solarfocus.system is Systems.VAMPAIR:
print(solarfocus.heatpump)
print("\n")
print(solarfocus.photovoltaic)
print("\n")
print(solarfocus.fresh_water_modules[0])
print("\n")
print(solarfocus.solar)
print("\n")