Compare commits

..

No commits in common. "fef4f7a4aea6301cb04a18733d041eb2cf544043" and "d293fd60f212ad9f28a8e02f3d0e1552d012df3c" have entirely different histories.

2 changed files with 3 additions and 20 deletions

View file

@ -1,18 +0,0 @@
# solarmon
* charts solaredge inverter data using its REST api like their app also does
* sends alerts if around 12:00 no output is measured. Mine had died without a word last summer...
* alerting on your phone using pushover
* solaredge api has at least 15 mins resolution. Its response is cached to prevent overloading their server.
**start**
* clone this repo
* create .env file that contains
* SOLAREDGE_API_KEY
* SOLAREDGE_SITE_ID
* PUSHOVER_USER_ID
* PUSHOVER_API_KEY
* BIND_ADDR eg. 0.0.0.0:3000
* CALL_HOME url to include in the pushover notification
* cargo run
After successful startup a informational message is sent to pushover.

View file

@ -35,7 +35,7 @@ struct AppState {
}
#[tokio::main]
async fn main() -> axum::response::Result<()> {
async fn main() -> anyhow::Result<()> {
dotenv().ok();
let bind_addr = env::var("BIND_ADDR").expect("BIND_ADDR");
@ -59,11 +59,12 @@ async fn main() -> axum::response::Result<()> {
"/static",
ServiceBuilder::new().service(ServeDir::new("static")),
);
// .layer(LiveReloadLayer::new());
let listener = tokio::net::TcpListener::bind(bind_addr).await.unwrap();
println!("server on {}", listener.local_addr().unwrap());
report("started").await?;
axum::serve(listener, app).await.unwrap();
report("started");
Ok(())
}