So there is a freely pogrammable heating controller called UVR1611 by Technische Alternative. Recently I wanted to have its data displayed in Home Assistant (already accomplished that once via “UVR1611 Data Logger”). For that you need either the BLNET device or the CLI, in this case some scripts have been developed to assist integrating UVR data via a BLNET device.
For you as a home assistant user, add this folder in to your custom_components folder (resulting in custom_components/blnet/__init__.py etc):
And add these lines to your configuration.yaml:
# UVR1611 Data
blnet:
resource: your_blnet_address
password: optional_blnet_password
can_node: optional_can_bus_node
At the digital switches, is displayed if mode of digital output is set to “AUTO”, else showing [mdi:toggle-switch] / [mdi:toggle-switch-off]
If you are interested in developing that further feel free to contribute to either this component or the backend python script pyblnet.
EDIT: There was a major overhaul under the hood. Now customization is fully supported and digital outputs of the UVR1611 can be controlled. Yet from then on you have to create the groups yourself.
UPDATE: Since the integration layout in homeassistant changed a lot lately all files previously thought to be seperate are now included in one single blnet “package”. Now you only have to move one folder to your custom_components directory and you’re done! The description above was changed accordingly.
Of course, you are free to use this tool. But note that by now there are no switch-components for home assistant built yet. Also not a lot of testing has went into this so it may be wise to handle it with care and to look out for exceptions and errors.
Feel free to contact me (in German), there currently is no manual besided the one on this page.
I have some troubles getting this solution running. I have downloaded the 3 Files to my custom-components.
But I am not able to install PyBLNET. Not sure if I am doing it right, as I am completley new in this topic.
I have installed HomeAssistant on a Raspbian installation and so far it is working. To get the UVR1611 working I was doing the follwing:
sudo su -s /bin/bash homeassistant
source bin/activate
pip3 install PyBLNET
But I am getting the following error messages:
(homeassistant) homeassistant@homeassistant:/srv/homeassistant $ pip3 install PyBLNET
Collecting PyBLNET
Using cached https://files.pythonhosted.org/packages/6a/96/c8099b753360616fa3118a9894ca1bcc599f6725ba187fa12b457ccaea26/PyBLNET-0.4.1-py2.py3-none-any.whl
Collecting htmldom (from PyBLNET)
Using cached https://www.piwheels.org/simple/htmldom/htmldom-2.0-py3-none-any.whl
Requirement already satisfied: requests in ./lib/python3.5/site-packages (from PyBLNET)
Collecting html (from PyBLNET)
Using cached https://files.pythonhosted.org/packages/4a/df/0e3d22d50ee43274eb5116f49972a164d853bb3ab305a69a0540b6292252/html-1.16.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/srv/homeassistant/lib/python3.5/site-packages/setuptools/__init__.py", line 14, in <module>
from setuptools.dist import Distribution, Feature
File "/srv/homeassistant/lib/python3.5/site-packages/setuptools/dist.py", line 24, in <module>
from setuptools.depends import Require
File "/srv/homeassistant/lib/python3.5/site-packages/setuptools/depends.py", line 7, in <module>
from .py33compat import Bytecode
File "/srv/homeassistant/lib/python3.5/site-packages/setuptools/py33compat.py", line 11, in <module>
from setuptools.extern.six.moves import html_parser
File "/srv/homeassistant/lib/python3.5/site-packages/setuptools/_vendor/six.py", line 92, in __get__
result = self._resolve()
File "/srv/homeassistant/lib/python3.5/site-packages/setuptools/_vendor/six.py", line 115, in _resolve
return _import_module(self.mod)
File "/srv/homeassistant/lib/python3.5/site-packages/setuptools/_vendor/six.py", line 82, in _import_module
__import__(name)
ImportError: No module named 'html.parser'; 'html' is not a package
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-2nlh95py/html/
One step ahead, Now I am getting the following error, when starting home assistant:
2018-04-25 09:35:33 ERROR (MainThread) [homeassistant.setup] Error during setup of component blnet
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/setup.py", line 145, in _async_setup_component
component.setup, hass, processed_config)
File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
future.result()
File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
raise self._exception
File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/homeassistant/.homeassistant/custom_components/blnet.py", line 46, in setup
from pyblnet import BLNET, test_blnet
File "/srv/homeassistant/lib/python3.5/site-packages/pyblnet/__init__.py", line 13, in <module>
from test.test_binop import isint
ImportError: No module named 'test.test_binop'
2018-04-26 09:17:24 ERROR (Thread-7) [homeassistant.util.package] Unable to install package pyblnet==0.4.2: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-u5qv0930/html/
2018-04-26 09:17:24 ERROR (MainThread) [homeassistant.requirements] Not initializing blnet because could not install requirement pyblnet==0.4.2
2018-04-26 09:17:24 ERROR (MainThread) [homeassistant.setup] Setup failed for blnet: Could not install all requirements.
If you can tell me where those values arr shown in the web interface (i.e. navigating there through the node menue) I think this can be implemented. By default PyBLNET should parse all analogous anders digital in- answer outputs.
This is not yet supported. The digital sensors would have to be represented by a input with three values instead of a switch, I already thought about implementing this.
Ad 1:
As far as I know the UVR1611 supports 2 frames on the CAN Bus, each frame supports 16 analog and 16 digital ports, but also 4 speed, 2 power and 2 energy ports.
I have now another issue: It is running perfectly on my Raspberry, but I wanted to move now Home Assistant to my UnRaid Server with a Home-Assistant Docker.
I downloaded the files and stored them into a custom_components directory.
What I was not sure is on how I should install html and byblnet. Do I do this in the main Linux or somehow within the docker?
I did it on the main Linux (same for a different component as well, this one is working) but when I start home assistant I am getting the following error:
2018-05-10 08:20:46 ERROR (SyncWorker_4) [homeassistant.util.package] Unable to install package pyblnet==0.4.2: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-goivl1cr/html/
2018-05-10 08:20:46 ERROR (MainThread) [homeassistant.requirements] Not initializing blnet because could not install requirement pyblnet==0.4.2
2018-05-10 08:20:46 ERROR (MainThread) [homeassistant.setup] Setup failed for blnet: Could not install all requirements.
Installed byblnet:
root@UnRaid:/mnt/user/appdata# pip3 install pyblnet==0.4.2
Requirement already satisfied: pyblnet==0.4.2 in /usr/lib64/python3.6/site-packages
Requirement already satisfied: requests in /usr/lib64/python3.6/site-packages (from pyblnet==0.4.2)
Requirement already satisfied: htmldom in /usr/lib64/python3.6/site-packages (from pyblnet==0.4.2)
Requirement already satisfied: html in /usr/lib64/python3.6/site-packages (from pyblnet==0.4.2)
Requirement already satisfied: idna<2.7,>=2.5 in /usr/lib64/python3.6/site-packages (from requests->pyblnet==0.4.2)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/lib64/python3.6/site-packages (from requests->pyblnet==0.4.2)
Requirement already satisfied: certifi>=2017.4.17 in /usr/lib64/python3.6/site-packages (from requests->pyblnet==0.4.2)
Requirement already satisfied: urllib3<1.23,>=1.21.1 in /usr/lib64/python3.6/site-packages (from requests->pyblnet==0.4.2)
Installed html:
root@UnRaid:/mnt/user/appdata# pip3 install html==1.0
Requirement already satisfied: html==1.0 in /usr/lib64/python3.6/site-packages
You have to install the PyBLNET package inside the docker, inside the virtual environment of home assistant (if there is none, simply inside the docker).
Although the logs you included show that PyBLNET was successfully installed somewhere in the docker, it is not the directory that home assistant accesses.
The only explanation I can think of is that there is a venv. If there is a python virtual environment around your home assistant installation try to install PyBLNET there. (cd /srv/homeassistant; source bin/activate; pip install PyBLNET==0.4.2)