Open abrlox opened 3 years ago
Did you manage to work out how to implement switches?
I'm working on a Solar Inverter over Modbus integration and need to add switches as well, so I was wondering if you have any code to share yet?
do you know what to send via modbus, so that we can enable / disable charging? i even would like to set the maximum ampere.
I am not that familiar with integrating switches into homeassistant, but this code enables charging:
from pymodbus.client import ModbusTcpClient
client = ModbusTcpClient(host=host, port=port, timeout=5)
client.connect()
chargestate_data = client.read_coils(address=400,count=1,slave=0)
charging = chargestate_data.bits[0]
if charging != True:
writingregdata = client.write_coil(address=400,value=True)
I will try my best to get this into your code and create a pull request ;)
I created a pull request. For my EV Charger (Wallbe Pro 22kw) this works fine.
This should be usable via Hass, so automations can do this (e.g. time controlled) Until now, the complete integration is viewer only.