Skip to content

A cli tool for the unofficial SPAN.io smart panel.

Notifications You must be signed in to change notification settings

patniemeyer/SPAN-panel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SPAN Smart Panel CLI Tool

This is a small python cli script to gather circuit power usage from a SPAN.io smart panel and display it in a sorted fashion sort of like the "top" command. This is based on work by hyun007.

This is experimental. SPAN does not yet offer an official API, so it may disappear or break at any time.

Alt text

Usage

usage: span.py [-h] [--ip IP] [--token TOKEN] [-z]

Display Span Status

options:
  -h, --help            show this help message and exit
  --ip IP               SPAN ip address
  --token TOKEN         bearer token
  -z, --include-zeroes  Include circuits with zero power

Getting the token and Testing

The SPAN Web UI login page will appear on the local IP of the SPAN panel ('http' port 80). It prompts for a password or instructs that you can push the door button (the switch at the top that closes when you close the door) three times to open up access for a set time. You can then log into the web UI without the password. At that point you can see the calls that it is making by e.g. using your web browsers developer tools... Look at the request header of one of the /circuits requests and just copy the bearer token from it. Paste it in replacing the ones in the examples above, e.g.

You can test access by fetching the circuits endpoint:

curl -X GET "http://[MY IP]/api/v1/circuits" -H "Authorization: bearer [MY TOKEN]“

About

A cli tool for the unofficial SPAN.io smart panel.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages