lampify to mqtt
- Install
lampify
, the custom_temp branch. i.e. https://github.com/Justin8428/lampify/tree/custom_temp - Setup your lights using
lampify
. Remember the ID you use for each light, you will need to provide these IDs to lsp2mqtt - Manually add your lights to MQTT in HA. Use the .json schema and the light IDs must match the ones you provided to
lampify
earlier. See theexample_mqtt.yaml
example, replaceLIGHTID
with the ID you provided earlier. If you want to add more lights add a separate- light
entry in the yaml as described in the link. - Clone this repo and edit
config.yaml
to match your configuration - Run
main.py
If on debian, may need to install python3-paho-mqtt
and python3-yaml
, or create a venv
- Under
mqtt_broker:
, put the IP address and credentials for your MQTT broker - Under
light_ids:
, put the light IDs that you have paired with vialampify setup
and that you have added to HA. - Under
reversed_colour_ids:
, put the light IDs that have reversed colour temperatures. Leave this section blank if you don't need to reverse any IDs. Also, any IDs you put here must also be present underlight_ids:
otherwise it will be ignored.
If you are planning to run this as a systemctl service, you can provide a custom location for your config.yaml
as an argument.
e.g. python3 ~/lsp2mqtt/main.py "/path/to/config.yaml"
- Create the service file e.g.
nano /etc/systemd/system/lsp2mqtt.service
- Insert the following into the file (change the file path depending on what your username is)
[Unit]
Description=lsp2mqtt.service
After=multi-user.target
[Service]
Type=simple
Restart=always
ExecStart=/usr/bin/python3 /home/debian/lsp2mqtt/main.py "/home/debian/lsp2mqtt/config.yaml"
[Install]
WantedBy=multi-user.target
systemctl start lsp2mqtt
followed bysystemctl enable lsp2mqtt
- Create a systemctl service to start lsp2mqtt on boot. Set it to start after
multi-user.target
- Create a shell file to connect to the usbip. e.g.
sudo usbip attach -r "remote_ip" -b "port-id"
sudo hciconfig -a
- Register this shell file as a systemctl service, and enable to so it starts on boot. Also set it to start after multi-user.target
- Add
vhci-hcd
to the list of kernel modules to start at startup, located at/etc/modules-load.d/modules.conf