This binary is designed to run on Savant's smart hosts and act as an HTTP server.
Future work here includes supporting all commands, as well as supporting allow-listed IPs for calling the server more securely.
- Run the build command
- Copy the binary to the Savant host
- Copy the systemctl config (lib/savant-server.service) to the savant host under /lib/systemd/system/savant-server.service
- Run
sudo systemctl daemon-reload
- Enable the service via
sudo systemctl enable savant-server
- Start the service via
sudo systemctl start savant-server
You can set up the bulk of the logic however you want – either you have your external system calling directly into Savant to run specific operations, or you update a state in Savant and let the trigger system perform the operations.
In my case, I've opted for the latter to keep a clearer separation of domains.
I have added into my home-assistant configuration something like the configuration.yaml and set up a trigger something like this.
In Savant, I have a trigger that performs an action based on state:
And voila, it works!