hassio-addons/upsmon/README.md

41 lines
1.0 KiB
Markdown
Raw Normal View History

2018-11-08 21:22:01 +00:00
## Network UPS Tools - netclient
2018-11-08 20:56:10 +00:00
2018-11-08 21:22:01 +00:00
[Network UPS Tools](http://networkupstools.org/) is used to connect to another machine running the same software.
You just need to specify some connection parameters. You can also configure the shutdown delay (in minutes).
2018-11-22 12:10:16 +00:00
SHUTDOWNCMD "/sbin/shutdown -h +0"
"delay": "5" non va bene, perchè è solo per master mode. E' il master che decide quando fare SHUTDOWN
- in batteria
- master manda NOTIFY_SHUTDOWN
- master aspetta FINALDELAY seconds
- master esegue SHUTDOWNCMD
usare hassio api
POST /host/shutdown
On error / Code 400:
{
"result": "error",
"message": ""
}
On success / Code 200:
{
"result": "ok",
"data": { }
}
For access to API you need set the X-HASSIO-KEY they will be available for Add-ons/HomeAssistant with envoriment HASSIO_TOKEN.
https://github.com/home-assistant/hassio/blob/master/API.md
https://developers.home-assistant.io/docs/en/hassio_addon_communication.html
aggiungere dipendenza curl
curl -H "X-HASSIO-KEY: $HASSIO_TOKEN" -X POST http://hassio/host/shutdown