Nefit Easy / Buderus CT100

Begonnen von superbert, 05 April 2018, 00:04:15

Vorheriges Thema - Nächstes Thema

superbert

Hi all,

Since my German is not very good, I decided to write this post in English.

I've established a module (basically for my own use) to integrate the "Nefit-Easy". The module uses the nefit-easy http server of Robert Klepp (https://github.com/robertklep/nefit-easy-http-server), and assumes the server is running (has a session with the backend). The module is stable running for the last 2 weeks now in my configuration.

The module mainly supports the "Weather dependent controls", but can easily be extended by adding some more endpoints into the perl-hash "resources" in the beginning of the file.

What could or should be enhanced / completed:


  • Fetch and parse all endpoints from the backend (would be neat)
  • Use non-blocking http calls (didn't get it to work properly due to sending new requests before the answer was there)
  • Get this csrf thing in place (I didn't have time to get sufficient knowledge on this one)
  • Write the documentation

The module polls the endpoints at defined intervals (1 means every minute, 10 means every 10 minutes, etc; this is all configured in the perl-hash "resources". Be careful with scheduling to much updates at the same interval, as this will freeze FHEM temporarily (due to the blocking http calls).

Definition: define <name> NEFITEASY [host=<ip-adddres>[:<port-number>]] [base_url=<url>]

defaults:
host: 127.0.0.1:3000
base_url: /bridge

I hope some of you can use my module and have some fun with it!

R.

Eeg.

Mike_GKA

Hi,
I try to ask in English:
I'm the author of https://forum.fhem.de/index.php/topic,74483.0.html. So nefit-easy is running and I get the values with HTTPMOD.
Your solution seems to be more adequate than HTTPMOD.
I try to use your module but "reload 25_NEFITEASY" results into the error:
Can't locate REST/Client.pm in @INC (you may need to install the REST::Client module)

Do you know how to solve this?
Thanx in advance.

superbert

You have to install the perl modules (just type: "cpan REST::Client" and "cpan JSON::Parse")

Let me know if you need further help.

R. Eeg.

Mike_GKA

#3
Many thanx for the quick answer -> your module is now running on my raspberry!

Some additional questions:
Interval: I think (the default is 60) in seconds? Can we change the value, it is not a setting?
I missed "/bridge/ecus/rrc/recordings/yearTotal" or something similar to get the consumption

superbert

Interval is indeed an internal. You can change it in the code if you like. Readings can be added in the code also, just have a look (they are all defined in the beginning in a perl-hash)

superbert

Hi,

Since winter is coming...I have decided to invest some time in my piece of code --> It's now using a non-blocking HTTP-get (this is better for system-performance, as blocking-GET might lead to system freezes).

If I can find some more time in the future, I want to retrieve all of the endpoints automatically and make them available for selection by the user (to prevent having 100 unneeded readings). For now, one would still have to add endpoints in the module-code (hash in the beginning).

Don't forget to install perl modules:

  • REST::Client
  • JSON::Parse
  • List::Util

In case of any questions / issues, just let me know and I'll see what I can do (best effort!).

R.

Eeg.