# Help\\how to create an app

**URL:** <https://community.homey.app/t/help-how-to-create-an-app/58904>\
**Category:** Questions & Help\
**Tags:** app\
**Created:** [January 22, 2022, 11:21am UTC](https://community.homey.app/t/help-how-to-create-an-app/58904 "2022-01-22T11:21:06Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tukun](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tukun/32/14477_2.png) [@Tukun](https://community.homey.app/u/Tukun)\
**Post date:** [January 22, 2022, 11:21am UTC](https://community.homey.app/t/help-how-to-create-an-app/58904/1 "2022-01-22T11:21:06Z")

</div>

Hi everyone,

I have a question I hope someone can help me with or at least point me to the right direction. We have PV installed and they are connected to two inverters, StecaGrid 2500 and 2000. I can check the yield via 3rd party apps but it is not live data. However, I have been able to connect to the inverters through LAN where the production\yield is live. It is a very simple “web page” that shows me the same as in the display on the inverters (see images). Would it be possible to create an app where the live data can be populated via the ip address?

 ![1](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/1/8/18923120e75ad5641b58f0c7f1a21258942a03fb.jpeg)  
 ![2](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/2/8/28f895863f7fc00f4ca3698d6e6ee37a01754212.jpeg)

---

<div class="post-metadata">

**Author:** ![JPe4619](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jpe4619/32/9017_2.png) [@JPe4619](https://community.homey.app/u/JPe4619)\
**Post date:** [January 22, 2022, 2:23pm UTC](https://community.homey.app/t/help-how-to-create-an-app/58904/2 "2022-01-22T14:23:37Z")

</div>

Did you try all the Solar Apps that exist?  
Then maybe Webhooks is something you can use?  
Or else [Homey Developer](https://homey.app/en-us/developer/)

---

<div class="post-metadata">

**Author:** ![Tukun](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tukun/32/14477_2.png) [@Tukun](https://community.homey.app/u/Tukun)\
**Post date:** [January 23, 2022, 2:27pm UTC](https://community.homey.app/t/help-how-to-create-an-app/58904/3 "2022-01-23T14:27:52Z")

</div>

Hi @JPe4619 Thanks for your reply.  
It should be possible to use this app [Solar Panels App for Homey | Homey](https://homey.app/en-us/app/it.diederik.solar/Solar-Panels/). But I do not have any of the listed inverters. The only thing I could maybe use is the PVoutput, but not sure how to upload data there and how to use it 🙁

---

<div class="post-metadata">

**Author:** ![smux84](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/smux84/32/19877_2.png) [@smux84](https://community.homey.app/u/smux84)\
**Post date:** [January 28, 2023, 2:14am UTC](https://community.homey.app/t/help-how-to-create-an-app/58904/4 "2023-01-28T02:14:24Z")

</div>

Hi, did you succeed in your intent?

---

<div class="post-metadata">

**Author:** ![Torch1969](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/torch1969/32/33305_2.png) [@Torch1969](https://community.homey.app/u/Torch1969)\
**Post date:** [January 28, 2023, 7:49am UTC](https://community.homey.app/t/help-how-to-create-an-app/58904/5 "2023-01-28T07:49:23Z")

</div>

I also have a stecagrid inverter (coolcept 4200) labelled als solar frontier. I have tried to read out this information using homeyscript. That looked very good and must be possible. The information can be stored in a virtual device to be used in homey app’s and flows. I didn’t complete this, because I also use pv-output and a Youless on a specific kWh counter for the solar panels.

---

<div class="post-metadata">

**Author:** ![Torch1969](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/torch1969/32/33305_2.png) [@Torch1969](https://community.homey.app/u/Torch1969)\
**Post date:** [January 29, 2023, 3:15pm UTC](https://community.homey.app/t/help-how-to-create-an-app/58904/6 "2023-01-29T15:15:47Z")

</div>

Well I found the homeyscript I was working on. It looks like it is working properly, getting current power and energy by local API-call to the inverter. It save’s these values in 2 tag’s that can be used in other flow’s/scripts.  
This way you can make a flow that triggers at your liking (f.i. once every minute), call’s the script in the and part of the flow, and in the then part puts the values of the tag’s in a virtual device for your inverter.  
If anyone is interested, I will share the homeyscript.

---

<div class="post-metadata">

**Author:** ![Jeroen\_Tebbens](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jeroen_tebbens/32/62246_2.png) [@Jeroen\_Tebbens](https://community.homey.app/u/Jeroen_Tebbens)\
**Post date:** [February 22, 2023, 2:32pm UTC](https://community.homey.app/t/help-how-to-create-an-app/58904/7 "2023-02-22T14:32:50Z")

</div>

I am interested as I got a Solar Frontier that seems to listen/expose itself as a Steca. Just got news from Solar Frontier platform they will quit end of march their service. I got bash shell scripts but I recon a Homeyscript would work better.

---

<div class="post-metadata">

**Author:** ![Torch1969](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/torch1969/32/33305_2.png) [@Torch1969](https://community.homey.app/u/Torch1969)\
**Post date:** [February 23, 2023, 6:18pm UTC](https://community.homey.app/t/help-how-to-create-an-app/58904/8 "2023-02-23T18:18:34Z")

</div>

Hello @Jeroen_Tebbens  
Here you go (replace ip-address with your inverter)

```auto
// Script die voor zonnepanelen het huidige vermogen en opgewekte energie (huidige dag) ophaalt uit de SF-WR-4200 omvormer

// ophalen huidige vermogen
let url = "http://<replace inverter ip>/gen.measurements.table.js";
const response_p = await fetch(url, {
  "headers": {
  },
  "method": "GET",
})
const content_p = await response_p.text();
const start_p = content_p.indexOf('P AC') + 27;
const tmpFromStart_p = content_p.substring(start_p);
const end_p = tmpFromStart_p.indexOf('<');
const tmpDone_p = tmpFromStart_p.substring(0, end_p);
const dataInt_p = parseInt(tmpDone_p, 10);
const power = Number.isNaN(dataInt_p) ? 0 : dataInt_p;
console.log("Power: "+power);

// ophalen opgewekte vermogen
url = "http://<replace inverter ip>/gen.yield.day.chart.js";
const response_e = await fetch(url, {
  "headers": {
        'content-type': 'text/plain'
  },
  "method": "GET",
});
const content_e = await response_e.text();
const start_e = content_e.indexOf('labelValueId') + 29;
const tmpFromStart_e = content_e.substring(start_e);
const end_e = tmpFromStart_e.indexOf('Wh') - 1;
const tmpDone_e = tmpFromStart_e.substring(0, end_e);
//const dataInt_e = Math.round(parseFloat(tmpDone_e) * 1000);
const dataInt_e = parseFloat(tmpDone_e);
const energy = Number.isNaN(dataInt_e) ? 0 : dataInt_e;
console.log("Energy: " + energy);

//await setTagValue("SF-WR-4200_Vermogen", {type: "number", title: "SF-WR-4200 Vermogen"}, power ); 
//await setTagValue("SF-WR-4200_Energie", {type: "number", title: "SF-WR-4200 Energie"}, energy );

return power;

```

if script is working for you, uncomment the last 2 lines to create script tag’s to be used in homey flow’s etc. Or change this to anything else of your liking to fill other variables, or (virtual device) capabilities etc.  
Have fun!

---

<div class="post-metadata">

**Author:** ![Jeroen\_Tebbens](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jeroen_tebbens/32/62246_2.png) [@Jeroen\_Tebbens](https://community.homey.app/u/Jeroen_Tebbens)\
**Post date:** [February 23, 2023, 8:49pm UTC](https://community.homey.app/t/help-how-to-create-an-app/58904/9 "2023-02-23T20:49:51Z")

</div>

Almost!

Power: 0

Energy: 2.17

Warning: setTagValue(id, opts, value) is deprecated, please use tag(id, value)

Warning: setTagValue(id, opts, value) is deprecated, please use tag(id, value)

——————————————————— ✅ Script Success

↩ Returned: undefined

---

<div class="post-metadata">

**Author:** ![Torch1969](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/torch1969/32/33305_2.png) [@Torch1969](https://community.homey.app/u/Torch1969)\
**Post date:** [February 23, 2023, 8:56pm UTC](https://community.homey.app/t/help-how-to-create-an-app/58904/10 "2023-02-23T20:56:14Z")

</div>

Ok, almost great ;-), I assume you can solve this yourself (see example-tag.js)  
I think most elegant solution is to create a virtual sola panel device and open that one in this script en set corresponding capabilities.

---

<div class="post-metadata">

**Author:** ![Jeroen\_Tebbens](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jeroen_tebbens/32/62246_2.png) [@Jeroen\_Tebbens](https://community.homey.app/u/Jeroen_Tebbens)\
**Post date:** [February 23, 2023, 9:01pm UTC](https://community.homey.app/t/help-how-to-create-an-app/58904/11 "2023-02-23T21:01:05Z")

</div>

Fixed the tag. Yeah already have virtual solar device that I sync with webhook. Thx!

---

<div class="post-metadata">

**Author:** ![Kim\_Kokholm](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/kim_kokholm/32/91519_2.png) [@Kim\_Kokholm](https://community.homey.app/u/Kim_Kokholm)\
**Post date:** [November 20, 2023, 11:08am UTC](https://community.homey.app/t/help-how-to-create-an-app/58904/12 "2023-11-20T11:08:30Z")

</div>

Hi All, I’m planning doing an app submission for this.

**Do you guys have any updated information on the api?** I’ve just reached out to the manufactorer through a contact form, regarding api. I’m not expecting any good api description.

I have my StecaGrid connected with LAN.  
The endpoints: gen.measurements.table.js and gen.yield.day.chart.js are not working for my hardware.

This is working for me: http://\< inverter-ip \>/yields.json?\_=1700471877531

I will post my findings here.  
Also I’m new to Homey

---

<div class="post-metadata">

**Author:** ![Kim\_Kokholm](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/kim_kokholm/32/91519_2.png) [@Kim\_Kokholm](https://community.homey.app/u/Kim_Kokholm)\
**Post date:** [November 24, 2023, 11:01am UTC](https://community.homey.app/t/help-how-to-create-an-app/58904/13 "2023-11-24T11:01:00Z")

</div>

Hi all, I’ve done the app now.  
Now available in app store:

> **[StecaGrid](https://homey.app/en-dk/app/com.steca.stecagrid/StecaGrid/)**
>
> Coolcept inverters for single-family houses and residential buildings

Feedback appreciated.

---

<div class="post-metadata">

**Author:** ![Torch1969](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/torch1969/32/33305_2.png) [@Torch1969](https://community.homey.app/u/Torch1969)\
**Post date:** [November 25, 2023, 7:59am UTC](https://community.homey.app/t/help-how-to-create-an-app/58904/14 "2023-11-25T07:59:12Z")

</div>

> [@\[APP\]\[Pro\] StecaGrid](https://community.homey.app/t/app-pro-stecagrid/95676):
>
> Thread for StecaGrid Feel free to add constructive feedback.
