Add support for disabling inverter
I have added a switch to be able to enable / disable the inverter during negative pricing in my dynamic contract. No very clean yet, but it does work and might of value to someone else too.
Also I had to catch ModbusIOException as the inverter I have doesn' t reply to a command somehow, not sure how else to fix this with pymodbus. Writing enable to the inverter from the CLI also gives me an error:
./modpoll -m enc -a 1 -r 1 -c 1 -1 -p 5279 192.168.10.11 1 modpoll 3.10 - FieldTalk(tm) Modbus(R) Master Simulator Copyright (c) 2002-2021 proconX Pty Ltd Visit https://www.modbusdriver.com for Modbus libraries and tools.
Protocol configuration: Encapsulated RTU over TCP, FC6 Slave configuration...: address = 1, start reference = 1, count = 1 Communication.........: 192.168.10.11, port 5279, t/o 1.00 s, poll rate 1000 ms Data type.............: 16-bit register, output (holding) register table
Invalid reply error!
Can we somehow get this feature into the main code?
Can confirm this works :)
I'm aware that the code works but I'm a bit reluctant to merge this as I'm not too fond of how it is programmed and will conflict with #18. Where I already implemented the switch sensor.
I had a look at implementing it but found an issue with protocol differences. I didn't make up my mind yet on how to deal with them correctly.