
The bash scripts in the example above have no error handeling for example they will start multiple times and have high CPU load. That's why creating a real node is a way better solution.
Moderator: leecollings
That I did already.pepijn wrote:Just delete the pressure nodes from your node-red flow
That's not the way a node red nose works. It's using the library part of the nefit-easy-client directly.jannl wrote:According to node-red.org it is build on node.js and propably takes more resources compared to my perl script, which indeed does not have too much error-handling at the time, but wrong values will not be handled, keeping them from getting into Domoticz.
node-red is most likely is some sort of code-generator, which is not bad of-course. Under the hood I suppose node-red also issue an "easy status"
And besides that, I like keeping it in perl.
It will be a node red object that can be used in your own flows but I will provide a sample flowDutchsea wrote:That I did already.pepijn wrote:Just delete the pressure nodes from your node-red flowAnd probably i will also remove the pressure code in Domoticz MQTT
Just saying that i hope your new version will also have option.
Overnight my issue fixed itself so now the updated node-red is working and Pepijns code is working including the rbe node.Dutchsea wrote:Nice! I tried the latest code again after my "upgrade" but I still have the " rbe" error in node-reddorenberg wrote:Got some errors too, but upgrade was succesful in the end. Everything seems to work over here. Including my domoticz, plugwise, nefit, and all other stuff.
Code: Select all
5 januari 2016 14:41:38 CET8a346c68.75cb9
domoticz/in : msg : Object
{ "topic": "domoticz/in", "payload": { "idx": 221, "nvalue": 0, "svalue": "18.2" }, "_msgid": "6f292783.90d6d8" }
Code: Select all
5 januari 2016 14:41:38 CETDomoticz MQTT
function : (error)
SyntaxError: Unexpected end of input
I dont see it in the app and my CV does not support it. See https://github.com/robertklep/nefit-eas ... t/issues/6pepijn wrote:It will be a node red object that can be used in your own flows but I will provide a sample flowDutchsea wrote:That I did already.pepijn wrote:Just delete the pressure nodes from your node-red flowAnd probably i will also remove the pressure code in Domoticz MQTT
Just saying that i hope your new version will also have option.
Just curious do you have the pressure option within the Nefit App?
Matbe someone will have some spare time.pepijn wrote:In my opinion Node-Red is not a script but IBM's way of connecting IoT. But you are free to build native support into Domoticz
Could this be related to thefollowing issue?Dutchsea wrote:Next, the set command does not result on a change on the Nefit easy.
I can set e new temperature in Domoticz which show the new temp.
But the thermostat does not show the new value thereafter.
Suggestion on what i can verify are appreciated.
Is your thermostat in a manual program, clock programmering or other?dorenberg wrote:Well over here it works fine. I have a Bosch HRC II 35 at home. Pressure works and controlling the set point from domoticz results in a change in the thermostat.
To set temperature in timer (clock) mode you need 2 parameters.Dutchsea wrote:Next, the set command does not result on a change on the Nefit easy.
I can set e new temperature in Domoticz which show the new temp.
But the thermostat does not show the new value thereafter.
Suggestion on what i can verify are appreciated.
Code: Select all
setTemperature(value) {
var data = { value : Number(value) };
var over_status = { value : "on" }; //place temperature override in 'clock' mode
return Promise.all([
this.put('/heatingCircuits/hc1/temperatureRoomManual', data),
this.put('/heatingCircuits/hc1/manualTempOverride/status', over_status), //place temperature override in 'clock' mode
this.put('/heatingCircuits/hc1/manualTempOverride/temperature', data),
]).then(() => {
return { status : 'ok' };
});
}
It is in the clock programming mode.Dutchsea wrote:Is your thermostat in a manual program, clock programmering or other?dorenberg wrote:Well over here it works fine. I have a Bosch HRC II 35 at home. Pressure works and controlling the set point from domoticz results in a change in the thermostat.
I understood with the above script the nefit-set command should work with the clock program too.pepijn wrote:True
So if you change the script /opt/nefit/nefit-set toYou can also change the setpoint when a clock program is used. But note, if the clock program changes the temperature (or you change it on the themostat/ easy app), te setpoint in Domoticz will not be changed.Code: Select all
export NEFIT_SERIAL_NUMBER='XXXX' export NEFIT_ACCESS_KEY='XXXX' export NEFIT_PASSWORD='XXXX' easy put /heatingCircuits/hc1/temperatureRoomManual \'{\"value\":$*}\' easy put /heatingCircuits/hc1/manualTempOverride/status '{"value":"on"}' easy put /heatingCircuits/hc1/manualTempOverride/temperature \'{\"value\":$*}\'
TESTERS NEEDEDpepijn wrote:All,
As mentioned before using the scripts is not the way to go.
Right now I'am working on a (native) Node-RED node for Nefit Easy. As you can see I'am able to communicate to the Easy directly (so without scripts). But the node is not finished yet.
Code: Select all
sudo npm install pepijng/node-red-contrib-nefit-easy -g
Code: Select all
[{"id":"ff25878b.28a9f8","type":"mqtt-broker","broker":"127.0.0.1","port":"1883","clientid":"","usetls":false,"verifyservercert":true,"compatmode":true,"keepalive":15,"cleansession":true,"willQos":"0","birthQos":"0"},{"id":"f3fdab6a.9716d","type":"inject","z":"d60d4263.22172","name":"","topic":"nefit-update","payload":"","payloadType":"date","repeat":"30","crontab":"","once":true,"x":141,"y":148.00000190734863,"wires":[["344cad2f.e89e4a"]]},{"id":"c2dbd85e.feb6","type":"debug","z":"d60d4263.22172","name":"","active":true,"console":"true","complete":"true","x":1255.2539672851562,"y":274.74998664855957,"wires":[]},{"id":"f468c591.d5b0a8","type":"mqtt in","z":"d60d4263.22172","name":"domoticz/out/#","topic":"domoticz/out/#","broker":"ff25878b.28a9f8","x":202.99996948242188,"y":445,"wires":[["4f50f277.195ef4"]]},{"id":"4f50f277.195ef4","type":"function","z":"d60d4263.22172","name":"de-jsonify","func":"var payload = JSON.parse(msg.payload);\nreturn payload;","outputs":1,"noerr":0,"x":368.9999694824219,"y":445,"wires":[["91c9a815.09fae"]]},{"id":"7dec00a4.5473f","type":"debug","z":"d60d4263.22172","name":"","active":true,"console":"false","complete":"true","x":1080.25,"y":438.74998664855957,"wires":[]},{"id":"36479ab6.9ba30e","type":"function","z":"d60d4263.22172","name":"Get SetPoint Value","func":"msg.payload = msg.svalue1\nreturn msg;","outputs":1,"noerr":0,"x":748.1944351196289,"y":444.0833168029785,"wires":[["f6959acc.46eb18"]]},{"id":"91c9a815.09fae","type":"switch","z":"d60d4263.22172","name":"filter Setpoint IDX","property":"idx","rules":[{"t":"eq","v":"160"}],"checkall":"true","outputs":1,"x":547.4443969726562,"y":444.5555419921875,"wires":[["36479ab6.9ba30e"]]},{"id":"736e147f.478be4","type":"comment","z":"d60d4263.22172","name":"Read changes from Domoticz and send to Easy","info":"","x":303.9999694824219,"y":408,"wires":[]},{"id":"86d83761.b74138","type":"function","z":"d60d4263.22172","name":"Domoticz MQTT","func":"// Configuration\nconst IDX_SetPoint = 160;\nconst IDX_RoomTemp = 161;\nconst IDX_Pressure = 162;\nconst IDX_StatusCode = 163;\n\n\nvar domoticz_msg = {};\ndomoticz_msg.topic = \"domoticz/in\";\ndomoticz_msg.payload = {};\n\nif (msg.topic == 'nefit-update') {\n var NefitJSON = JSON.parse(msg.payload);\n domoticz_msg.payload.idx = IDX_RoomTemp;\n domoticz_msg.payload.nvalue = 0;\n domoticz_msg.payload.svalue = \"\" + NefitJSON['in house temp'];\n}\nif (msg.topic == 'nefit-pressure') {\n var NefitJSON = JSON.parse(msg.payload);\n domoticz_msg.payload.idx = IDX_Pressure;\n domoticz_msg.payload.nvalue = 0;\n domoticz_msg.payload.svalue = \"\" + NefitJSON['pressure'];\n}\nif (msg.topic == 'nefit-setpoint') {\n domoticz_msg.payload.idx = IDX_SetPoint;\n domoticz_msg.payload.nvalue = 0;\n domoticz_msg.payload.svalue = \"\" + msg.payload;\n}\nif (msg.topic == 'nefit-statuscode') {\n domoticz_msg.payload.idx = IDX_StatusCode;\n domoticz_msg.payload.nvalue = 0;\n domoticz_msg.payload.svalue = \"\" + msg.payload;\n}\n\nreturn domoticz_msg;","outputs":1,"noerr":0,"x":1035.4999465942383,"y":214.35714721679688,"wires":[["78e7ad56.9981fc","c2dbd85e.feb6"]]},{"id":"78e7ad56.9981fc","type":"mqtt out","z":"d60d4263.22172","name":"Domoticz MQTT","topic":"","qos":"","retain":"","broker":"ff25878b.28a9f8","x":1280.2499618530273,"y":216.10714149475098,"wires":[]},{"id":"86f7256b.4702","type":"inject","z":"d60d4263.22172","name":"","topic":"nefit-pressure","payload":"","payloadType":"date","repeat":"300","crontab":"","once":false,"x":154.75,"y":316.7500171661377,"wires":[["e00efb82.b052e8"]]},{"id":"89bae4a3.1d509","type":"comment","z":"d60d4263.22172","name":"Publish data from Nefit Easy Client to Domoticz","info":"","x":296.9999694824219,"y":98,"wires":[]},{"id":"538a564.a08a428","type":"rbe","z":"d60d4263.22172","name":"","func":"rbe","gap":"","x":801.2142639160156,"y":113.99999809265137,"wires":[["86d83761.b74138"]]},{"id":"ffed6cb1.d18d58","type":"function","z":"d60d4263.22172","name":"Get Setpoint","func":"var NefitJSON = JSON.parse(msg.payload);\nmsg.topic = 'nefit-setpoint';\nmsg.payload = NefitJSON['temp setpoint'];\nreturn msg;","outputs":1,"noerr":0,"x":668.0714111328125,"y":130.14285469055176,"wires":[["538a564.a08a428"]]},{"id":"40f53ce3.b10fbc","type":"inject","z":"d60d4263.22172","name":"","topic":"nefit-statuscode","payload":"","payloadType":"date","repeat":"10","crontab":"","once":false,"x":114.642822265625,"y":230.25000190734863,"wires":[["d9c31f75.e6cf1"]]},{"id":"58e78dae.bc17b4","type":"function","z":"d60d4263.22172","name":"Get Status Code","func":"var NefitJSON = JSON.parse(msg.payload);\nmsg.topic = 'nefit-statuscode';\nmsg.payload = \"\"+\"[ \"+NefitJSON['code']+\" ] \"+NefitJSON['description'];\nreturn msg;","outputs":1,"noerr":0,"x":623.5,"y":220.50000190734863,"wires":[["fde852ee.6a0248"]]},{"id":"fde852ee.6a0248","type":"rbe","z":"d60d4263.22172","name":"","func":"rbe","gap":"","x":802.642822265625,"y":231.71428108215332,"wires":[["86d83761.b74138"]]},{"id":"344cad2f.e89e4a","type":"nefit-easy","z":"d60d4263.22172","easy":"","name":"","topic":"nefit-update","command":"status","x":279.0714111328125,"y":147.5714282989502,"wires":[["d543561c.93741","138477f1.3e55a8"]]},{"id":"d9c31f75.e6cf1","type":"nefit-easy","z":"d60d4263.22172","easy":"","name":"","topic":"nefit-statuscode","command":"display-code","x":298.0714111328125,"y":260.5714282989502,"wires":[["e460913f.e3e5f8"]]},{"id":"e00efb82.b052e8","type":"nefit-easy","z":"d60d4263.22172","easy":"","name":"","topic":"nefit-pressure","command":"pressure","x":358.0714111328125,"y":325.5714282989502,"wires":[["1e345af1.a80ca5"]]},{"id":"f6959acc.46eb18","type":"nefit-easy","z":"d60d4263.22172","easy":"","name":"","topic":"nefit-set","command":"set-temperature","x":938.0714111328125,"y":436.5714282989502,"wires":[["7dec00a4.5473f"]]},{"id":"e460913f.e3e5f8","type":"json","z":"d60d4263.22172","name":"","x":459.0714111328125,"y":217.5714282989502,"wires":[["58e78dae.bc17b4"]]},{"id":"d543561c.93741","type":"json","z":"d60d4263.22172","name":"","x":534.0714111328125,"y":125.5714282989502,"wires":[["ffed6cb1.d18d58"]]},{"id":"138477f1.3e55a8","type":"json","z":"d60d4263.22172","name":"","x":453.0714111328125,"y":175.5714282989502,"wires":[["86d83761.b74138"]]},{"id":"1e345af1.a80ca5","type":"json","z":"d60d4263.22172","name":"","x":580.0714111328125,"y":305.5714282989502,"wires":[["86d83761.b74138"]]}]
Users browsing this forum: No registered users and 1 guest