wechselrichter zum tesent eingebunden
This commit is contained in:
13
main.py
13
main.py
@@ -5,7 +5,7 @@ from data_base_influx import DataBaseInflux
|
||||
from heat_pump import HeatPump
|
||||
from shelly_pro_3m import ShellyPro3m
|
||||
|
||||
interval = 10
|
||||
interval_seconds = 10
|
||||
|
||||
db = DataBaseInflux(
|
||||
url="http://localhost:8086",
|
||||
@@ -16,11 +16,16 @@ db = DataBaseInflux(
|
||||
|
||||
hp = HeatPump(device_name='hp_master', ip_address='10.0.0.10')
|
||||
shelly = ShellyPro3m(device_name='wohnung_2_6', ip_address='192.168.1.121')
|
||||
wr = SolarEdgeWechselrichter(device_name='wr_master', ip_address='192.168.1.112')
|
||||
|
||||
controller = SgReadyController(hp, wr)
|
||||
|
||||
while True:
|
||||
now = datetime.now()
|
||||
if now.second % interval == 0 and now.microsecond < 100_000:
|
||||
db.store_data(hp.device_name, hp.get_data())
|
||||
db.store_data(shelly.device_name, shelly.get_data())
|
||||
if now.second % interval_seconds == 0 and now.microsecond < 100_000:
|
||||
db.store_data(hp.device_name, hp.get_state())
|
||||
db.store_data(shelly.device_name, shelly.get_state())
|
||||
db.store_data(wr.device_name, wr.get_state())
|
||||
controller.perform_action()
|
||||
time.sleep(0.1)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user