Web service that provides a REST API layer over the My Autarco site/API to get statistical data of your solar panels.
This repository has been archived on 2023-01-08. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
Paul van Tilburg 3c35c4fe72
Use fairing to read the My Autarco config (closes: #3)
* Read My Autarco credentials from `Rocket.toml`
* Remove custom config loading function and `autarco.toml.example`
* Update `Rocket.toml.example` but comment out the variables so that the
  user won't forget to set them
* Update `.gitignore`
* Update documentation
2023-01-03 17:12:26 +01:00
src Use fairing to read the My Autarco config (closes: #3) 2023-01-03 17:12:26 +01:00
.dockerignore Add support for building and running a Docker image 2020-10-10 21:15:19 +02:00
.gitignore Use fairing to read the My Autarco config (closes: #3) 2023-01-03 17:12:26 +01:00
Cargo.lock Cargo update 2022-10-17 19:54:57 +02:00
Cargo.toml Cargo update 2022-10-17 19:54:57 +02:00
Dockerfile Just use latest rust 1.x Docker image 2021-11-28 13:28:46 +01:00
LICENSE Add README.md, Rocket.toml.example and LICENSE file 2022-08-22 21:07:17 +02:00
README.md Add README.md, Rocket.toml.example and LICENSE file 2022-08-22 21:07:17 +02:00
Rocket.toml.example Use fairing to read the My Autarco config (closes: #3) 2023-01-03 17:12:26 +01:00
docker-compose.yml Update Rocket env vars for Rocket 0.5 2021-08-29 11:01:31 +02:00

README.md

Autarco Scaper

Autarco Scraper is a web service that provides a REST API layer over the My Autarco site/API to get statistical data of your solar panels.

Building & running

First you need to provide your My Autarco credentials in the file autarco.toml by setting the username and password. You can copy and modify autarco.toml.example for this:

# Put your My Autarco credentials below
username = "foo@domain.tld"
password = "secret"

Then, using Cargo, it is easy to build and run Autarco Scraper, just run:

$ cargo run --release
...
   Compiling autarco-scraper v0.1.1 (/path/to/autarco-scraper)
    Finished release [optimized] target(s) in 9m 26s
     Running `/path/to/autarco-scraper/target/release/autarco-scraper`

(Note that Rocket listens on 127.0.0.1:8000 by default for debug builds, i.e. builds when you don't add --release.)

You can provide Rocket with configuration to use a different address and/or port. Just create a Rocket.toml file that contains (or copy Rocket.toml.example):

[default]
address = "0.0.0.0"
port = 8080

This will work independent of the type of build. For more about Rocket's configuration, see: https://rocket.rs/v0.5-rc/guide/configuration/.

API endpoint

The / API endpoint provides the current statistical data of your solar panels once it has successfully logged into the My Autarco website using your credentials. There is no path and no query parameters, just:

GET /

Response

A response uses the JSON format and typically looks like this:

{"current_w":23, "total_kwh":6159, "last_updated":1661194620}

This contains the current production power (current_w) in Watt, the total of produced energy since installation (total_kwh) in kilowatt-hour and the (UNIX) timestamp that indicates when the information was last updated.

License

Autarco Scraper is licensed under the MIT license (see the LICENSE file or http://opensource.org/licenses/MIT).