# Solar system from APsystems

**URL:** <https://community.homey.app/t/solar-system-from-apsystems/74759>\
**Category:** Questions & Help\
**Created:** [January 8, 2023, 1:12pm UTC](https://community.homey.app/t/solar-system-from-apsystems/74759 "2023-01-08T13:12:33Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rick\_Noorbergen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rick_noorbergen/32/17258_2.png) [@Rick\_Noorbergen](https://community.homey.app/u/Rick_Noorbergen)\
**Post date:** [January 8, 2023, 1:12pm UTC](https://community.homey.app/t/solar-system-from-apsystems/74759/1 "2023-01-08T13:12:33Z")

</div>

Hello everybody,

I want to see my solarsystem in Homey. My solarsystem is APsystems.  
Is there a app for in Homey?  
I can not find anything.

Greetings Rick

---

<div class="post-metadata">

**Author:** ![Robin\_De\_Lange](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robin_de_lange/32/25173_2.png) [@Robin\_De\_Lange](https://community.homey.app/u/Robin_De_Lange)\
**Post date:** [January 9, 2023, 10:39pm UTC](https://community.homey.app/t/solar-system-from-apsystems/74759/2 "2023-01-09T22:39:40Z")

</div>

there is not an app for at the moment, a friend of mine has the same solarsystem from APsystems. maybe you can ask an developer to make or add it to the there app? or maybe ask APsystems itself to make an app for homey

---

<div class="post-metadata">

**Author:** ![MarcoL](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marcol/32/25694_2.png) [@MarcoL](https://community.homey.app/u/MarcoL)\
**Post date:** [February 5, 2024, 8:47am UTC](https://community.homey.app/t/solar-system-from-apsystems/74759/3 "2024-02-05T08:47:18Z")

</div>

I have not done any app development but I did manage to parse the values from the internal webserver on the inverter controller and add this to a virtual device.

You will need the following:

- HomeyScript
- Device Capabilities (app)

1. create a new “device capabilities” Device and give it a name.

2. repair the device and in this screen add a numeric value:  

3. create a new homey script and past the contents below, be sure to update your IP of the APS controller:

> const url = ‘[http://x.x.x.x/index.php/realtimedata](http://x.x.x.x/index.php/realtimedata)’; // Replace with your target URL
> 
> let totalPower = 0  
> fetch(url)  
> .then(response =\> response.text())  
> .then(html =\> {  
> // Basic HTML parsing  
> const tableStart = html.indexOf(‘
> 
> ’);  
> const tableEnd = html.indexOf(‘
> 
> ’, tableStart);  
> const tableHtml = html.substring(tableStart, tableEnd);
> 
> ```
> // Extracting data from the table
> const rows = tableHtml.split('</tr>');
> let tableData = rows.map(row => {
> let rowData = [];
> const cells = row.split('</td>');
> cells.forEach(cell => {
> const start = cell.lastIndexOf('>') + 1;
> rowData.push(cell.substring(start).trim());
> });
> return rowData.filter(cell => cell); // Filter out empty cells
> });
> 
> // Calculate total power
> let totalPower = 0;
> tableData.forEach(row => {
> if (row[1] && row[1] !== '-') {
> totalPower += parseFloat(row[1]);
> }
> });
> 
> global.set('SolarPowerInt', totalPower);
> //console.log('Table Data:', tableData);
> console.log('Total Power:', totalPower, 'Watts');
> 
> ```
> 
> })  
> .catch(error =\> {  
> console.error(‘Error fetching the URL:’, error);  
> });
> 
> //get global variable and update tag for use in Flow  
> const totalPowerTag = global.get(‘SolarPowerInt’);  
> await tag(‘Solar Power int’, totalPowerTag);

1. Run the script to test and to create the tag used in the flow

2. create a flow to run the script and update the value of the virtual device:  

3. now the value should be updated in the virtual device:  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/7/0/7022a95c82b5260c026714c874a408793c2f8efe.png)

Hope this helps  
Marco

---

<div class="post-metadata">

**Author:** ![Daniel\_Weber](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/daniel_weber/32/16401_2.png) [@Daniel\_Weber](https://community.homey.app/u/Daniel_Weber)\
**Post date:** [February 6, 2024, 8:30pm UTC](https://community.homey.app/t/solar-system-from-apsystems/74759/4 "2024-02-06T20:30:14Z")

</div>

Hi @MarcoL ,

great approach 🙂

I tried to implement the Script, but when I test it i get this:

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/4/e/4e37270714fa9b59422bf6ae0b3ab0fefc044bb8.png)

any idea? many thx  
Scripting is new for me…

EDIT: I’m using ECU-R with 6 inverters, the realtimedata web page is working fine

Daniel

---

<div class="post-metadata">

**Author:** ![Daniel\_Weber](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/daniel_weber/32/16401_2.png) [@Daniel\_Weber](https://community.homey.app/u/Daniel_Weber)\
**Post date:** [February 15, 2024, 10:43am UTC](https://community.homey.app/t/solar-system-from-apsystems/74759/5 "2024-02-15T10:43:39Z")

</div>

_push_ Anyone else who made this running?

---

<div class="post-metadata">

**Author:** ![Theo\_Hendriks](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/theo_hendriks/32/16580_2.png) [@Theo\_Hendriks](https://community.homey.app/u/Theo_Hendriks)\
**Post date:** [March 9, 2024, 1:54pm UTC](https://community.homey.app/t/solar-system-from-apsystems/74759/6 "2024-03-09T13:54:21Z")

</div>

Hi Marco, did you get this working with an APsystems ECU-R unit, or do you have another ECU unit?.

---

<div class="post-metadata">

**Author:** ![Theo\_Hendriks](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/theo_hendriks/32/16580_2.png) [@Theo\_Hendriks](https://community.homey.app/u/Theo_Hendriks)\
**Post date:** [March 9, 2024, 1:55pm UTC](https://community.homey.app/t/solar-system-from-apsystems/74759/7 "2024-03-09T13:55:01Z")

</div>

Hi Daniel, Have you been able to get it to work in the meantime?

---

<div class="post-metadata">

**Author:** ![Daniel\_Weber](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/daniel_weber/32/16401_2.png) [@Daniel\_Weber](https://community.homey.app/u/Daniel_Weber)\
**Post date:** [March 10, 2024, 10:13am UTC](https://community.homey.app/t/solar-system-from-apsystems/74759/8 "2024-03-10T10:13:12Z")

</div>

Hi Theo, no I gave up 🙁

---

<div class="post-metadata">

**Author:** ![MarcoL](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marcol/32/25694_2.png) [@MarcoL](https://community.homey.app/u/MarcoL)\
**Post date:** [March 28, 2024, 6:17am UTC](https://community.homey.app/t/solar-system-from-apsystems/74759/9 "2024-03-28T06:17:18Z")

</div>

Hi Guys,  
sorry to have been so off the radar. Between family and business there is just so little time for tinkering.  
The script does work but I have my doubts that the text comes through as expected:

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/c/f/cf1ea53271b103931312e31c2b8ffb14e749e298.png)

I have added the code in a txt file, hope that works better :  
[aps.zip](https://1drv.ms/u/s!AofDWNpptCbOgZ1oIlHLbqNHtSz8pg?e=jhUfOj)

I have the ECU-R, not sure what firmware as it still states copyright 2015 in the botom of the webpage. However, if the page looks like this, i guess it should work:

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/1/5/1597ecbf620e3be07a705215280cc2f8279c12ef.png)

If it looks different, send me an export of the html and ill see what i can do to parse it.

Marco

---

<div class="post-metadata">

**Author:** ![ARTNOW44](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/artnow44/32/69544_2.png) [@ARTNOW44](https://community.homey.app/u/ARTNOW44)\
**Post date:** [March 28, 2024, 11:42am UTC](https://community.homey.app/t/solar-system-from-apsystems/74759/10 "2024-03-28T11:42:15Z")

</div>

Sorry for my bad english i’m french , i’am very interesting for this application

---

<div class="post-metadata">

**Author:** ![MarcoL](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marcol/32/25694_2.png) [@MarcoL](https://community.homey.app/u/MarcoL)\
**Post date:** [April 6, 2024, 12:12pm UTC](https://community.homey.app/t/solar-system-from-apsystems/74759/11 "2024-04-06T12:12:22Z")

</div>

Hi @ARTNOW44  
Did you get it to work?

---

<div class="post-metadata">

**Author:** ![Pairis](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/pairis/32/56439_2.png) [@Pairis](https://community.homey.app/u/Pairis)\
**Post date:** [April 7, 2024, 11:49am UTC](https://community.homey.app/t/solar-system-from-apsystems/74759/12 "2024-04-07T11:49:05Z")

</div>

> [@MarcoL](#):
>
> Device Capabilities

I’m getting the following response:

```auto
Error fetching the URL: FetchError: request to http://{{URL}/index.php/realtimedata failed, reason: connect ECONNREFUSED {{URL}}
    at ClientRequest.<anonymous> (/app/node_modules/node-fetch/lib/index.js:1491:11)
    at ClientRequest.emit (node:events:517:28)
    at Socket.socketErrorListener (node:_http_client:501:9)
    at Socket.emit (node:events:517:28)
    at emitErrorNT (node:internal/streams/destroy:151:8)
    at emitErrorCloseNT (node:internal/streams/destroy:116:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  type: 'system',
  errno: 'ECONNREFUSED',
  code: 'ECONNREFUSED'
}

```

Any thoughts?

{{URL}} contains the URL of the ECU, but blurred it here 😉

---

<div class="post-metadata">

**Author:** ![Roy\_Klungtvedt](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/roy_klungtvedt/32/79242_2.png) [@Roy\_Klungtvedt](https://community.homey.app/u/Roy_Klungtvedt)\
**Post date:** [April 7, 2024, 6:59pm UTC](https://community.homey.app/t/solar-system-from-apsystems/74759/13 "2024-04-07T18:59:53Z")

</div>

Same problem for me, and would really like to solve this 🤞

---

<div class="post-metadata">

**Author:** ![ARTNOW44](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/artnow44/32/69544_2.png) [@ARTNOW44](https://community.homey.app/u/ARTNOW44)\
**Post date:** [April 8, 2024, 6:15am UTC](https://community.homey.app/t/solar-system-from-apsystems/74759/14 "2024-04-08T06:15:32Z")

</div>

hello , yes , thanks

 ![Capture d'écran 2024-04-08 081344](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/7/d/7dd5618e745e4d63857e4ee583d020a0c60a3674.png)

---

<div class="post-metadata">

**Author:** ![Daniel\_Weber](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/daniel_weber/32/16401_2.png) [@Daniel\_Weber](https://community.homey.app/u/Daniel_Weber)\
**Post date:** [April 23, 2024, 12:05pm UTC](https://community.homey.app/t/solar-system-from-apsystems/74759/16 "2024-04-23T12:05:42Z")

</div>

Hi @MarcoL

finally I got this up and running, many thx for your work.

Daniel

---

<div class="post-metadata">

**Author:** ![Patrick\_Van\_Deursen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/patrick_van_deursen/32/56539_2.png) [@Patrick\_Van\_Deursen](https://community.homey.app/u/Patrick_Van_Deursen)\
**Post date:** [May 11, 2024, 6:21pm UTC](https://community.homey.app/t/solar-system-from-apsystems/74759/17 "2024-05-11T18:21:03Z")

</div>

what then card do I need to use?

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/8/8/88d20f23f8e459e717a2c918c6975c60e6a9c392.png)

---

<div class="post-metadata">

**Author:** ![Patrick\_Van\_Deursen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/patrick_van_deursen/32/56539_2.png) [@Patrick\_Van\_Deursen](https://community.homey.app/u/Patrick_Van_Deursen)\
**Post date:** [May 12, 2024, 8:51am UTC](https://community.homey.app/t/solar-system-from-apsystems/74759/19 "2024-05-12T08:51:13Z")

</div>

Unfortunately not working on my side

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/7/9/7999eeefd553bb55eaec4b3bd5f210ecd78156da.png)

---

<div class="post-metadata">

**Author:** ![Patrick\_Van\_Deursen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/patrick_van_deursen/32/56539_2.png) [@Patrick\_Van\_Deursen](https://community.homey.app/u/Patrick_Van_Deursen)\
**Post date:** [May 13, 2024, 5:49pm UTC](https://community.homey.app/t/solar-system-from-apsystems/74759/20 "2024-05-13T17:49:08Z")

</div>

were you able to get this working? struggling at I think the same point.

if by the way I enter this website (with my local IP address of the ECU, I should get a webpage with the table indicated above here?

Not getting any response in my case…

---

<div class="post-metadata">

**Author:** ![Pairis](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/pairis/32/56439_2.png) [@Pairis](https://community.homey.app/u/Pairis)\
**Post date:** [May 14, 2024, 6:46am UTC](https://community.homey.app/t/solar-system-from-apsystems/74759/21 "2024-05-14T06:46:07Z")

</div>

No did not manage to get this working. But truth be told is that I did not spend much time on it.

With the long weekend ahead, I might pick this up again 🙂 will keep you posted if there is progress to share 😉

---

<div class="post-metadata">

**Author:** ![Patrick\_Van\_Deursen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/patrick_van_deursen/32/56539_2.png) [@Patrick\_Van\_Deursen](https://community.homey.app/u/Patrick_Van_Deursen)\
**Post date:** [May 27, 2024, 10:25am UTC](https://community.homey.app/t/solar-system-from-apsystems/74759/22 "2024-05-27T10:25:35Z")

</div>

For me though the import metric is the total produced power at eny given time, not the power per unit. Could not find that on the personal webpage on [apsystemsema.com](http://apsystemsema.com) either (only the total produced be day). Still have not been able to log into the local webpage and get any of the needed numbers…

[Next page](https://community.homey.app/t/solar-system-from-apsystems/74759.md?page=2)
