how to add APSystems ECU-3 solar inverter monitor

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

User avatar
FireWizard
Posts: 1888
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: how to add APSystems ECU-3 solar inverter monitor

Post by FireWizard »

Hello Bernhard,

I think you may want to remove/delete that node.

In spite of the fact that it looks a very powerful node, I found a simpler one.

This one does exact, what you need, not more, not less.
I even think about, to replace my nodes as well by this one.

1. Go to the menu bar.
2. Got to "Manage Palette"
3. Got to "Install" and search for: node-red-contrib-timerswitch
It will install one node, called "time switch"
For more info see: https://flows.nodered.org/node/node-red ... nge-switch
Use "Output 1" The node is very simple to configure.

- Name: your choice
- latitude and longitude
- Start time: sunrise
- Start time offset: -30/45/60, whatever you want
- End time: sunset
- End time offset: +30/45/60, whatever you want
Benneton
Posts: 114
Joined: Thursday 08 December 2016 9:46
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: how to add APSystems ECU-3 solar inverter monitor

Post by Benneton »

Hi FireWizard,

You are right, this one works fine and is simple.
One thing I noticed is that node-red-contrib-timerswitch is a different one then the one in the link.
In the link is referred to node-red-contrib-time-range-switch
The latter is the one that can do position and timing on sunrise and sunset.

Kind regards,
Bernard
User avatar
FireWizard
Posts: 1888
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: how to add APSystems ECU-3 solar inverter monitor

Post by FireWizard »

Hello Bernhard,

I looked into your extension for the flow.

Again, can you test this flow:

Code: Select all

[{"id":"a1776ce7.3be728","type":"http request","z":"d243b84a.4ac438","name":"HTTP AP Systems Overview Request","method":"GET","ret":"txt","paytoqs":false,"url":"http://192.168.2.88/index.php/home","tls":"","proxy":"","x":320,"y":80,"wires":[["f9cd660b.5528c","9da26ffb.4f20e"]]},{"id":"f9cd660b.5528c","type":"html","z":"d243b84a.4ac438","name":"Parse overview","property":"payload","outproperty":"payload","tag":"td","ret":"html","as":"single","x":620,"y":80,"wires":[["f3c1c3d6.06c7b"]]},{"id":"4f709cae.43ea9c","type":"debug","z":"d243b84a.4ac438","name":"Output Overview Array","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1130,"y":80,"wires":[]},{"id":"f3c1c3d6.06c7b","type":"function","z":"d243b84a.4ac438","name":"Create Overview Array","func":"var LifeTimeGen = msg.payload[1];\nvar LastSystemPowerA = msg.payload[2];\nvar CurDayGen = msg.payload[3];\nnewMsg = {payload: ([LifeTimeGen.slice(0,-4),LastSystemPowerA.slice(0,-2),CurDayGen.slice(0,-4)])};\nreturn newMsg;\n","outputs":1,"noerr":0,"x":870,"y":80,"wires":[["4f709cae.43ea9c"]]},{"id":"9da26ffb.4f20e","type":"html","z":"d243b84a.4ac438","name":"Parse overview","property":"payload","outproperty":"payload","tag":"br","ret":"html","as":"single","x":620,"y":140,"wires":[["fed6502.196f5b"]]},{"id":"fed6502.196f5b","type":"debug","z":"d243b84a.4ac438","name":"Output Environmental Array","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":880,"y":140,"wires":[]}]
Connect the output of the inject node to the input of this flow.
And please post the results of both debug nodes.

Regards
User avatar
FireWizard
Posts: 1888
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: how to add APSystems ECU-3 solar inverter monitor

Post by FireWizard »

Sorry Bernhard,

I overlooked that one.
One thing I noticed is that node-red-contrib-timerswitch is a different one then the one in the link.
In the link is referred to node-red-contrib-time-range-switch
This one should be the correct one:

https://www.npmjs.com/package/node-red- ... ime-switch

Regards
Benneton
Posts: 114
Joined: Thursday 08 December 2016 9:46
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: how to add APSystems ECU-3 solar inverter monitor

Post by Benneton »

Hi FireWizard,

No worries, just highlighted it for the other users :) (if there are any).

Just added the nodes you created. They deploy without errors.

Output from debug window:
9/26/2019, 3:45:05 PMnode: Output Overview Array
msg.payload : array[3]
array[3]
0: "5710.58"
1: "131"
2: "1.3"
9/26/2019, 3:45:06 PMnode: Output Environmental Arraymsg.payload : array[3]
array[3]
0: ""
1: ""
2: ""

Copied from ECU
Lifetime generation 5710.58 kWh
Last System Power 131 W
Generation of Current Day 1.3 kWh

So that works as it should :)

No values from the environmental Array.

Bernard
User avatar
FireWizard
Posts: 1888
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: how to add APSystems ECU-3 solar inverter monitor

Post by FireWizard »

Hello Bernhard,

So the first part looks ok.
I will prepare the flow for Domoticz.

The environmental part does not work.

Can you provide access to your home page, similar what you did before with the inverters?
Not the latest text file.

Regards
User avatar
FireWizard
Posts: 1888
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: how to add APSystems ECU-3 solar inverter monitor

Post by FireWizard »

Hello Bernhard,

Hereby the flow for the General.

It will require 3 more virtual sensor:

For Lifetime generation
1. Create virtual sensor.
2. Give the sensor a name, e.g. Production Lifetime .
3. As sensor type, select Usage (Electric).

For Last System Power
1. Create virtual sensor.
1. Give the sensor a name, e.g. Last System Power.
3. As sensor type, select Electric (Instant+Counter).

For Generation of Current Day
1. Create virtual sensor.
2. Give the sensor a name, e.g. Production Today.
3. As sensor type, select Usage (Electric).

Replace the IDX with the indexes you created in the previous step.

Connect the input of the flow to the output of the timer.
If you think it is ok, similar debug output, as the inverters the you can connect the output of the last "Function" node to the input of the MQTT node and the data should appear in Domoticz.

Below the flow:

Code: Select all

[{"id":"a1776ce7.3be728","type":"http request","z":"d243b84a.4ac438","name":"HTTP AP Systems Overview Request","method":"GET","ret":"txt","paytoqs":false,"url":"http://192.168.2.88/index.php/home","tls":"","proxy":"","x":320,"y":80,"wires":[["f9cd660b.5528c","9da26ffb.4f20e"]]},{"id":"f9cd660b.5528c","type":"html","z":"d243b84a.4ac438","name":"Parse overview","property":"payload","outproperty":"payload","tag":"td","ret":"html","as":"single","x":620,"y":80,"wires":[["f3c1c3d6.06c7b"]]},{"id":"f3c1c3d6.06c7b","type":"function","z":"d243b84a.4ac438","name":"Create Overview Array","func":"var LifeTimeGen = msg.payload[1];\nvar LastSystemPowerA = msg.payload[2];\nvar CurDayGen = msg.payload[3];\nnewMsg = {payload: ([LifeTimeGen.slice(0,-4),LastSystemPowerA.slice(0,-2),CurDayGen.slice(0,-4)])};\nreturn newMsg;\n","outputs":1,"noerr":0,"x":870,"y":80,"wires":[["364dfbb1.e2d524","4f709cae.43ea9c"]]},{"id":"364dfbb1.e2d524","type":"function","z":"d243b84a.4ac438","name":"Solar Production Inverters to Domoticz","func":"var msg1 = {};\nvar msg2 = {};\nvar msg3 = {};\n\nmsg1.payload = {\"command\":\"udevice\",\"idx\":7001,\"nvalue\":0,\"svalue\":(msg.payload[0])}; //Lifetime generation\nmsg2.payload = {\"command\":\"udevice\",\"idx\":7002,\"nvalue\":0,\"svalue\":(msg.payload[1] + \";0\")}; //Last System Power\nmsg3.payload = {\"command\":\"udevice\",\"idx\":7003,\"nvalue\":0,\"svalue\":(msg.payload[2])}; //Generation of Current Day\n\nreturn [[msg1,msg2,msg3]];","outputs":1,"noerr":0,"x":1200,"y":80,"wires":[["d97e6cb5.c7c25"]]},{"id":"d97e6cb5.c7c25","type":"debug","z":"d243b84a.4ac438","name":"Domoticz In","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1490,"y":80,"wires":[]}]
Awaiting your results,

Regards
Benneton
Posts: 114
Joined: Thursday 08 December 2016 9:46
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: how to add APSystems ECU-3 solar inverter monitor

Post by Benneton »

Hi FireWizard,

Done that and it works as a charm!
When defining the elements in Domoticz I saw that the Usage (Electric) is counting in Watt.
For lifetime generation and generation of the day it would be better to count in kWh.

To test I created a new virtual sensor type Custom and axis value kWh.
That gives the right amount. See screenshot, just did it for the Lifetime generation.

Image

I believe it would be the way to go for the lifetime and day generation.
down side it that the pictogram in the device is now a globe

Again many many thanks
Bernard
User avatar
FireWizard
Posts: 1888
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: how to add APSystems ECU-3 solar inverter monitor

Post by FireWizard »

Hi Bernhard,
When defining the elements in Domoticz I saw that the Usage (Electric) is counting in Watt.
For lifetime generation and generation of the day it would be better to count in kWh.
You are completely right. In my system I use Custom sensor as well and my Usage (Electric) is Watt.
Just too quick, but that is easy to correct.
Just delete the Usage (Electric) sensor and create 2 Custom Sensor with the axis as kWh.

Just as you did.

Looks nice.
down side it that the pictogram in the device is now a globe
That is also easy to solve.
You can use custom icons.
Did you look at the file Solar.zip in my post from Tuesday 24 September 2019 22:49?
There you will find an icon with a solar panel.
Just upload that zip file in Setup > More Options > Custom Icons.

OK, I think we are coming to an end.
If you can give me some access to the "home" page, then I will try to scrape the environmental figures.

I'm thinking to put this thread, together with the thread for the Enphase micro inverters in a Howto and to make it available as pdf.
But that will take time.

Maybe I will approach you for some nice screenshots.

Best regards
User avatar
FireWizard
Posts: 1888
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: how to add APSystems ECU-3 solar inverter monitor

Post by FireWizard »

Hello Bernhard,

Can you test the following flow:

Code: Select all

[{"id":"9da26ffb.4f20e","type":"html","z":"d243b84a.4ac438","name":"Parse overview","property":"payload","outproperty":"payload","tag":"center","ret":"html","as":"single","x":620,"y":140,"wires":[["fed6502.196f5b"]]},{"id":"fed6502.196f5b","type":"debug","z":"d243b84a.4ac438","name":"Output Environmental Array","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":880,"y":140,"wires":[]}]
Connect this to the output of HTTP AP Systems Overview Request.

Can you publish the result of the debug node?
If this node gives the output for the environmental parameters it is not necessary to publish the "home" webpage.
Then with one small step, we can publish the value to Domoticz.

Regards
Benneton
Posts: 114
Joined: Thursday 08 December 2016 9:46
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: how to add APSystems ECU-3 solar inverter monitor

Post by Benneton »

Hi FireWizard,

Sorry for the delay needed to attend business, and could not play with this.

Got the Solar panel icon included now, works simple and easy.

Great job again :)
This now is getting the data , see output of debug.
9/27/2019, 8:10:11 PMnode: Output Environmental Array
msg.payload : array[3]
array[3]
0: "476<br/>GALLONS"
1: "210<br/>TREES"
2: "4203<br/>KG"

So indeed nearly there. Let me know when you want screenshots etc. more than happy to provide.

Bernard
User avatar
FireWizard
Posts: 1888
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: how to add APSystems ECU-3 solar inverter monitor

Post by FireWizard »

Good evening Bernhard,
Sorry for the delay needed to attend business, and could not play with this.
You can not always be busy with our hobbies and for sure, business, family, etc has priority.

The result is very promising and there is only 1 small step to go.
You can create 3 additional "Custom" sensors. You can use "Scale" for that "Factory" and KG, but I would use "Custom" sensors and give the axis the following names: L, Trees, Kg.

The complete flow would look like the picture below.

Screenshot_APS-NodeRed-8.png
Screenshot_APS-NodeRed-8.png (98.09 KiB) Viewed 1688 times
The complete flow is published below:

Code: Select all

[{"id":"63bcbc31.eb708c","type":"http request","z":"d243b84a.4ac438","name":"HTTP AP Systems Production Request","method":"GET","ret":"txt","paytoqs":false,"url":"https://mbernard.home.xs4all.nl/youless/http%20_192.168.2.88_index.php_realtimedata.htm","tls":"","proxy":"","x":420,"y":440,"wires":[["c3df4a05.c383"]]},{"id":"d5e45a3a.244e5","type":"debug","z":"d243b84a.4ac438","name":"HTML Output","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":720,"y":500,"wires":[]},{"id":"8501a12b.61eb4","type":"inject","z":"d243b84a.4ac438","name":"5 MIn Tick","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":"","x":140,"y":360,"wires":[["d1c96d07.95888"]]},{"id":"c3df4a05.c383","type":"html","z":"d243b84a.4ac438","name":"Scrape inverter","property":"payload","outproperty":"payload","tag":"td","ret":"html","as":"single","x":720,"y":440,"wires":[["d5e45a3a.244e5","80391cd8.5820d8"]]},{"id":"80391cd8.5820d8","type":"function","z":"d243b84a.4ac438","name":"Create Inverter Array","func":"var i;\nfor (i = 0; i < msg.payload.length/9; i++) {\nvar InverterIDA = msg.payload[9*i+0];\nvar CurrentPowerA = msg.payload[9*i+1];\nvar GridFreq = msg.payload[9*i+2];\nvar GridVoltageA = msg.payload[9*i+3];\nvar GridTemp = msg.payload[9*i+4];\nvar GridReportTime = msg.payload[9*i+5];\nvar InverterIDB = msg.payload[9*i+6];\nvar CurrentPowerB = msg.payload[9*i+7];\nvar GridVoltageB = msg.payload[9*i+8];\nnewMsg = {payload: ([InverterIDA.substr(0,12),CurrentPowerA.slice(0,-2),GridVoltageA.slice(0,-2),CurrentPowerB.slice(0,-2),GridVoltageB.slice(0,-2),GridFreq.slice(0,-3),GridTemp.slice(0,-8)])}\nnode.send(newMsg);\n}","outputs":1,"noerr":0,"x":960,"y":440,"wires":[["7d148fd5.6837a8","752a8421.e09cf4"]]},{"id":"7d148fd5.6837a8","type":"debug","z":"d243b84a.4ac438","name":"Output APS Array","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1310,"y":440,"wires":[]},{"id":"752a8421.e09cf4","type":"function","z":"d243b84a.4ac438","name":"Solar Production Inverters to Domoticz","func":"var msg1 = {};\nvar msg2 = {};\nvar msg3 = {};\nvar msg4 = {};\nvar msg5 = {};\nvar msg6 = {};\n\nswitch (msg.payload[0]) {\n\n    case \"404000191265\": //Inverter 1\n    msg1.payload = {\"command\":\"udevice\",\"idx\":1001,\"nvalue\":0,\"svalue\":(msg.payload[1] + \";0\")}; //Current Power A\n    msg2.payload = {\"command\":\"udevice\",\"idx\":1002,\"nvalue\":0,\"svalue\":(msg.payload[2])}; //Voltage A\n    msg3.payload = {\"command\":\"udevice\",\"idx\":1003,\"nvalue\":0,\"svalue\":(msg.payload[3] + \";0\")}; //Current Power B\n    msg4.payload = {\"command\":\"udevice\",\"idx\":1004,\"nvalue\":0,\"svalue\":(msg.payload[4])}; //Voltage B\n    msg5.payload = {\"command\":\"udevice\",\"idx\":1005,\"nvalue\":0,\"svalue\":(msg.payload[5])}; //Frequency\n    msg6.payload = {\"command\":\"udevice\",\"idx\":1006,\"nvalue\":0,\"svalue\":(msg.payload[6])}; //Temperature\n    break;\n\n    case \"404000191123\": //Inverter 2\n    msg1.payload = {\"command\":\"udevice\",\"idx\":2001,\"nvalue\":0,\"svalue\":(msg.payload[1] + \";0\")}; //Current Power A\n    msg2.payload = {\"command\":\"udevice\",\"idx\":2002,\"nvalue\":0,\"svalue\":(msg.payload[2])}; //Voltage A\n    msg3.payload = {\"command\":\"udevice\",\"idx\":2003,\"nvalue\":0,\"svalue\":(msg.payload[3] + \";0\")}; //Current Power B\n    msg4.payload = {\"command\":\"udevice\",\"idx\":2004,\"nvalue\":0,\"svalue\":(msg.payload[4])}; //Voltage B\n    msg5.payload = {\"command\":\"udevice\",\"idx\":2005,\"nvalue\":0,\"svalue\":(msg.payload[5])}; //Frequency\n    msg6.payload = {\"command\":\"udevice\",\"idx\":2006,\"nvalue\":0,\"svalue\":(msg.payload[6])}; //Temperature\n    break;\n\n    case \"404000193004\": //Inverter 3\n    msg1.payload = {\"command\":\"udevice\",\"idx\":3001,\"nvalue\":0,\"svalue\":(msg.payload[1] + \";0\")}; //Current Power A\n    msg2.payload = {\"command\":\"udevice\",\"idx\":3002,\"nvalue\":0,\"svalue\":(msg.payload[2])}; //Voltage A\n    msg3.payload = {\"command\":\"udevice\",\"idx\":3003,\"nvalue\":0,\"svalue\":(msg.payload[3] + \";0\")}; //Current Power B\n    msg4.payload = {\"command\":\"udevice\",\"idx\":3004,\"nvalue\":0,\"svalue\":(msg.payload[4])}; //Voltage B\n    msg5.payload = {\"command\":\"udevice\",\"idx\":3005,\"nvalue\":0,\"svalue\":(msg.payload[5])}; //Frequency\n    msg6.payload = {\"command\":\"udevice\",\"idx\":3006,\"nvalue\":0,\"svalue\":(msg.payload[6])}; //Temperature\n    break;\n\n    case \"404000191257\": //Inverter 4\n    msg1.payload = {\"command\":\"udevice\",\"idx\":4001,\"nvalue\":0,\"svalue\":(msg.payload[1] + \";0\")}; //Current Power A\n    msg2.payload = {\"command\":\"udevice\",\"idx\":4002,\"nvalue\":0,\"svalue\":(msg.payload[2])}; //Voltage A\n    msg3.payload = {\"command\":\"udevice\",\"idx\":4003,\"nvalue\":0,\"svalue\":(msg.payload[3] + \";0\")}; //Current Power B\n    msg4.payload = {\"command\":\"udevice\",\"idx\":4004,\"nvalue\":0,\"svalue\":(msg.payload[4])}; //Voltage B\n    msg5.payload = {\"command\":\"udevice\",\"idx\":4005,\"nvalue\":0,\"svalue\":(msg.payload[5])}; //Frequency\n    msg6.payload = {\"command\":\"udevice\",\"idx\":4006,\"nvalue\":0,\"svalue\":(msg.payload[6])}; //Temperature\n    break;\n\n    case \"404000192992\": //Inverter 5\n    msg1.payload = {\"command\":\"udevice\",\"idx\":5001,\"nvalue\":0,\"svalue\":(msg.payload[1] + \";0\")}; //Current Power A\n    msg2.payload = {\"command\":\"udevice\",\"idx\":5002,\"nvalue\":0,\"svalue\":(msg.payload[2])}; //Voltage A\n    msg3.payload = {\"command\":\"udevice\",\"idx\":5003,\"nvalue\":0,\"svalue\":(msg.payload[3] + \";0\")}; //Current Power B\n    msg4.payload = {\"command\":\"udevice\",\"idx\":5004,\"nvalue\":0,\"svalue\":(msg.payload[4])}; //Voltage B\n    msg5.payload = {\"command\":\"udevice\",\"idx\":5005,\"nvalue\":0,\"svalue\":(msg.payload[5])}; //Frequency\n    msg6.payload = {\"command\":\"udevice\",\"idx\":5006,\"nvalue\":0,\"svalue\":(msg.payload[6])}; //Temperature\n    break;\n\n    case \"404000191779\": //Inverter 6\n    msg1.payload = {\"command\":\"udevice\",\"idx\":6001,\"nvalue\":0,\"svalue\":(msg.payload[1] + \";0\")}; //Current Power A\n    msg2.payload = {\"command\":\"udevice\",\"idx\":6002,\"nvalue\":0,\"svalue\":(msg.payload[2])}; //Voltage A\n    msg3.payload = {\"command\":\"udevice\",\"idx\":6003,\"nvalue\":0,\"svalue\":(msg.payload[3] + \";0\")}; //Current Power B\n    msg4.payload = {\"command\":\"udevice\",\"idx\":6004,\"nvalue\":0,\"svalue\":(msg.payload[4])}; //Voltage B\n    msg5.payload = {\"command\":\"udevice\",\"idx\":6005,\"nvalue\":0,\"svalue\":(msg.payload[5])}; //Frequency\n    msg6.payload = {\"command\":\"udevice\",\"idx\":6006,\"nvalue\":0,\"svalue\":(msg.payload[6])}; //Temperature\n    break;\n\n}\nreturn [[msg1,msg2,msg3,msg4,msg5,msg6]];","outputs":1,"noerr":0,"x":1020,"y":500,"wires":[["5bea947.a4ba1ec"]]},{"id":"5bea947.a4ba1ec","type":"debug","z":"d243b84a.4ac438","name":"Domoticz In","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1310,"y":500,"wires":[]},{"id":"a1776ce7.3be728","type":"http request","z":"d243b84a.4ac438","name":"HTTP AP Systems Overview Request","method":"GET","ret":"txt","paytoqs":false,"url":"http://192.168.2.88/index.php/home","tls":"","proxy":"","x":420,"y":280,"wires":[["f9cd660b.5528c","9da26ffb.4f20e"]]},{"id":"f9cd660b.5528c","type":"html","z":"d243b84a.4ac438","name":"Scrape overview","property":"payload","outproperty":"payload","tag":"td","ret":"html","as":"single","x":730,"y":260,"wires":[["f3c1c3d6.06c7b"]]},{"id":"4f709cae.43ea9c","type":"debug","z":"d243b84a.4ac438","name":"Output Overview Array","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1270,"y":260,"wires":[]},{"id":"d1c96d07.95888","type":"time-switch","z":"d243b84a.4ac438","name":"Day Time switch","lat":"52.179281","lon":"5.606528","startTime":"sunrise","endTime":"sunset","startOffset":"-30","endOffset":"+30","x":350,"y":360,"wires":[["63bcbc31.eb708c","a1776ce7.3be728"],[]]},{"id":"f3c1c3d6.06c7b","type":"function","z":"d243b84a.4ac438","name":"Create Overview Array","func":"var LifeTimeGen = msg.payload[1];\nvar LastSystemPower = msg.payload[2];\nvar CurDayGen = msg.payload[3];\nnewMsg = {payload: ([LifeTimeGen.slice(0,-4),LastSystemPower.slice(0,-2),CurDayGen.slice(0,-4)])};\nreturn newMsg;\n","outputs":1,"noerr":0,"x":970,"y":260,"wires":[["364dfbb1.e2d524","4f709cae.43ea9c"]]},{"id":"9da26ffb.4f20e","type":"html","z":"d243b84a.4ac438","name":"Scrape environment","property":"payload","outproperty":"payload","tag":"center","ret":"html","as":"single","x":740,"y":300,"wires":[["dadfb540.a207a"]]},{"id":"fed6502.196f5b","type":"debug","z":"d243b84a.4ac438","name":"Output Environmental Array","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1260,"y":300,"wires":[]},{"id":"364dfbb1.e2d524","type":"function","z":"d243b84a.4ac438","name":"Solar Overview to Domoticz","func":"var msg1 = {};\nvar msg2 = {};\nvar msg3 = {};\n\nmsg1.payload = {\"command\":\"udevice\",\"idx\":7001,\"nvalue\":0,\"svalue\":(msg.payload[0])}; //Lifetime generation\nmsg2.payload = {\"command\":\"udevice\",\"idx\":7002,\"nvalue\":0,\"svalue\":(msg.payload[1] + \";0\")}; //Last System Power\nmsg3.payload = {\"command\":\"udevice\",\"idx\":7003,\"nvalue\":0,\"svalue\":(msg.payload[2])}; //Generation of Current Day\n\nreturn [[msg1,msg2,msg3]];","outputs":1,"noerr":0,"x":980,"y":200,"wires":[["d97e6cb5.c7c25"]]},{"id":"d97e6cb5.c7c25","type":"debug","z":"d243b84a.4ac438","name":"Domoticz In","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1310,"y":160,"wires":[]},{"id":"8321d666.fac028","type":"function","z":"d243b84a.4ac438","name":"Solar Environmental to Domoticz","func":"var msg1 = {};\nvar msg2 = {};\nvar msg3 = {};\n\nmsg1.payload = {\"command\":\"udevice\",\"idx\":8001,\"nvalue\":0,\"svalue\":parseFloat(msg.payload[0] * 3,78541178).toFixed(1)}; //CO2 Car (L)\nmsg2.payload = {\"command\":\"udevice\",\"idx\":8002,\"nvalue\":0,\"svalue\":(msg.payload[1])}; //CO2 Tree\nmsg3.payload = {\"command\":\"udevice\",\"idx\":8003,\"nvalue\":0,\"svalue\":(msg.payload[2])}; //CO2 Factory (Kg)\n\nreturn [[msg1,msg2,msg3]];","outputs":1,"noerr":0,"x":1000,"y":360,"wires":[["93b122ab.4b1ae"]]},{"id":"dadfb540.a207a","type":"function","z":"d243b84a.4ac438","name":"Create Environmental Array","func":"var CO2Car = msg.payload[1];\nvar CO2Tree = msg.payload[2];\nvar CO2Factory = msg.payload[3];\nnewMsg = {payload: ([CO2Car.slice(0,-12),CO2Tree.slice(0,-10),CO2Factory.slice(0,-7)])};\nreturn newMsg;\n","outputs":1,"noerr":0,"x":980,"y":300,"wires":[["8321d666.fac028","fed6502.196f5b"]]},{"id":"93b122ab.4b1ae","type":"debug","z":"d243b84a.4ac438","name":"Domoticz In","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1290,"y":400,"wires":[]},{"id":"b0d7a44d.92a2b8","type":"comment","z":"d243b84a.4ac438","name":"Poll Home Page","info":"This node polls http://<ip address>/index.php/home","x":340,"y":220,"wires":[]},{"id":"bce11b22.56815","type":"comment","z":"d243b84a.4ac438","name":"Poll Inverter Page","info":"This node polls http://<ip address>/index.php/realtimedata","x":350,"y":500,"wires":[]}]
However, if you copy this complete flow, you have to replace all your IDX numbers again.
Therefore, I have also attached a reduced flow, with the environmental part.

Code: Select all

[{"id":"9da26ffb.4f20e","type":"html","z":"d243b84a.4ac438","name":"Scrape environment","property":"payload","outproperty":"payload","tag":"center","ret":"html","as":"single","x":740,"y":300,"wires":[["dadfb540.a207a"]]},{"id":"dadfb540.a207a","type":"function","z":"d243b84a.4ac438","name":"Create Environmental Array","func":"var CO2Car = msg.payload[1];\nvar CO2Tree = msg.payload[2];\nvar CO2Factory = msg.payload[3];\nnewMsg = {payload: ([CO2Car.slice(0,-12),CO2Tree.slice(0,-10),CO2Factory.slice(0,-7)])};\nreturn newMsg;\n","outputs":1,"noerr":0,"x":980,"y":300,"wires":[["8321d666.fac028","fed6502.196f5b"]]},{"id":"fed6502.196f5b","type":"debug","z":"d243b84a.4ac438","name":"Output Environmental Array","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1260,"y":300,"wires":[]},{"id":"8321d666.fac028","type":"function","z":"d243b84a.4ac438","name":"Solar Environmental to Domoticz","func":"var msg1 = {};\nvar msg2 = {};\nvar msg3 = {};\n\nmsg1.payload = {\"command\":\"udevice\",\"idx\":8001,\"nvalue\":0,\"svalue\":parseFloat(msg.payload[0] * 3,78541178).toFixed(1)}; //CO2 Car (L)\nmsg2.payload = {\"command\":\"udevice\",\"idx\":8002,\"nvalue\":0,\"svalue\":(msg.payload[1])}; //CO2 Tree\nmsg3.payload = {\"command\":\"udevice\",\"idx\":8003,\"nvalue\":0,\"svalue\":(msg.payload[2])}; //CO2 Factory (Kg)\n\nreturn [[msg1,msg2,msg3]];","outputs":1,"noerr":0,"x":1000,"y":360,"wires":[["93b122ab.4b1ae"]]},{"id":"93b122ab.4b1ae","type":"debug","z":"d243b84a.4ac438","name":"Domoticz In","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1290,"y":400,"wires":[]}]
Do the following:

1. Replace the IDX with your IDX in "Solar Environmental to Domoticz".
2. I have converted the US Gallons to L, and rounded it to 1 digit after . Please check that in the debug node, connected to the previous node.
3. If this one looks error free, and similar to the others, connect the output of the node to Domoticz In.

If you are looking for some nice icons (You can create these yourself, see Wiki) this is a nice link: https://icon-icons.com/nl/

At the end, it is possible to delete all those green debug nodes. That cleans-up the flow a little, but I suggest you deactivate the, as they might be needed in case of changes or problems.

Looking forward for feedback.

Regards and a nice weekend.
Benneton
Posts: 114
Joined: Thursday 08 December 2016 9:46
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: how to add APSystems ECU-3 solar inverter monitor

Post by Benneton »

Good evening to you too FireWizard,

Copied the environmental piece in, created the sensors and configured the Domoticz ideas and connected up
I noticed when I tested that I get this error in the Create Environmental Array:
9/27/2019, 10:53:27 PMnode: Create Environmental Arrayfunction : (error)
"TypeError: Cannot read property 'slice' of undefined"

Compared in the different create modules if I could see an obvious reason why it gives an error but could not see it.

Hope that you

Kind regards,
Bernard
User avatar
FireWizard
Posts: 1888
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: how to add APSystems ECU-3 solar inverter monitor

Post by FireWizard »

Hello Bernhard,

Sorry, I saw it immediately, copy/paste error.

Can you change the following in Create environmental array:

msg.payload [1] should become msg.payload [0]
msg.payload [2] should become msg.payload [1]
msg.payload [3] should becomd msg.payload [2]

Regards
Benneton
Posts: 114
Joined: Thursday 08 December 2016 9:46
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: how to add APSystems ECU-3 solar inverter monitor

Post by Benneton »

Hi FireWizard,

I did not see that :)
Changed it and it is working perfectly and shows correct in Domoticz.

Will paste screen shot with outcome later.

Bernard
Benneton
Posts: 114
Joined: Thursday 08 December 2016 9:46
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: how to add APSystems ECU-3 solar inverter monitor

Post by Benneton »

Hi

As you can see displayed all the totals and environment benefit.
Image

I adjusted the pictograms to reflect car, tree & factory.
When some is interested here the link to the files:
https://mbernard.home.xs4all.nl/youless/Car.zip
https://mbernard.home.xs4all.nl/youless/Carbon.zip
https://mbernard.home.xs4all.nl/youless/Tree.zip

I believe job well done by FireWizard

Thank you!
Bernard
User avatar
FireWizard
Posts: 1888
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: how to add APSystems ECU-3 solar inverter monitor

Post by FireWizard »

Hello Bernhard,

That looks really nice. Machinon theme?

Except, that you added some Custom icons, did you change other things in the function node?

I see that the Petrol CO2 offset displays 1428 L. I put a function toFixed (1) in, which should display 1 digit after the decimal point. Did you change that to 0, as I don't see that?
If not, I have to look to it. Do all your values matches the values on the webpage?

If so, we can conclude, that after you started this thread end of February 2018, we have now, more than 1.5 years later a nice and working solution. I started with my solar panels 5 month ago and I did not follow posts, regarding solar panels before that date. So I jumped in quite late and had also about 3 weeks holiday in that period.

I really like the result. Is there anything you would like to know?

With this method, you can scrape any webpage and publish the data to Domoticz.

As you can confirm these questions, I will publish a corrected flow, which can be used by any AP Systens user. And maybe to write a Howto.

Regards
Benneton
Posts: 114
Joined: Thursday 08 December 2016 9:46
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: how to add APSystems ECU-3 solar inverter monitor

Post by Benneton »

Hi FireWizard,

Indeed after 1.5 years you succeeded to get this working in Domoticz.

The theme I have selected in Domiticz is Aurora, one of the build in themes.

I only added the custom icons to the Virtual sensor. In the Function node I did not change anything except to configure my ID's for Domoticz.

The Petrol CO2 offset is not showing the decimal. I checked the output of the Solar Environmental to Domoticz to see:
sg.payload : Object
object
command: "udevice"
idx: 4973
nvalue: 0
svalue: "1428.0"

This is shown in Domoticz as 1428.
What I do not understand is the output of the calculation.
I have 476 Gallons * 3,78541178 to convert to liters = 1.801,85600728 (Calculator MS) which should display in Domoticz as 1801.6
1428 is 476 * 3, so the line:
msg1.payload = {"command":"udevice","idx":4973,"nvalue":0,"svalue":parseFloat(msg.payload[0] * 3,78541178).toFixed(1)}; //CO2 Car (L)
Is not using what's behind the comma. I tried to change the , to . but same output 1428.

I looked in Domoticz settings to see if there is a setting preventing the 1 digit after comma to show, could not see anything.

Most important is that all the values shown in Domoticz match up to the ones in the ECU :)

So my conclusion is that project is complete.

One thing left for me to do is to create floorplan that also includes the totals and environmental benefit.
Need to think how I will organize this.

Again thank you for your support! I hope that many other AP micro inverter users will enjoy your work and start monitoring their panels in Domoticz.
Let me know when I can assist with i.e. pictures or other stuff.

Bernard
User avatar
FireWizard
Posts: 1888
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: how to add APSystems ECU-3 solar inverter monitor

Post by FireWizard »

Hi Bernhard,

You wrote:
The Petrol CO2 offset is not showing the decimal. I checked the output of the Solar Environmental to Domoticz to see:
sg.payload : Object
object
command: "udevice"
idx: 4973
nvalue: 0
svalue: "1428.0"

This is shown in Domoticz as 1428.
What I do not understand is the output of the calculation.
I have 476 Gallons * 3,78541178 to convert to liters = 1.801,85600728 (Calculator MS) which should display in Domoticz as 1801.6
1428 is 476 * 3, so the line:
msg1.payload = {"command":"udevice","idx":4973,"nvalue":0,"svalue":parseFloat(msg.payload[0] * 3,78541178).toFixed(1)}; //CO2 Car (L)
Is not using what's behind the comma. I tried to change the , to . but same output 1428.
This is definitively a calculation error.

Could you replace in the "Solar Environmental to Domoticz" node the following line:

msg1.payload = {"command":"udevice","idx":8001,"nvalue":0,"svalue":parseFloat(msg.payload[0] * 3,78541178).toFixed(1)}; //CO2 Car (L)

with:

msg1.payload = {"command":"udevice","idx":8001,"nvalue":0,"svalue":parseFloat((msg.payload[0]) * 3.78541178).toFixed(1)}; //CO2 Car (L)

The only difference is two () around msg.payload[0].
Also the comma in 3,78541178 is wrong, Indeed should be 3.78541178

However, I cannot test it completely, but I believe this should correct it.
The result for 476 gallons should be 1801.9 L

This will give you 1 digit after the decimal point. If you want to change that, you can change the value in toFixed(1) to toFixed(0), or any other value.

Looking forward for your confirmation.

Regards
Last edited by FireWizard on Sunday 29 September 2019 10:40, edited 1 time in total.
Benneton
Posts: 114
Joined: Thursday 08 December 2016 9:46
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: how to add APSystems ECU-3 solar inverter monitor

Post by Benneton »

Hi FireWizard,

Done, and now it is working :)

9/28/2019, 4:35:35 PMnode: Domoticz In
msg.payload : Object
{ command: "udevice", idx: 4973, nvalue: 0, svalue: "1801.9" }

Image

So last debug session done and a full working tool to get from AP ECU to Domoticz.

Your patience and hard work very much appreciated by me (and I take it the community here).

Regards,
Bernard
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest