Apsystems API down

Since Saturday the Apsystems unofficial REST getpowerinfo service has been down.

I have tried to write them to ask if this is intentional or not. They never respond to end user mail it seems.

Is anyone experiencing the same and is there an alternative way to get live data out of the Apsystems inverters?

Yes i have the same problem. I am make workaround and download date directly from ecu.
Here’s a snippet of code that does this:

self.url_power = f'http://{self.ecuip}/index.php/realtimedata/old_power_graph'
def get_data(self, time_stamp: datetime = datetime.today()) -> pd.DataFrame:

    data = {
        'date': time_stamp.strftime("%Y-%m-%d")
    }

    response = requests.post(self.url_power, headers=self.headers, data=data)

    if response.status_code != 200:
        try:
            response.raise_for_status()
        except Exception as e:
            msg = (
                'Bad status code! Response content = {}. Exception = {}'
                    .format(response.content, e))
            _LOG.exception(msg)
            raise e.__class__(msg)
    ans = {}
    energy = 0
    time_start_s = 0
    res = response.json()
    for record in res['power']:
        #print(record)


        time_actual = pd.Timestamp.fromtimestamp(record["time"]/1000)  # ,tz="Europe/Warsaw",tz="Europe/Warsaw"
        power =  record["each_system_power"]


        time_pass = time_actual.timestamp() - time_start_s
        if time_start_s == 0:
            time_pass = 300
        time_start_s = time_actual.timestamp()
        energy += power * time_pass / 3600
        ans[time_actual.round("5min")] = (power, energy)
    time_actual += pd.Timedelta(minutes=5)
    ans[time_actual.round("5min")] = (0, energy)
    return ans
    return

Thanks.
However that seems not to work for me.
Did you configure the ECU somehow to enable this?

No didn’t configure the ECU in any way. What type the ECU do you have?
I have this ECU:

Hi All,

First forum where I see same issue. Looks like the API does not respond for some days now.
On my side this does not work as I have a ECU-R requiring an authentication.
I think this direct access only works with ECU-C.

OvO

APsystems APS ECU R local inverters data pull - Share your Projects! / Custom Components - Home Assistant Community (home-assistant.io)
I found artical how to read from ecu-r

I write some code that allow download data from https://apsystemsema.com/

`# -- coding: utf-8 --
“”“Python “””

import pprint
import sys
import requests
from pprint import pprint
from requests.adapters import HTTPAdapter
from datetime import datetime, timedelta, date

class api:
url = “https://apsystemsema.com/ema/loginEMA.action
urlData = “https://apsystemsema.com/ema/ajax/getDashboardApiAjax/getDashboardEcuPowerOnCurrentDayAjax
headers = {‘User-Agent’: ‘Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0’}

def __init__(self,user:str,password:str):
    self.user = user
    self.password = password
    self.today = datetime.fromisoformat(date.today().isoformat())

def login(self):
    data = {'today':	datetime.today().strftime("%Y-%m-%d+%H:%M:%S"),
            'username':	self.user,
            'password':	self.password }
    session = requests.session()
    session.mount('https://', HTTPAdapter())

    # should be call twice to correctly display
    p = session.request("POST", self.url, data=data, headers=self.headers)

    headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0'}

    p = session.request("POST", self.urlData, headers=self.headers)
    pprint (p.json())

def main():

a = api(sys.argv[1],sys.argv[2])
a.login()

if name == ‘main’:
main()`