License: MIT
This 'custom_component' provides you with a NHC2 Platform
It uses the pypi package nhc2-coco that I've written too.
LIMITED to switches/lights as it stands now
There a two setup methods. If you use HASS.IO Method 1 is recommended, as you need to change a file in HA to make Method 2 work (as it stands now)
- Add all the files inside a folder called
<CONFIG_FOLDER>/custom_components/nhc2/
- Add config to your
configuration.yaml file
example:
nhc2:
host: '192.168.0.2'
port: 8883
username: 'abcdefgh-ijkl-mnop-qrst-uvwxyz012345'
password: !secret nhc2_password
- Add all the files inside a folder called
<CONFIG_FOLDER>/custom_components/nhc2/
- Add 'nhc2' to the static list
FLOWS
inhomeassistant/config_entries.py
(this in until HA can auto populate this for custom components) - Create credentials (see next paragraph)
- Do the Niko Connected Controller setup in
Setting > Integrations
the Web Ui
see: Home Assistant dev docs - Integration Configuration
First you will need to setup a touchscreen profile to the controller setup. (see Creating and modifying touchscreen profiles) The password you enter there, will be the password you will need for the connection. The username is the ID this profile gets. There are 3 ways of extracting this information.
In a later version of the integration, I hope to make Method 3 automatic, so the user can select the profile from a dropdown in the Web UI
- The project file from the Niko software is a zip, extract it using your (un)zip tool of choice.
- Open the Config.sqlite with DB Browser for SQLite
- Go to tab 'Browse Data' and open the table called Profile
- Look for the CreationId that corresponds with the desired profile, that's the username
- Connect to the MQTT broker on the Connected Controller, on port 8883, using the CA cert you can find in the nhc2-coco GitHub Repo
- Subscribe to the topic
public/authentication/rsp
- Publish on topic
public/authentication/cmd
with payload{"Method":"profiles.list"}
- Extract the Uuid that corresponds with the desired profile
- Baisc configuration trough the integration UI
- NHC2 'light' as a HA Light (light connected to switch using a Basic Action)
- NHC2 'switched-generic' as a ha Switch (virtual output connected to switch using a Basic Action)
Q: When I restart HA with the custom component I get an error the nhc2-coco
dependency is missing.
A: Last time I got this, a second restart fixed it.
- Contribute to this project with constructive issues, suggestions, PRs, etc.
- Help me in any way to get support for more entities (eg dimmer)