Compare commits
1 Commits
lüftungsan
...
5827b494b5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5827b494b5 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
9
main.py
9
main.py
@@ -26,13 +26,14 @@ db = DataBaseInflux(
|
||||
bucket="allmende_db"
|
||||
)
|
||||
|
||||
hp_master = HeatPump(device_name='hp_master', ip_address='127.0.0.1', port=8111)
|
||||
hp_slave = HeatPump(device_name='hp_slave', ip_address='127.0.0.1', port=8111)
|
||||
hp_master = HeatPump(device_name='hp_master', ip_address='10.0.0.10', port=502)
|
||||
hp_slave = HeatPump(device_name='hp_slave', ip_address='10.0.0.11', port=502)
|
||||
shelly = ShellyPro3m(device_name='wohnung_2_6', ip_address='192.168.1.121')
|
||||
wr = PvInverter(device_name='solaredge_master', ip_address='192.168.1.112')
|
||||
wr_master = PvInverter(device_name='solaredge_master', ip_address='192.168.1.112', unit=1)
|
||||
wr_slave = PvInverter(device_name='solaredge_slave', ip_address='192.168.1.112', unit=3)
|
||||
meter = SolaredgeMeter(device_name='solaredge_meter', ip_address='192.168.1.112')
|
||||
|
||||
es.add_components(hp_master, hp_slave, shelly, wr, meter)
|
||||
es.add_components(hp_master, hp_slave, shelly, wr_master, wr_slave, meter)
|
||||
controller = SgReadyController(es)
|
||||
|
||||
# FORECASTING
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
18
test.py
18
test.py
@@ -1,18 +0,0 @@
|
||||
from pymodbus.client import ModbusTcpClient
|
||||
import struct
|
||||
|
||||
MODBUS_IP="10.0.0.40"
|
||||
client=ModbusTcpClient(MODBUS_IP, port=502)
|
||||
client.connect()
|
||||
|
||||
try:
|
||||
rr = client.read_input_registers(30, count=3, slave=1)
|
||||
print("Raw 30..32:", rr.registers)
|
||||
|
||||
def as_int16(x):
|
||||
return struct.unpack(">h", struct.pack(">H", x))[0]
|
||||
|
||||
for i, raw in enumerate(rr.registers, start=30):
|
||||
print(i, "raw", raw, "int16", as_int16(raw), "scaled", as_int16(raw)/10.0)
|
||||
finally:
|
||||
client.close()
|
||||
Reference in New Issue
Block a user