kwindrem / ExtTransferSwitch

7 stars 1 forks source link

Ability to set via ModBus or some other way via TCP? #2

Closed zorrobyte closed 1 year ago

zorrobyte commented 1 year ago

I'm running home assistant and managing when my generator start/stops via Victron (SoC and manual start) and Node Red. This means I know when the generator is running without needing to install a relay on the transfer switch as suggested for the digitalinput for this mod.

I was considering deploying an ESP32 and using a pin for the digital input (to the GX), but this feels pretty hacky.

I also write software, so I could implement something myself, if I get started. But on initial pass, do you know if any way to edit/add modbus registers without having to modify the core victron OS?

kwindrem commented 1 year ago

Sorry, I don't know anything about modbus.

Currently, my code looks for a digital input programmed as the transfer switch input before doing anything else. It also uses the state of that input for it's logic. You could modify the code to create a dbus parameter that could then be accessed from the outside world once you figure out how to access things from modbus, or other ways in.

Note that basing the transfer switch state on generator running/stopped state might not be the best. The generator could be running but not supplying the load to the Multi.

zorrobyte commented 1 year ago
image

Note that basing the transfer switch state on generator running/stopped state might not be the best. The generator could be running but not supplying the load to the Multi.

Good idea! I got so far as to check for the generator light being on and seeing if there is voltage at L1 input. There's no guarantee that the multiplus will kick over though, and I need to check for that also.

Looking through your code, it's python, glorious python! I'll fork and work on an externally controllable solution.

Thanks for getting me started!

zorrobyte commented 1 year ago

For anyone else running across this, just wire a relay to a digital input!

image

Then you can use node red on device, or via d-bus, mqtt to set generator state!