Closed johschmitz closed 2 years ago
I believe the secrets.yaml is for credentials and not for configuration. So we are mixing up some things here. Is this assumption wrong?
I still have no idea on how to make this more intuitive. Sure, my current implementation mixes secrets and configuration. But I have not figured out a way to keep the generic solution using variables in the secrets.yaml and not having to use fixed values in the sungrow config file.
Any suggestions? Yaml is easy but does unfurtonately not deliver that flexiblity :/
For this simple case I don't see the need for a second yaml at all, just let the user edit the 2 or 3 things at the beginning of the modbus_sungrow.yaml and that's it. Why overcomplicate things and not just KISS?
For the Ip adress and the port this is not a problem. They can be stored in the secrets.yaml or at the top of the sungrow.yaml file.
The issue it the modbus slave address (e.g. "slave: 100"), which needs to be set in every modbus register description. This is the reason I put all three parameters as variables into the secret file.
The point here is that the slave ID is always the same for Sungrow. At least as far as I understand. So there is no variable needed and it can be just hard-coded in order to avoid all this trouble and KISS.
In my inverter the slave address is set to 100.
It does not look like there is a sufficient workaround, Therefore I will close this PR :/
I am not sure if this really simplifies the configuration, assuming that nearly every user already has a secrets.yaml file. Was your error message in #6 related to a missing slave variable?
Every modbus registers requires a slave port, which causes many adoptions /changes when someone does not use the default slave port (like me). From my programmers view with maintenance in mind, having all user-customizable parameters outside the modbus_sungrow.yaml config file is the best option to support easy future updates just by copying the file and without the need of any custom changes.
Consequently I should also export the name at the beginning of the file to the secrets.yaml.
What do you think?