This is an integration for Home Assistant. It provides a user interface for setting up and using ur SmartKnob with Home Assistant.
This is an integration for Seedlabs.it´s SmartKnob. It allows for usage and setup of multiple SmartKnobs with Home Assistant. Through an easy to use user interface. The hardware is inspired by scottbez1´s SmartKnob project, but its functionalities are substantially different, as such, Scott's knob is not compatible with this project.
- Control and setup single SmartKnob
- No yaml or automation setup neccessary all configurable from UI
Click to show installation instructions for Home Assistant
Easiest install is via HACS:
HACS -> Integrations -> Three dots in the top right corner -> Custom repositories -> Add:
Notes:
- HACS does not "configure" the integration for you. You must go to
Configuration -> Integrations
and addSmartKnob
after installing via HACS. - The
mqtt
integration must be installed and configured in order for theSmartKnob
integration to work. As manual configuration is required for themqtt
setup, this cannot happen automatically.
For manual installation for advanced users, copy custom_components/smartknob
to
your custom_components
folder in Home Assistant.
Instructions on how to update will eventually be available here
Click to show instructions for setting up ur Development Environment
If you are interestd in developing Home Assistant's SmartKnob Integration you will need three things:
- A working version of Home Assistant Core. We will use a local dockerized version.
- A MQTT Broker. We will use Mosquitto
- This repo, checked out locally, and all the building tools needed to compile it.
Pre-requirements
- Install Docker Desktop. Alternatively you can install docker, and make sure it's linked in your shell enviroment.
- We will be using Microsoft Visual Studio Code as the IDE of choice.
- Install Yarn . You will need it to compile the UI in this integration.
Set-up
-
**INSTALL HOME ASSISTANT CORE**. Follow the instructions to install Home Assistant Core This will setup a local dockerized version of Home Assistant Core. A Visual Studio projet will also be initialized based on the clone Home Assistant Core repo.
From Visual Studio menu select Terminal -> Run Task -> Run Home Assistant Core to start your docker instance of Home Assistant.
You should now be able to see the instance running in Docker Desktop or by running
doker ps
-
**MQTT BROKER**: We recommend Mosquitto.
Once installed, you can start the broker, with something along those lines :
/usr/local/opt/mosquitto/sbin/mosquitto -c /usr/local/etc/mosquitto/mosquitto.conf
. By default, Mosquitto runs unencrypted and unauthenticated. You can test the installation and ensure the server is running successfully by typing on a new terminal windowmosquitto_sub -t topic/state
to subscribe to a new topic/state, and in a third window, send a message by typingmosquitto_pub -t topic/state -m "Hello World"
- **SETUP INTEGRATION CODEBASE**. Checkout this codebase. [TODO] include here all the comments that are needed to compile the code.
-
**UPDATE HOME ASSISTANT WITH THE SmartKnob INTEGRATION**.
- This repository generates a custom components, that needs to be moved to the home assistant running instance.
To do so, you can type from command line
docker cp path_to/smart-knob-home-assistant-integration/custom_components docker_name_instance:/workspaces/core/config
, where docker name instance is the identifier that docker uses when booting a new image. This command will copy the content of the custom_components folder in this repo to the dockerized home assistant instance.-
Restart home assitant. From Visual Studio menu select Terminal -> Run Task -> Run Home Assistant Core to restart your instance.
- Login to home assistant (usually available at
http://localhost:8123/
). Go to Settings -> Devices and Services, and from the Integrations Tab, press the button 'Add Integration'. Select MQTT from the list, and when prompted use the following informations:host: host.docker.internal
(or the ip of the machine where the MQTT broker is running) andport: 1883.
(or the custom port used by the MQTT broker)-
From Setting -> Device and Services, select the tab Devices, and press the
Add Device
button. From the list selectSmartKnob
-
On the main menu on the right, you should see a new item called 'SmartKnob'.
- Done!
- You have now everything you need to start developing for this integration.