Giter VIP home page Giter VIP logo

lsp2mqtt's Introduction

lsp2mqtt

lampify to mqtt

Quick Setup Guide

  • 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 the example_mqtt.yaml example, replace LIGHTID 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

config.yaml setup

  • 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 via lampify 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 under light_ids: otherwise it will be ignored.

arguments for config file

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"

Extra instructions for running as a systemd service

  • 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 by systemctl enable lsp2mqtt

Extra instructions for auto-start if your bluetooth dongle is connected over usbip

  1. Create a systemctl service to start lsp2mqtt on boot. Set it to start after multi-user.target
  2. Create a shell file to connect to the usbip. e.g.

sudo usbip attach -r "remote_ip" -b "port-id"

sudo hciconfig -a

  1. 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
  2. Add vhci-hcd to the list of kernel modules to start at startup, located at /etc/modules-load.d/modules.conf

lsp2mqtt's People

Contributors

justin8428 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.