powercom-upsmonpro-state-parser
[[TOC]]
Overview
powercom-upsmonpro-state-parser is a parser of POWERCOM UPS state provided as plain text by Windows versions of UPSMON Pro via HTTP (by default on port 8000) and as a plain text file (C:\Program Files\UPSMONPRO\UPSMONWebSer\ups.txt
).
The parser is published on crates.io. To use it, add the following to your Cargo.toml
file:
[]
= "1.0.0"
This library is unofficial and is not endorsed by POWERCOM.
Examples
This simplified example program reads UPS state from hardcoded URL using reqwest crate (blocking client for simplicity), formats and writes it to standard output.
extern crate powercom_upsmonpro_state_parser;
extern crate reqwest;
use FromStr;
use ;
// replace 127.0.0.1 with actual
// ip of the machine where UPSMON PRO is installed.
const UPS_STATE_URL: &str =
"http://127.0.0.1:8000/ups.txt";
Example output:
Connection status: Connected, UPS Mode: Normal, Mains state: Ok, Vin=228 V, Vout=228 V, f=50 Hz, chg=100 %, load=0 %, T=30 C