Page 9 of 37
Re: Nefit Easy™ Client/Node for Node-RED
Posted: Sunday 10 January 2016 14:54
by pepijn
pepijn wrote:NEW VERSION v1.1.0 of the Node is available
Code: Select all
sudo npm -g update node-red-contrib-nefit-easy
- Changed: the communication, only a single connection will be made and reused by all nodes.
- Implemented: Timeout setting to the Easy configuration node
- Changed: Flow-temperature output
- Some bugfixes
I found an error in setting the temperature. New version 1.1.1 available
Re: Nefit Easy™ client library (How to install on the Pi)
Posted: Sunday 10 January 2016 19:22
by dorenberg
Holland wrote:Pepijn,
How would you advice me to update Robert's library? Now I only have the following, which is incomplete and outdated
pi@raspberrypi ~ $ sudo npm -g list | grep nefit
├─┬
[email protected]
│ └─┬
[email protected]
│ ├─┬
[email protected]
Should I first remove the old nefit-easy-client install, and then separately install in separate directories, the core, commands and cli libraries?
Thanks for you advice
would be good to know the way forward. Same here. Have the client version installed, but not the new cli. Should I uninstall the old one and install the cli and then the node-red 1.1.0 version of your node-red flows/scripts?
Re: Nefit Easy™ client library (How to install on the Pi)
Posted: Sunday 10 January 2016 19:52
by pepijn
The node has its own dependencies so they are not used for the cli. If you want to use the cli (I can't imagine why) you should install it separately.
Re: Nefit Easy™ client library (How to install on the Pi)
Posted: Sunday 10 January 2016 19:55
by dorenberg
ok. Just to be clear. I will just uninstall the client (old 1st version) and delete the current node-red flow. Afterwards install your version of the node-red scripting. Enter parameters and done.
Re: Nefit Easy™ client library (How to install on the Pi)
Posted: Sunday 10 January 2016 20:00
by pepijn
dorenberg wrote:ok. Just to be clear. I will just uninstall the client (old 1st version) and delete the current node-red flow. Afterwards install your version of the node-red scripting. Enter parameters and done.
What do mean with node-red scripting? You don't need the old scripts (/opt/nefit) anymore.
Re: Nefit Easy™ client library (How to install on the Pi)
Posted: Sunday 10 January 2016 20:04
by dorenberg
I will delete those too. I meant the node-red-contrib-nefit-easy github package.
Re: Nefit Easy™ client library (How to install on the Pi)
Posted: Sunday 10 January 2016 20:08
by pepijn
dorenberg wrote:I will delete those too. I meant the node-red-contrib-nefit-easy github package.
You should use npm instead of github. Just to be clear its not a script but a node, a native addition to Node-RED
Re: Nefit Easy™ client library (How to install on the Pi)
Posted: Sunday 10 January 2016 20:43
by jakkes72
/newbie/
Hello, i started today with domoticz, and found the nefit part...
Now i am trying to install the nefit stuff, but am facing a problem:
After i install the node-v5.3 (or 5.4) i receive this:
pi@raspberrypi ~ $ node -v
Segmentation fault
pi@raspberrypi ~ $
My image is the domoticz-raspberrypi-sdcard-3530...
Re: Nefit Easy™ client library (How to install on the Pi)
Posted: Sunday 10 January 2016 21:20
by kraades
Did you install the correct node binaries? Pi1 or Pi2? ARMv6 or ARMv7?
Re: Nefit Easy™ client library (How to install on the Pi)
Posted: Sunday 10 January 2016 22:38
by pepijn
Just to be complete, the node is (automatically) published on nodered.org
http://flows.nodered.org/node/node-red- ... nefit-easy
Re: Nefit Easy™ client library (How to install on the Pi)
Posted: Monday 11 January 2016 11:09
by jakkes72
kraades wrote:Did you install the correct node binaries? Pi1 or Pi2? ARMv6 or ARMv7?
as far i know i have a Pi2,but will look closer when i am at home.
I followed these steps:
1 sudo ps -ef | grep node
2 sudo /etc/init.d/nodered stop
3 node -v
(VERSIE 0.10.4 OID ZOU ER MOETEN STAAN)
4 wget
https://nodejs.org/dist/v5.3.0/node-v5. ... v7l.tar.gz
5 tar -xvf node-v5.3.0-linux-armv7l.tar.gz
6 cd node-v5.3.0-linux-armv7l
7 sudo cp -R * /usr/local/
8 node -v
(VERSIE 5.3.0 ZOU ER MOETEN STAAN)
I am able to copy the files to /usr/local/ But the command node -v gives a segmentation fault.
edit:
Found it: I thought i had a Pi2, but i have a Pi1 B+
the command node -v gives the right output
Re: Nefit Easy™ client library (How to install on the Pi)
Posted: Monday 11 January 2016 14:11
by jakkes72
I managed to get it running:
pi@raspberrypi ~/node_modules/nefit-easy-commands/example $ node status.js
Temperature is set to 17.0°C, current is 18.3°C.
Outside temperature is 6.0°C.
System pressure is 1.4 bar.
But how do i get this data in Domoticz/Dashboard?
Re: Nefit Easy™ client library (How to install on the Pi)
Posted: Monday 11 January 2016 21:58
by Doler
Hi,
I promised to give some results:
From the outside everything looks fine and is working like it should which is great. When taking a look at the log I found a few errors; really a few: 12 to be exact in over 30 hours runtime. I found: INVALID_RESPONSE: 8x; REQUEST_TIMEOUT: 3x and 1 other error with the log text '[error] [nefit-easy:f5e93b14.0a16c8] Error: error:0606508A:digital envelope routines:EVP_DecryptFinal_ex:data not multiple of block length' where [nefit-easy:f5e93b14.0a16c8] is 'nefit-update'.
From another thread I learned that the timeout is harmless, for the other errors I don't know. But it doesn't seem to bother much since everything functions like it should. So thanks again for a great job.
Mark
PS. I made a little lua script that updates the setpoint widget once per hour with the same value to prevent that the widget turns red. It would be a nice feature if that could be built into the node. So pass the setpoint on change but at least once per hour. If its possible...
Re: Nefit Easy™ client library (How to install on the Pi)
Posted: Monday 11 January 2016 22:28
by pepijn
Doler wrote:Hi,
I promised to give some results:
From the outside everything looks fine and is working like it should which is great. When taking a look at the log I found a few errors; really a few: 12 to be exact in over 30 hours runtime. I found: INVALID_RESPONSE: 8x; REQUEST_TIMEOUT: 3x and 1 other error with the log text '[error] [nefit-easy:f5e93b14.0a16c8] Error: error:0606508A:digital envelope routines:EVP_DecryptFinal_ex:data not multiple of block length' where [nefit-easy:f5e93b14.0a16c8] is 'nefit-update'.
From another thread I learned that the timeout is harmless, for the other errors I don't know. But it doesn't seem to bother much since everything functions like it should. So thanks again for a great job.
Mark
PS. I made a little lua script that updates the setpoint widget once per hour with the same value to prevent that the widget turns red. It would be a nice feature if that could be built into the node. So pass the setpoint on change but at least once per hour. If its possible...
What is the version of the node you are using?
Most of the problems mentioned above should already be solved
Re: Nefit Easy™ client library (How to install on the Pi)
Posted: Monday 11 January 2016 22:31
by Doler
The latest, 1.1.1
Mark
Re: Nefit Easy™ client library (How to install on the Pi)
Posted: Monday 11 January 2016 23:24
by kc27
jakkes72 wrote:I managed to get it running:
pi@raspberrypi ~/node_modules/nefit-easy-commands/example $ node status.js
Temperature is set to 17.0°C, current is 18.3°C.
Outside temperature is 6.0°C.
System pressure is 1.4 bar.
But how do i get this data in Domoticz/Dashboard?
I made a little script in php to get these data in domoticz.
If you can handle that I can send you the script.
Otherwise you can use node-red:
https://domoticz.com/forum/viewtopic.php?f=4&t=9653
Re: Nefit Easy™ client library (How to install on the Pi)
Posted: Tuesday 12 January 2016 1:38
by Holland
hi kc27,
Maybe you can post the script on the forum
Re: Nefit Easy™ client library (How to install on the Pi)
Posted: Tuesday 12 January 2016 14:30
by kc27
This is the php-script, I use for importing nefit-easy values:
Code: Select all
<?php
$jsondata = shell_exec("easy -V --serial=xxxxxx --access-key=xxxxxx --password=xxxxx status");
$data= json_decode($jsondata);
var_dump($data);
$data_array= get_object_vars($data);
if (array_key_exists('in house temp', $data_array)){
$temp_current = $data_array['in house temp'];
echo 'current temp '. $temp_current."\n";
$result = file_get_contents('http://raspberrypi:8080/json.htm?type=command¶m=udevice&idx=1&nvalue=0&svalue='.$temp_current);
echo $result."\n";
}
if (array_key_exists('temp setpoint', $data_array)){
$temp_setpoint = $data_array['temp setpoint'];
echo 'setpoint temp '. $temp_setpoint."\n";
$result = file_get_contents('http://raspberrypi:8080/json.htm?type=command¶m=udevice&idx=2&nvalue=0&svalue='.$temp_setpoint);
echo $result."\n";
}
This only works when:
- node.js v4 or higer is installed
- nefit_easy_client (commandline) from Robert Klep is installed
- php5 is installed
- I have in Domoticz created
- a dummy thermostaat (Settings/Hardware)
- in that thermostat I created two virtual sensors with idx=1 en idx=2 for room temp and setpoint temp
- When you run this script on your raspberry and you have access to the website secured with username/password then you have to enhance your whitelist with your machinename (for instance raspberrypi) (viewtopic.php?f=6&t=9890)
This the output from the script:
Code: Select all
object(stdClass)#1 (22) {
["user mode"]=> string(5) "clock"
["clock program"]=> string(4) "auto"
["in house status"]=> string(2) "ok"
["in house temp"]=> float(19.5)
["boiler indicator"]=> string(3) "off"
["control"]=> string(4) "room"
["temp override duration"]=> int(0)
["current switchpoint"]=> int(15)
["ps active"]=> bool(false)
["fp active"]=> bool(false)
["temp override"]=> bool(false)
["holiday mode"]=> bool(false)
["boiler block"]=> NULL
["boiler lock"]=> NULL
["boiler maintainance"]=> NULL
["temp setpoint"]=> int(19)
["temp override temp setpoint"]=> float(18.5)
["temp manual setpoint"]=> int(20)
["hed enabled"]=> NULL
["hed device at home"]=> NULL
["outdoor temp"]=> int(6)
["outdoor source type"]=> string(7) "virtual"
}
current temp 19.5
{
"status" : "OK",
"title" : "Update Device"
}
setpoint temp 19
{
"status" : "OK",
"title" : "Update Device"
}
When you save the script in /var/www/update.php you can test it in your browser with
http://raspberrypi/update.php, or with the commandline:
I made a cronjob for it which runs every 5 minutes:
Code: Select all
*/5 * * * * sudo php /var/www/update.php >/home/pi/update/update_out.txt 2>&1
When there are problems you see it in /home/pi/update/update_out.txt
Re: Nefit Easy™ client library (How to install on the Pi)
Posted: Wednesday 13 January 2016 0:07
by Holland
Thanks, looks good. Will give it a try when I have a moment
Re: Nefit Easy™ client library (How to install on the Pi)
Posted: Wednesday 13 January 2016 0:11
by Holland
Pepijn,
Kind request. Can you maybe post a new version of your flow, which includes the single connection feature. Just want to see how to get this running properly. Thanks