Nefit easy client

Please don‘t try to install the component at the moment if you are not 100% sure what to do.
I‘m in the process of a total rewrite that‘s easier to install and will hopefully later get integrated into Home Assistant. Unfortunately I don‘t have a lot freetime right now, so it will take some more time.

1 Like

Ahh that sounds great! Is there something i can do to help?

Ah that was also on my todo list. Are you going to make it async?

Yes, a basic async version is already working:


Unfortunately the documentation on how to write a good async component is not very extensive.

1 Like

That depends, if you are experienced in async Python and/or looked into the Bosch/Nefit protocol :slight_smile:

Actualy already knew the answer on my own question.
I’m a total newbie at this stuff. Totally depending on guys like you with the great work :zipper_mouth_face:

You said it was working, but for me it won’t connect.
This is the last event in the log:
[custom_components.climate.nefit] Waiting for connected event

I’m trying to debug now, but this async stuff is also new for me.

edit:
I found that self._client.connect() was never called. Now it works!!

For the people who also want this to work, add that on line 83 in nefit.py

    self._client = NefitCore(serial_number=serial,
                   access_key=accesskey,
                   password=password,
                   message_callback=self.parse_message)
    self._client.connect()

Ah, sorry. The latest version of the library is not compatible with the component. I plan to implement a reconnect mechanism if a connection at startup of ha was not successful (happens to me quite often).

1 Like

Tried what was wrote in here: https://github.com/marconfus/ha-nefit-ng

Very easy steps, but still no climate. entity in HA :frowning:

Saw that you already added the code from kysa.

Thanks for all the work!

The component should work now without any further modification. It’s been tested in hass.io and a standalone installation.
Make sure, that the custom_components folder is next to the configuration.yaml file.

To see more, modify the loglevel. In the configuration.yaml look for the logger component, if it’s not there add it. It should look something like this:

    logger:
      default: info

Restart Home Assistant and look into the logfile. You can also access the logfile via the “About” page in the configuration menu.
There you search for the term “climate”. You should find something like:

2019-01-23 21:27:20 INFO (MainThread) [homeassistant.loader] Loaded climate from homeassistant.components.climate
2019-01-23 21:27:20 INFO (MainThread) [homeassistant.loader] Loaded climate.nefit from custom_components.climate.nefit
2019-01-23 21:27:20 WARNING (MainThread) [homeassistant.loader] You are using a custom component for climate.nefit which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2019-01-23 21:27:20 INFO (MainThread) [homeassistant.setup] Setting up climate
...
2019-01-23 21:27:21 INFO (MainThread) [homeassistant.setup] Setup of domain climate took 1.4 seconds.

As it doesn’t work for you, copy every line that contains the term “climate” and post them here.

For your reference: I just tried and got it working over here. At first it didn’t but I had another home assistant instance running on a Raspberry PI that conflicted. It seems like only one login per account is allowed access.

Now it’s working!

Just moved the code in the configuration.yaml to another place and it’s working!
Thank you so mutch, this was the last piece of my smarthome puzzle :smiley:

Finaly the thermostat working haha :sunglasses:

During development I’m running two instances at once all the time. I never encountered a problem there.
If there is a problem, please always look into the logfile. You should find a hint there.
My main problem is that the thermostat quite often loses the wifi connection. This can be checked with the official app, which then cannot connect either.

I guess there was a space missing or to many. YAML isn’t the most easy of all configuration formats :slight_smile:

I tried the new bosch setup. Since the new nefit.py file … but since this change the status isn’t available anymore… There is no such status as: heating. Do you know how I can get this back? because this status is giving my floorpump an action to go on as the nefit is heating :wink:

I added a quick fix. There is now the raw value in the state attribute boiler_indicator_raw
It should be:
No - off
CH - central heating
HW - hot water

Is there a way to faster update the status. It could take up a minute before the climate is truly set by home assistant right now.? Also when I turn up the heating … it takes mostly of the time 1 minute before the temperature is updated in home assistant.

The state in HA is updated every 30s. This can be configured:

Setting a new temperature should happen instantly. If it’s not there is something wrong. The network connection of my device is quite instable so perhaps it’s also some wifi problem.

Yeah it’s quite unstable still. The problem is at the Nefit side, since the app also won’t work often. I’m not sure the reconnection mechanism of the new component is working properly, but maybe I was running an older version. Maybe I just needed a restart.

When connection is fine, setting a temperature is very quick :slight_smile:

There isn’t really a reconnection mechanism. The system is based on XMPP (normally used for chatting). I send the command “give me the data” into the “chat room” and then wait for an answer of the thermostat. Sometimes there just doesn’t comes no answer back. You can’t say if it’s because of the Bosch servers or the local thermostat.
Unfortunately there is no way to talk to the thing directly. That would be much better…

The rewritten component just uses async Python. So Home Assistant can do other stuff while we wait for an answer and the chaos isn’t so big if there isn’t one. It’s just a timeout in the log.
(And it uses a forked version of the XMPP library which isn’t as broken as the not-async one)

I have added a ping sensor:


So I can monitor if the device is even connected to the homenetwork.