FHEM Forum

FHEM => Codeschnipsel => Thema gestartet von: superbert am 05 April 2018, 00:04:15

Titel: Nefit Easy / Buderus CT100
Beitrag von: superbert am 05 April 2018, 00:04:15
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 (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:


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.
Titel: Antw:Nefit Easy / Buderus CT100
Beitrag von: Mike_GKA am 21 Juni 2018, 12:02:37
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.
Titel: Antw:Nefit Easy / Buderus CT100
Beitrag von: superbert am 21 Juni 2018, 13:09:12
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.
Titel: Antw:Nefit Easy / Buderus CT100
Beitrag von: Mike_GKA am 21 Juni 2018, 13:50:34
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
Titel: Antw:Nefit Easy / Buderus CT100
Beitrag von: superbert am 21 Juni 2018, 18:07:04
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)
Titel: Antw:Nefit Easy / Buderus CT100
Beitrag von: superbert am 21 September 2018, 12:35:05
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:

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

R.

Eeg.