Page 7 of 37

Re: Nefit Easy™ client library (How to install on the Pi)

Posted: Wednesday 06 January 2016 22:12
by renebiemans
you have to stop node-red first before you can issue that command.

sudo ps -ef | grep node
sudo /etc/init.d/nodered stop
node -v
(VERSIE 0.10.4 OID ZOU ER MOETEN STAAN)
wget https://nodejs.org/dist/v5.3.0/node-v5. ... v7l.tar.gz
tar -xvf node-v5.3.0-linux-armv7l.tar.gz
cd node-v5.3.0-linux-armv7l
sudo cp -R * /usr/local/
node -v
(VERSIE 5.3.0 ZOU ER MOETEN STAAN)
I have done this now. Now I don't have an error with the CP command but when I do node-v I get: segmentation fault.

Re: Nefit Easy™ client library (How to install on the Pi)

Posted: Thursday 07 January 2016 8:44
by pepijn
I published the node on NPMjs so for installation use:

Code: Select all

sudo npm install -g node-red-contrib-nefit-easy

Nefit Easy™ client library (How to install on the Pi)

Posted: Thursday 07 January 2016 12:50
by pepijn
Doler wrote:
rostyk wrote:@pepijn
i got once per hour a error with crash of node-red:

Code: Select all

Error: read ECONNRESET
    at exports._errnoException (util.js:870:11)
    at TLSWrap.onread (net.js:544:26)
looks like connection are closed (dropped by nefit easy) after a 40-50 minutes.

i will report after clean reinstall (probably caused by mine changes in a code)
I have the same problem, 7 minutes after a restart of red-node

Code: Select all

6 Jan 17:26:26 - [red] Uncaught Exception:
6 Jan 17:26:26 - Error: read ECONNRESET
    at exports._errnoException (util.js:855:11)
    at TLSWrap.onread (net.js:544:26)
Mark

Should be fixed in the new version:

Upgrade:

Code: Select all

sudo npm un -g node-red-contrib-nefit-easy
sudo npm i -g node-red-contrib-nefit-easy
sudo service nodered restart

Re: Nefit Easy™ client library (How to install on the Pi)

Posted: Thursday 07 January 2016 16:39
by Doler
pepijn wrote: Should be fixed in the new version:

Upgrade:

Code: Select all

sudo npm u -g node-red-contrib-nefit-easy
sudo npm i -g node-red-contrib-nefit-easy
sudo service nodered restart
Thanks for the solution but you have to help me once more before I can test. Before I saw your message I decided to do a new install on a saved image since I felt a little uncertain on all try-and-error of last few days.

So I started with updating nodejs:

Code: Select all

sudo ps -ef | grep node
sudo service nodered stop
node -v
wget https://nodejs.org/dist/v5.3.0/node-v5.3.0-linux-armv7l.tar.gz
tar -xvf node-v5.3.0-linux-armv7l.tar.gz
cd node-v5.3.0-linux-armv7l
sudo cp -R * /usr/local/
node -v
sudo service nodered start
Then updated node-RED:

Code: Select all

sudo npm cache clean
sudo npm install -g --unsafe-perm node-red
Installed nefit-easy-client:

Code: Select all

sudo npm i nefit-easy-client -g
Then installed nefit-easy node:

Code: Select all

sudo npm i -g node-red-contrib-nefit-easy
sudo service nodered restart
Imported your example script and added necessary nefit easy and device data. After deploying the script the only debug messages I get is "Error: REQUEST_TIMEOUT".
What did I forget? How can I check what is missing?

Thanks, Mark

Re: Nefit Easy™ client library (How to install on the Pi)

Posted: Thursday 07 January 2016 16:48
by pepijn
Doler wrote:
pepijn wrote: Should be fixed in the new version:

Upgrade:

Code: Select all

sudo npm u -g node-red-contrib-nefit-easy
sudo npm i -g node-red-contrib-nefit-easy
sudo service nodered restart
Thanks for the solution but you have to help me once more before I can test. Before I saw your message I decided to do a new install on a saved image since I felt a little uncertain on all try-and-error of last few days.

So I started with updating nodejs:

Code: Select all

sudo ps -ef | grep node
sudo service nodered stop
node -v
wget https://nodejs.org/dist/v5.3.0/node-v5.3.0-linux-armv7l.tar.gz
tar -xvf node-v5.3.0-linux-armv7l.tar.gz
cd node-v5.3.0-linux-armv7l
sudo cp -R * /usr/local/
node -v
sudo service nodered start
Then updated node-RED:

Code: Select all

sudo npm cache clean
sudo npm install -g --unsafe-perm node-red
Installed nefit-easy-client:

Code: Select all

sudo npm i nefit-easy-client -g
Then installed nefit-easy node:

Code: Select all

sudo npm i -g node-red-contrib-nefit-easy
sudo service nodered restart
Imported your example script and added necessary nefit easy and device data. After deploying the script the only debug messages I get is "Error: REQUEST_TIMEOUT".
What did I forget? How can I check what is missing?

Thanks, Mark
Try to remove and reinstall node-red-contrib-nefit-easy. There was an issue with earlier versions.

Re: Nefit Easy™ client library (How to install on the Pi)

Posted: Thursday 07 January 2016 17:04
by Doler
pepijn wrote: Try to remove and reinstall node-red-contrib-nefit-easy. There was an issue with earlier versions.
Did that and it's looking far better now (happy that it wasn't me :) ). Still getting occasional errors 'REQUEST_TIMEOUT' but also success messages. Hopefully that can be fixed too. In the mean time I keep it up and see if it will stay connected.

Thanks again, Mark

Re: Nefit Easy™ client library (How to install on the Pi)

Posted: Thursday 07 January 2016 17:08
by pepijn
The new error handling in the library generate these errors. Right now I use a static timeout setting, this will be modified in a future version.

Re: Nefit Easy™ client library (How to install on the Pi)

Posted: Thursday 07 January 2016 20:37
by mvveelen
Hi guys, just following this thread and hoping there will be something I could use on my Synology NAS. I'm not using Domoticz anymore on the RPi, but really want to integrate my Nefit Easy in Domoticz. Wishful thinking perhaps, but a guy can dream right :D ?

Re: Nefit Easy™ client library (How to install on the Pi)

Posted: Thursday 07 January 2016 20:46
by pepijn
mvveelen wrote:Hi guys, just following this thread and hoping there will be something I could use on my Synology NAS. I'm not using Domoticz anymore on the RPi, but really want to integrate my Nefit Easy in Domoticz. Wishful thinking perhaps, but a guy can dream right :D ?
What about my suggestion on Tweakers? Run Node-RED on your Pi? Maybe there's also a nodejs package for Synology

https://www.synology.com/en-us/dsm/app_packages/Node_js

Re: Nefit Easy™ client library (How to install on the Pi)

Posted: Thursday 07 January 2016 21:43
by Holland
Pepijn.

Got the uninstall working by adding the letter n. npm version 3.3.12


sudo npm un -g node-red-contrib-nefit-easy

Re: Nefit Easy™ client library (How to install on the Pi)

Posted: Thursday 07 January 2016 21:45
by pepijn
Holland wrote:Pepijn.

Got the uninstall working by adding the letter n. npm version 3.3.12


sudo npm un -g node-red-contrib-nefit-easy
Oeps... Thanks for correcting my typo

Re: Nefit Easy™ client library (How to install on the Pi)

Posted: Thursday 07 January 2016 22:32
by mvveelen
pepijn wrote:
mvveelen wrote:Hi guys, just following this thread and hoping there will be something I could use on my Synology NAS. I'm not using Domoticz anymore on the RPi, but really want to integrate my Nefit Easy in Domoticz. Wishful thinking perhaps, but a guy can dream right :D ?
What about my suggestion on Tweakers? Run Node-RED on your Pi? Maybe there's also a nodejs package for Synology

https://www.synology.com/en-us/dsm/app_packages/Node_js
There isn't a package with the right version, but I installed it manually and can use the deprecated script. So maybe I'm nearly there already ?
This "Node-RED" is abracadabra for me though. Is this necessary for the newer scripts to work with Domoticz? I'd love to try it.....

Re: Nefit Easy™ client library (How to install on the Pi)

Posted: Thursday 07 January 2016 22:34
by Holland
Just wondering what is the svalue for flowtemp. I tried both flowtemp and actualSupplyTemperature, but that didn't work

domoticz_msg.payload.svalue = "" + NefitJSON['flowtemp'];

Re: Nefit Easy™ client library (How to install on the Pi)

Posted: Thursday 07 January 2016 22:38
by rostyk
Holland wrote:Just wondering what is the svalue for flowtemp. I tried both flowtemp and actualSupplyTemperature, but that didn't work

domoticz_msg.payload.svalue = "" + NefitJSON['flowtemp'];
in current realisation:
you will receive json code like this:

Code: Select all

{ "topic": "nefit-flowtemp", "payload": { "id": "/heatingCircuits/hc1/actualSupplyTemperature", "type": "floatValue", "recordable": 0, "writeable": 0, "value": 36, "unitOfMeasure": "C", "minValue": 0, "maxValue": 100 }, "_msgid": "830e9319.7cf17" }
so just use:

Code: Select all

"" + NefitJSON['value']]
:lol:
in mine previus post i suggest to edit a nefit-easy-commands to receive it in more "human-friendly format" what we have for example for pressure

Re: Nefit Easy™ client library (How to install on the Pi)

Posted: Thursday 07 January 2016 22:55
by pepijn
rostyk wrote:
Holland wrote:Just wondering what is the svalue for flowtemp. I tried both flowtemp and actualSupplyTemperature, but that didn't work

domoticz_msg.payload.svalue = "" + NefitJSON['flowtemp'];
in current realisation:
you will receive json code like this:

Code: Select all

{ "topic": "nefit-flowtemp", "payload": { "id": "/heatingCircuits/hc1/actualSupplyTemperature", "type": "floatValue", "recordable": 0, "writeable": 0, "value": 36, "unitOfMeasure": "C", "minValue": 0, "maxValue": 100 }, "_msgid": "830e9319.7cf17" }
so just use:

Code: Select all

"" + NefitJSON['value']]
:lol:
in mine previus post i suggest to edit a nefit-easy-commands to receive it in more "human-friendly format" what we have for example for pressure
This is just the full output from the boiler. Off course I can minimize the amount of data displayed in the json ;-)

Re: Nefit Easy™ client library (How to install on the Pi)

Posted: Thursday 07 January 2016 22:58
by pepijn
mvveelen wrote:
pepijn wrote:
mvveelen wrote:Hi guys, just following this thread and hoping there will be something I could use on my Synology NAS. I'm not using Domoticz anymore on the RPi, but really want to integrate my Nefit Easy in Domoticz. Wishful thinking perhaps, but a guy can dream right :D ?
What about my suggestion on Tweakers? Run Node-RED on your Pi? Maybe there's also a nodejs package for Synology

https://www.synology.com/en-us/dsm/app_packages/Node_js
There isn't a package with the right version, but I installed it manually and can use the deprecated script. So maybe I'm nearly there already ?
This "Node-RED" is abracadabra for me though. Is this necessary for the newer scripts to work with Domoticz? I'd love to try it.....
The newer 'scripts' are exactly the same as the depreciated one, only split into some parts.

You need something to translate between the script and Domoticz. I use Node-RED for that but it can also be done in other ways like perl or lua

Re: Nefit Easy™ client library (How to install on the Pi)

Posted: Friday 08 January 2016 0:05
by pepijn
pepijn wrote:
rostyk wrote:
Holland wrote:Just wondering what is the svalue for flowtemp. I tried both flowtemp and actualSupplyTemperature, but that didn't work

domoticz_msg.payload.svalue = "" + NefitJSON['flowtemp'];
in current realisation:
you will receive json code like this:

Code: Select all

{ "topic": "nefit-flowtemp", "payload": { "id": "/heatingCircuits/hc1/actualSupplyTemperature", "type": "floatValue", "recordable": 0, "writeable": 0, "value": 36, "unitOfMeasure": "C", "minValue": 0, "maxValue": 100 }, "_msgid": "830e9319.7cf17" }
so just use:

Code: Select all

"" + NefitJSON['value']]
:lol:
in mine previus post i suggest to edit a nefit-easy-commands to receive it in more "human-friendly format" what we have for example for pressure
This is just the full output from the boiler. Off course I can minimize the amount of data displayed in the json ;-)
Robert added a supplyTemperature command to the library, I will implement this in the next version.

Re: Nefit Easy™ client library (How to install on the Pi)

Posted: Friday 08 January 2016 0:09
by rostyk
I still have feeling that for every "nefit-easy node" we execute full authorisation session from beginning. thats not good because we overuse connections (which are limited up to five, according to Nefit documentation).

upd: thats good because for that purpose i modify status.js command include code for flow temperature just five minutes ago :D

Re: Nefit Easy™ client library (How to install on the Pi)

Posted: Friday 08 January 2016 0:30
by pepijn
rostyk wrote:I still have feeling that for every "nefit-easy node" we execute full authorisation session from beginning. thats not good because we overuse connections (which are limited up to five, according to Nefit documentation).

upd: thats good because for that purpose i modify status.js command include code for flow temperature just five minutes ago :D
As said before I'm working in session pooling. This is not that easy :)

The connection overuse you are talking about has nothing todo with the limit in Nefits documentation. The session is closed after every command so the number of concurrent sessions does not grow.

I do not advice to change Robert's library files because it's used as a dependency. Everything you do can be done within the nefit-easy.js (you are free to issue a pull request to add your modifications to the node)

Re: Nefit Easy™ client library (How to install on the Pi)

Posted: Friday 08 January 2016 1:08
by Holland
Thanks Rostyk,

Btw I have created 6 sessions concurrent sessions and now I'm getting these;

-1-2016 01:06:5585298a82.9f76fmsg : errorError: REQUEST_TIMEOUT
8-1-2016 01:06:5785298a82.9f76fmsg : errorError: REQUEST_TIMEOUT
8-1-2016 01:07:13502a77ba.9da608msg : errorError: REQUEST_TIMEOUT
8-1-2016 01:07:13e193b188.2daddmsg : errorError: REQUEST_TIMEOUT
8-1-2016 01:07:1385298a82.9f76fmsg : errorError: REQUEST_TIMEOUT
8-1-2016 01:07:17502a77ba.9da608msg : errorError: REQUEST_TIMEOUT
8-1-2016 01:07:2585298a82.9f76fmsg : errorError: REQUEST_TIMEOUT
8-1-2016 01:07:2785298a82.9f76fmsg : errorError: REQUEST_TIMEOUT

I have removed the new sessions I created, hopefully the connection comes back up.