Extract data from Autarco Solar panels

I would like to pick this up to make an integration for it, anyone who is interested in taking this up with me? (since I don’t have an inverter from autarco)

just sent jou on twitter a message. i have 2 inverters an would be glad to test it for you.
oh the scan interval has to be 120. otherwise you have to many requests from the server

1 Like

Hi,

New to HA. Tried following the steps above but still can’t get my PV to show in the energy panel. Yaml below. The sensors are reporting correctly but it’s not appearing on the energy tab. Can anyone advise please?


rest:
  - authentication: basic
    username: !secret autarco_username
    password: !secret autarco_password
    scan_interval: 120
    resource: https://my.autarco.com/api/m1/site/xxxxx/power
    sensor:
    - name: “pv_now”
      value_template: ”{{ value_json.stats.kpis.pv_today }}”
      unit_of_measurement: “kW”
      device_class: power
      state_class: measurement
  - authentication: basic
    username: !secret autarco_username
    password: !secret autarco_password
    scan_interval: 120
    resource: https://my.autarco.com/api/m1/site/xxxxxxx/energy
    sensor:
      - name: “pv_today”
        value_template: “{{ value_json.stats.kpis.pv_today }}“
        unit_of_measurement: “kWh”
        device_class: energy
        state_class: measurement
      - name: “pv_month”
        value_template: “{{ value_json.stats.kpis.pv_month }}“
        unit_of_measurement: “kWh”
        device_class: energy
        state_class: measurement
      - name: “pv_to_date”
        value_template: “{{ value_json.stats.kpis.pv_to_date }}“
        unit_of_measurement: “kWh”
        device_class: energy
        state_class: measurement
        
homeassistant:
  customize_glob:
    sensor.pv_to_date:
      last_reset: “1970-01-01T00:00:00+00:00”

Hi Zm007

You need to add the device class and the state class i think. You can not use the state class in the rest function

I read that state class got added to rest in the 2021.11 update - I’ve put it at the bottom anyway. Still doesn’t work :disappointed:. I’ve also changed the pv_now as I realised I’d made a mistake. Still not showing up though!

Solved by changing state_class: measurement to total_increasing for pv_to_date only. Takes a while until increase of 1kWh to be visual.

s6

Mark

I have an inverter from autarco but i don’t have any skills in making an integration. So i don’t know if i can help you.

By finally testing the integration :wink:, I had already done a lot of work like writing a python package: https://github.com/klaasnicolaas/python-autarco and I was already working on the integration: core/homeassistant/components/autarco at klaas-autarco · klaasnicolaas/core · GitHub.

But still I run into some problems to correctly create multiple inverter instances in the integration.

If anyone are interested, i have just now find out Autarco and Solis are same devices.

Hello,

I unfortunately can’t get it to work.
The sensors have been added successfully and I am receiving data. Adding (properly) in the energy dashboard does not work. I can select the sensor as an option, but no matter what I do, I don’t see any data appearing in the energy dashboard.

Here is my current config:

rest:
  - authentication: basic
    username: !secret Autarco_username
    password: !secret Autarco_password
    scan_interval: 120
    resource: https://my.autarco.com/api/m1/site/xxxxx/power
    sensor:
      - name: "pv_now"
        value_template: "{{ value_json.stats.kpis.pv_now/1000 }}"
        unit_of_measurement: "kW"
        device_class: energy
  - authentication: basic
    username: !secret Autarco_username
    password: !secret Autarco_password
    scan_interval: 120
    resource: https://my.autarco.com/api/m1/site/xxxxx/energy
    sensor:
      - name: "pv_today"
        value_template: "{{ value_json.stats.kpis.pv_today }}"
        unit_of_measurement: "kWh"
        device_class: energy
        state_class: measurement
      - name: "pv_month"
        value_template: "{{ value_json.stats.kpis.pv_month }}"
        unit_of_measurement: "kWh"
        device_class: energy
        state_class: measurement
      - name: "pv_to_date"
        value_template: "{{ value_json.stats.kpis.pv_to_date }}"
        unit_of_measurement: "kWh"
        device_class: energy
        state_class: total_increasing

I still have to wrap this up, maybe in the meantime I can solve the problems I ran into back then :sweat_smile:

aha, so adding it to the energy dashboard so that it also shows data doesn’t work (yet)?

How people approach it now with rest sensors should also work, you just have to make sure that it eventually gets the right attributes so that the energy dashboard recognizes it.

My response was mainly a note to myself, but an integration ultimately makes it easier to get data from Autarco into Home Assistant.

Hi,

I’m new here, and thanks for the code to integrate Autarco solar panels into HA. I used the code from the post from @Coowly and added it into my ‘configuration.yaml’ and this works. The python package from @klaasnicolaas was a bit to complicated for me (don’t know how to use it).

To overcome the kWh issue as mentioned by @mvroosmalen1970 I changed the following:
Used Riemann sum integral sensor (helper) and set pv_now as input. This will create a sensor that has kWh with 2 decimals. In my energy dashboard I selected this sensor instead of pv_to_date.

You can’t do much with the python package either, it’s a tool for future integration to retrieve the data. Something I still want to finish, but I’m running into some problems in realizing the integration.

1 Like

Hi Guido,

Nice work around, maybe to add additional info for others :slight_smile:
Select helper: Integration - Riemann sum integral sensor
Select these options
Integration method: Any of the three as this will result only in minor differences between the methods
Metric prefix: none
Time Unit: hour

You can set the correct value in Developer Tools->States. Enter the name of the helper and update the shown state*. Press set state. Its a pity the new value is not used in future calculations. Does someone have a solution?

s6

1 Like

Is it just me or have some values been removed or moved in the API response?

I had some problems yesterday and this morning, but everything is fine again now

Previously I could retrieve the following via a single API endpoint, but that is apparently gone now and you would have to request the data via both /power and /energy :thinking:

It might also be interesting if we could approach the Autarco inverters locally to retrieve data.

"stats": {
    "kpis": {
      "current_production": 200,
      "output_today": 4,
      "output_month": 58,
      "output_to_date": 10379
    }
  }

I managed to get some info directly from the inverter using

http://[INVERTER IP]/inverter.cgi

According to the manual username and password are ‘admin’ and ‘123456789’
With the info above I was able to get interesting info without using the Autarco cloud.

Unfortunately refresh rate still seems to be 5 minutes.