Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


Nefit Easy thermostat VD 1.0.0

   (0 reviews)

2 Screenshots

About This File

A virtual device to interface with the Nefit Easy thermostat. First credits where credits are due: this VD leverages  the cool stuff made by Robert Klep.So what you need is to

  1. Install the nefit-easy-http-server developed by robertklep (see https://github.com/robertklep/nefit-easy-http-server) on another device. I use a raspberry pi. Follow the instructions on the site and check if the server is working properly
  2. Install the virtual device you can download here
  3. Add the IP address of the device where you run the nefiteasy server in the advanced setting of the VD
  4. Same for the port (standard setting of the server is 3000)
  5. You can use the icon provided if you like :-)
  6. I use the two buttons at the bottom of the VD to lower the temperature when I am away (trigerred by a scene), and go back to the normal clock program when I'm back home
  7. By inspecting the code in the VD I guess you can see how you can read and write data to the server. There are many more info and settings you can extract or change from the server (see https://github.com/robertklep/nefit-easy-core/wiki/List-of-endpoints for the list of endpoints you can use). These are the ones I picked but I assume you understand how to change to your needs

 

Rene.


Other Files from ReneNL


User Feedback

Recommended Comments

Hi ReneNL, followed all steps and everything seems running fine (Balk77 docker on Synology, no errors and seems to run fine). Debugging the VD in HC2 shows "Error : Cannot connect to the web server, status=, errocode=2" ... now my inexperience with httpsservers/dockers/VD's comes  visible... any clue, hint or approach to solve and fix?

Link to comment
Share on other sites

Hi ReneNL, followed all steps and everything seems running fine (Balk77 docker on Synology, no errors and seems to run fine). Debugging the VD in HC2 shows "Error : Cannot connect to the web server, status=, errocode=2" ... now my inexperience with httpsservers/dockers/VD's comes  visible... any clue, hint or approach to solve and fix?

 

Update1

- found out that error most likely is in runnign docker... error 2  = oci runtime error : exec failed: 

Link to comment
Share on other sites

Sorry, I don't have experience with running it on Docker (I run it on a raspberry pi). Maybe you can find some answers on the nefit-easy-http-server github page?

Link to comment
Share on other sites

Hi @ReneNL

Thanks for this VD. I have the Nefit server running on my Raspberry Pi 3 with Homebridge but can't get the VD to work. When I debug the main loop I get this:

 

[DEBUG] 22:39:03: Error : Can not connect to Web server, status=, errorCode=2
 

In the 2 screenshots you can see my settings. I have also tried with port 8080 and 51826 but than I get other errors. Hope you can see what is wrong.

 

Thank you in advance:-D

Schermafbeelding 2019-05-25 om 22.50.02.png

Schermafbeelding 2019-05-25 om 22.50.17.png

Edited by kevin
Link to comment
Share on other sites

Hi Kevin,

 

Can you check if your nefit server is running properly? Please use your webbrowser to go to http://192.168.0.212:3000/api/status Do you get a response similar to below?

 

{"user mode":"clock","clock program":"auto","in house status":"ok","in house temp":20,"hot water active":true,"boiler indicator":"off","control":"room","temp override duration":0,"current switchpoint":1,"ps active":false,"powersave mode":false,"fp active":false,"fireplace mode":false,"temp override":false,"holiday mode":false,"boiler block":null,"boiler lock":null,"boiler maintenance":null,"temp setpoint":19.5,"temp override temp setpoint":18,"temp manual setpoint":18.5,"hed enabled":null,"hed device at home":null,"outdoor temp":17,"outdoor source type":"virtual"}
Link to comment
Share on other sites

6 hours ago, ReneNL said:

Hi Kevin,

 

Can you check if your nefit server is running properly? Please use your webbrowser to go to http://192.168.0.212:3000/api/status Do you get a response similar to below?

 


{"user mode":"clock","clock program":"auto","in house status":"ok","in house temp":20,"hot water active":true,"boiler indicator":"off","control":"room","temp override duration":0,"current switchpoint":1,"ps active":false,"powersave mode":false,"fp active":false,"fireplace mode":false,"temp override":false,"holiday mode":false,"boiler block":null,"boiler lock":null,"boiler maintenance":null,"temp setpoint":19.5,"temp override temp setpoint":18,"temp manual setpoint":18.5,"hed enabled":null,"hed device at home":null,"outdoor temp":17,"outdoor source type":"virtual"}

 

Thank you for the quick response^_^

That sadly didn't work. I started over and installed Homebridge again, everything is up to date. Now I'm using the terminal in Homebridge and installing the nefit-easy-http-server is completed without issues. Now when I want to enter stuff like SERIAL with code easy-server --serial=81992xxxx I get and error about a missing password.

I followed the instructions from https://www.npmjs.com/package/nefit-easy-http-server. Any ideas?

 

Schermafbeelding 2019-05-26 om 21.21.19.png

Edited by kevin
Link to comment
Share on other sites

You need to start the server by including the serial number, access key and password. You will find them on the back of your easy thermostat:

 

easy-server –-serial=XXXXX –-access-key=XXXXX –-password=XXXXX

 

Hope this helps, Rene.

Link to comment
Share on other sites

I got it working, whoop whoop:-D

 

In this command I needed to add the red part

easy-server –-serial=XXXXX –-access-key=XXXXX --host=192.168.0.212 –-password=XXXXX

 

But how can I be sure that the server is always online. Now when I close the terminal in Homebridge the server is offline. 192.168.0.212:3000/api/status is also not working. I need to typ the whole line with serial number, accesskey and password again in the terminal and then it's up and running until I close the terminal.

 

Edited by kevin
Link to comment
Share on other sites

Hi @kevin, great you got it working!

 

There are many ways to start a script/server/program at boot, see for example this link https://www.dexterindustries.com/howto/run-a-program-on-your-raspberry-pi-at-startup/

 

An easy way is to open a terminal on your pi, type:

sudo crontab -e

Add the following line at the bottom of the file:

@reboot sudo easy-server –-serial=XXXXX –-access-key=XXXXX --host=192.168.0.212 –-password=XXXXX

Save and close the file and reboot, should work now (without homebridge needed)

 

Let me know if it works for you.

 

Best, Rene. 

  • Thanks 1
Link to comment
Share on other sites

Hi @ReneNL

 

That solved it, many thanks. Only I try to change the VD icon but it keeps switching back to the blue VD icon everything new data from the http-server is send to the VD. Any idea how to solve this? I only happens with this VD with other I can change the icon without issues

 

Edited by kevin
Link to comment
Share on other sites

Great!

 

Can you try and delete line 79 from the main loop (at the very bottom of the 'advanced' tab), it's the line with the following code: fibaro:call(selfId, "setProperty", "currentIcon", "1001")

 

I had added this line as my icon also disappeared in previous versions (bug or something), so I added this line to get it back every time it runs. Hope it works without this line. If not, please add it back but change the icon number ("1001") to the actual icon number on your system. You can find this by using Chrome as browser, right-click the icon in HC2 and select 'inspect'.

 

Hope this helps, Rene.

  • Thanks 1
Link to comment
Share on other sites

Thanks @ReneNL

I have changed the icon number with the help of the icon preview VD from Sankotronic. I also translated somethings to dutch and added a few buttons to change the temperature. 

 

Thanks you very much:-D for all the help with this VD, I really needed that for better understanding.

Link to comment
Share on other sites

Hi @ReneNL

 

It worked great, until this week. The VD still communicates with the server(Raspberry Pi) but the buttons don't work.

When I type in the browser http://192.168.0.213:3000/api/status I get the response with all information as it should be, so that works. 

I get the error below.

[DEBUG] 15:00:44: Tcp write OK, 142 bytes

 

[DEBUG] 15:00:44: HTTP/1.1 500 INVALID_RESPONSE X-Powered-By: Express Access-Control-Allow-Origin: * Content-Type: text/html; charset=utf-8 Content-Length: 1464 ETag: W/"5b8-W3cpcsTwl6Iy76o199aEeKBJl4c" Date: Thu, 11 Jul 2019 13:00:44 GMT Connection: keep-alive Error: INVALID_RESPONSE at send.then.response (/usr/local/lib/node_modules/nefit-easy-http-server/node_modules/nefit-easy-core/lib/index.js:247:23) at tryCatcher (/usr/local/lib/node_modules/nefit-easy-http-server/node_modules/bluebird/js/release/util.js:16:23) at Promise._settlePromiseFromHandler (/usr/local/lib/node_modules/nefit-easy-http-server/node_modules/bluebird/js/release/promise.js:517:31) at Promise._settlePromise (/usr/local/lib/node_modules/nefit-easy-http-server/node_modules/bluebird/js/release/promise.js:574:18) at Promise._settlePromise0 (/usr/local/lib/node_modules/nefit-easy-http-server/node_modules/bluebird/js/release/promise.js:619:10) at Promise._settlePromises (/usr/local/lib/node_modules/nefit-easy-http-server/nod
[DEBUG] 15:00:45: Tcp write OK, 148 bytes

[DEBUG] 15:00:45: e_modules/bluebird/js/release/promise.js:699:18) at _drainQueueStep (/usr/local/lib/node_modules/nefit-easy-http-server/node_modules/bluebird/js/release/async.js:138:12) at _drainQueue (/usr/local/lib/node_modules/nefit-easy-http-server/node_modules/bluebird/js/release/async.js:131:9) at Async._drainQueues (/usr/local/lib/node_modules/nefit-easy-http-server/node_modules/bluebird/js/release/async.js:147:5) at Immediate.Async.drainQueues [as _onImmediate] (/usr/local/lib/node_modules/nefit-easy-http-server/node_modules/bluebird/js/release/async.js:17:14) at runCallback (timers.js:705:18) at tryOnImmediate (timers.js:676:5) at processImmediate (timers.js:658:5)

 

 

I have rebooted everything but sadly that doesn't fix it.

 

Kevin

Edited by kevin
Link to comment
Share on other sites

@kevin, very weird. I just tested mine, and it still works (I'm on HC2 version 4.543b)

 

Can you try if the POST request you want to invoke through the button / VD works outside of the HC2? See https://github.com/robertklep/nefit-easy-http-server for some example POST request using curl in command/terminal window:

curl -XPOST http://192.168.0.213:3000/bridge/heatingCircuits/hc1/temperatureRoomManual -d '{"value":20}' -H 'Content-Type: application/json'

Weird...

 

Rene.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...