This server is designed to run on Savant's smart hosts and acts as an MQTT client and state polling service.
It's set up to work with Homeassistant's MQTT discovery, where it configures devices as Light Entities.
- Get your lights registry from Savant by exporting loads (plist) and
converting them with
./transform [load.plist] > [oldfile]
- Set up your MQTT broker in your environment
- Create a
savantmqtt.conf
file (see config for details on settings.
Because managing state needs offical softwares from Savant which I doesn't have, so I changed to use service request argument.
Steps:
- View Services
- Pick the service where you need lights to match state
- Find the service request name of each zones, and pick the service name and the request name.
E.g.
Study-Lighting-Lighting_controller-1-SVC_ENV_LIGHTING-DimmerSet
- Main action with DimmerSet on Lighting Controller Source
You can generate the triggers with: ./converttrigger/transform > tmp.json
./converttrigger/transform [load.plist] > tmp.json
go run ./converttrigger/main.go tmp.json
# Import tmp.plist as into triggers - you have to do this in savant
# Clean up
rm tmp.json tmp.plist
- Run the build command
- Copy the binary to the Savant host
- Copy the systemctl config (lib/savant-mqtt.service) to the savant host under /lib/systemd/system/savant-mqtt.service
- Run
sudo systemctl daemon-reload
- Enable the service via
sudo systemctl enable savant-mqtt
- Start the service via
sudo systemctl start savant-mqtt
Thanks to original version berfarah/savant.mqtt Thanks to this guide for making it easy to get up and running with MQTT in Go!