NIBE Uplink API component (non S-series)

I have done several test, with FQDN, ports, http, https and certificates. The only conclusion that I can find is that it works on Hassio when the “custom_components” folder is located in “config” folder in the Samba share.
On Hassbian I have created the mentioned folder in the “homeassistant” Samba share (/home/homeassistant/.homeassistant/) and it’s not working on Hassbian, is there anything in the config files downloaded that have the path hard coded?

Both installations are accessible from internet over https, Hassio continued to work even after adding https (updated the app at NIBE with new callback URL) so https doesn’t seems to be the cause.

Same error every time:
An error occured: <class ‘oauthlib.oauth2.rfc6749.errors.MissingCodeError’>

No. There are no hard coded paths. I suppose you could test my WIP branch named “module” . It’s a bit tricker to install thou since you need a separate python module.

1 Like

How/where do I find that?

It’s same place but in a branch: https://github.com/elupus/hass_nibe/tree/module notes follows

@Johan_Nolen the url you pasted is wrong. You need to paste the local url after nibe uplink has redirected you. See nords comment earlier. You press the link in the config screen, login to nibe uplink, it will redirect you to your local rediret url (may very well be something your browser can’t reach, or your home assistant screen), copy that complete url into the config screen.

Notes for new module should anybody want to give it a try:
git clone https://github.com/elupus/hass_nibe.git custom_components
cd custom_components
git checkout -b module origin/module

Read the readme.md file since config has new needs (you can read that on the top link).

Ps. It now has some rudimentary climate module with theoretical write access. However you NEED premium nibe account for it to work (i don’t have so i haven’t been able to verify it at all)

Ok, will try it out.
Even with below URL the standard setup doesn’t work:

https://api.nibeuplink.com/oauth/authorize?response_type=code&client_id=XXXXXXXXXXXXXX&redirect_uri=http%3A%2F%2Flocalhost%3A18123&scope=READSYSTEM&state=ZZZZZZZZZZZZZZZZZZZZZZZZ

So, do I follow this:
pip install git+https://github.com/elupus/nibeuplink.git

or this:
git clone https://github.com/elupus/hass_nibe.git custom_components
cd custom_components
git checkout -b module origin/module

or both?

not being that “high tech” in Linux…

I have downloaded the ZIP-file, extracting the content to “custom_components” (or in my case “homeassistant” share on Hassbian).

After updating to hassbian 0.57.2 i cant see my nibe anymore only get:

Invalid config

The following components and platforms could not be set up:

nibe

Please check your config.

Nibe i s a link and clicking gets me this :slight_smile:404

File not found

The site configured at this address does not contain the requested file.

If this is your site, make sure that the filename case matches the URL.
For root URLs (like http://example.com/) you must provide an index.html file.

Read the full documentation for more information about using GitHub Pages.
GitHub Status — @githubstatus

I tried starting over but same result i even flashed my sd card so i started fresh. What should i do?

Again that is not the URL u are supposed to enter in the config screen.

The URL should be the one you get redirected to, after you press the ok/authorize button at nibe uplink, even if it’s a 404 unreachable.

It should look somehing like http://localhost:8123/?code=

@Johan_Nolen use the normal one, not the new version if you don’t understand those instructions.

You need to look at the log to see what might be wrong.

Ahhhh…

So the URL after the verification on Nibe webpage, got it!
Now it’s working with “master” version.

The new “module” will give write access as well, any further differences?

The new version is just about completely rewritten to be async. But almost no new features apart from the climate platform with potential update support.

It’s closer to okey to merge into standard Hass, that is the main reason for the rewritten

logg?? where can i find it. im real new to this.

found something.

2017-11-12 13:44:36 ERROR (MainThread) [homeassistant.setup] Error during setup of component nibe
Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/setup.py”, line 194, 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/nibe.py”, line 85, in setup
hass.data[DOMAIN] = NibeUplink(hass, config)
File “/home/homeassistant/.homeassistant/custom_components/nibe.py”, line 109, in init
from requests_oauthlib import OAuth2Session
File “/srv/homeassistant/lib/python3.5/site-packages/requests_oauthlib/init.py”, line 9, in
if requests.version < ‘2.0.0’:
TypeError: unorderable types: module() < str()

downgraded to 0.56.2 and it works again

Seems other are affected by similar bug

1 Like

Can anyone verify that this works with 0.60.0 ?

I would love to use this, but I’m getting a lot of errors:

Error during setup of component nibe
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/setup.py", line 193, 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/nibe.py", line 85, in setup
    hass.data[DOMAIN] = NibeUplink(hass, config)
  File "/home/homeassistant/.homeassistant/custom_components/nibe.py", line 109, in __init__
    from requests_oauthlib import OAuth2Session
  File "/srv/homeassistant/lib/python3.5/site-packages/requests_oauthlib/__init__.py", line 9, in <module>
    if requests.__version__ < '2.0.0':
TypeError: unorderable types: module() < str()

I will not update the current master branch anymore. Please use the branch named module and reread the Readme.

Sorry about that. Thank you for pointing me in the right direction.

I installed the module instead and ran:
pip install git+https://github.com/elupus/nibeuplink.git

but I am getting:

Unable to install package nibeuplink==0.2.0: Could not find a version that satisfies the requirement nibeuplink==0.2.0 (from versions: )
No matching distribution found for nibeuplink==0.2.0

Hmm must have forgot to push something.