evcc icon indicating copy to clipboard operation
evcc copied to clipboard

Cannot Read/write coils with modbus plugin

Open kscholty opened this issue 3 years ago • 8 comments

Is your feature request related to a problem? Please describe. I want to implement a custom charger based on a phoenix-em-eth controller. This controller uses coils for the "Enabled" flag. Therefore, I need to be able to read and write coils.

Describe the solution you'd like

  • Add "coil" for type when reading.
  • Add "writesinglecoil" to type when writing

Ideally the "decode" would automatically be "bool", otherwise allow setting "decode" to "bool".

Describe alternatives you've considered Alternatively the "decode" type "bool" could automatically switch the "type" to "coil". But that would not work when writing, since this has no type. Therefore, we would need a "decode" for writing as well.

Additional context Looking into the code "RegisterOperation" in util/modbus/modbus.go looks like a good starting point...

kscholty avatar Jun 09 '23 16:06 kscholty

But why do you want a custom charger for a charger that is Supported? https://docs.evcc.io/docs/devices/chargers/#em-cp-pp-eth-modbus-tcp

StefanSchoof avatar Jun 09 '23 18:06 StefanSchoof

But why do you want a custom charger for a charger that is Supported? https://docs.evcc.io/docs/devices/chargers/#em-cp-pp-eth-modbus-tcp

Because I enhanced my wallbox with a phase switcher. It uses 2 of the outputs of the controller to switch between 1 and 3 phases. See also my question #8373 Since this is not something a lot of people will use I doubt that I can bring this into evcc (@andig ?) Hence, I wanted to try to use a custom charger module. Unfortunatley, it seems that's not so easy.

kscholty avatar Jun 09 '23 19:06 kscholty

Apart from this issue here: Can you please add a discussion about the switching circuit you have designed and added?

Maybe it can be added officially to the charger implementation if it fits some basic safety rules and other users can rebuild it.

premultiply avatar Jun 09 '23 19:06 premultiply

Apart from this issue here: Can you please add a discussion about the switching circuit you have designed and added?

Maybe it can be added officially to the charger implementation if it fits some basic safety rules and other users can rebuild it.

See #8386

kscholty avatar Jun 10 '23 08:06 kscholty

Ich habe im Kopf, dass der custom charger keine 1p/3p Wechsel kann. Wenn das stimmt, löst das dein Problem nicht.

StefanSchoof avatar Jun 10 '23 10:06 StefanSchoof

Kann er mittlerweile. For good or bad 🙄

andig avatar Jun 10 '23 11:06 andig

Hallo kscholty,

ich benötige auch die Funktion um ein Modbus Coil schalten zu können. Wie sieht die yaml config dazu aus? Die Modbus Doku bringt mich nicht weiter.

Grüße Steffen

Steffen294 avatar Jun 24 '23 10:06 Steffen294

Hi, ich habe die Doku angepasst, aber der Pull Request ist noch nicht approved. Schau mal hier https://github.com/evcc-io/docs/pull/399 Ich hoffe, das hilft dir.

kscholty avatar Jun 24 '23 10:06 kscholty