Compare commits
3 Commits
5827b494b5
...
lüftungsan
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7b00d622aa | ||
|
|
4727364048 | ||
|
|
666eb211a3 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
4
main.py
4
main.py
@@ -26,8 +26,8 @@ db = DataBaseInflux(
|
|||||||
bucket="allmende_db"
|
bucket="allmende_db"
|
||||||
)
|
)
|
||||||
|
|
||||||
hp_master = HeatPump(device_name='hp_master', ip_address='10.0.0.10', port=502)
|
hp_master = HeatPump(device_name='hp_master', ip_address='127.0.0.1', port=8111)
|
||||||
hp_slave = HeatPump(device_name='hp_slave', ip_address='10.0.0.11', port=502)
|
hp_slave = HeatPump(device_name='hp_slave', ip_address='127.0.0.1', port=8111)
|
||||||
shelly = ShellyPro3m(device_name='wohnung_2_6', ip_address='192.168.1.121')
|
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 = PvInverter(device_name='solaredge_master', ip_address='192.168.1.112')
|
||||||
meter = SolaredgeMeter(device_name='solaredge_meter', ip_address='192.168.1.112')
|
meter = SolaredgeMeter(device_name='solaredge_meter', ip_address='192.168.1.112')
|
||||||
|
|||||||
BIN
modbus_registers/_modbus_register_template.xlsx
Normal file
BIN
modbus_registers/_modbus_register_template.xlsx
Normal file
Binary file not shown.
BIN
modbus_registers/ventilation_modbus_registers.xlsx
Normal file
BIN
modbus_registers/ventilation_modbus_registers.xlsx
Normal file
Binary file not shown.
Binary file not shown.
18
test.py
Normal file
18
test.py
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
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