Now that we've got the basic functionality, we need to build a small control server so that there's a HTTP endpoint for HomeAssistant to make calls to.
On the HomeAssistant end, the simplest way is probably to use the restful command integration - that'll expose a command as an action which can be called in automations.
The alternative is to have homeassistant call curl
but I don't think it makes much sense to do that.
Activity
01-Jan-25 11:54
assigned to @btasker
01-Jan-25 11:56
I know it's not supposed to be used for production, but my intention is to use the Flask debug server for this.
The reasons are
01-Jan-25 12:19
mentioned in commit a97f39adf7ce53f028d086b78d2cd50150c1af25
Message
chore: start seting up for dockerised control server (misc/soliscloud-inverter-control#3)
01-Jan-25 12:19
mentioned in commit 86c87b344ade7c259ff00b824d654c4421925e65
Message
feat: create simple control api (misc/soliscloud-inverter-control#3)
01-Jan-25 12:27
The server appears to work:
POST /api/v1/startCharge
: Start chargingPOST /api/v1/startDischarge
: Start dischargingPOST /api/v1/stopCharge
: Stop a running charge (or discharge)POST /api/v1/stopDischarge
: Stop a running charge (or discharge)None currently take any attributes.
Before we can consider this ticket done, though, I'd like to add support for basic authentication - given that the server talks direct to Soliscloud it'd probably be wise to make sure a crawler can't end up running commands.
01-Jan-25 12:40
mentioned in commit ea27134f7108fa4809f39a34c443c8ccdc655e16
Message
feat: add authentication support (misc/soliscloud-inverter-control#3)
01-Jan-25 12:43
mentioned in commit a2bba7075e88a704aab3c7271e2f877605424f1b
Message
feat: enable auth by default (misc/soliscloud-inverter-control#3)
01-Jan-25 12:43
The server now has basic authentication support via a handful of env vars
If
PASS
isn't provided a random one will be generated at server startup.Auth is enabled by default - the default username is
solisuser
and the password will be randomly generated at startup (meaning it'll change whenever the container rolls and should be overridden)