A monitoring system for the Outback Power Mate3. It processes the data stream, reformats it for logging, charting, and display on a web server.
The software is divided in three parts:
- Python script for receive and manage Mate3 datastream.
- PHP scripts for database records and query’s.
- HTML/JavaScript webpage for visual representation.
Gets and process datastream to send status to a webserver. This script can work standalone and show devices status in command line. Use the following options:
python monitormate.py –help
Usage: monitormate.py [options]
Options:
-h, --help
show this help message and exit
-p PORT, --port=PORT
Port to listen
-g, --get-status
Get all devices status
-f, --fxmodifier
Doubles voltage and divide current in 230V FX inverters
-s, --show-devices
Show connected devices to Mate3
-c, --continuous
Print data continuously
-d DEVICE_ADDRESS, --device-address=DEVICE_ADDRESS
Show specific device status
-i TIME_INTERVAL, --interval=TIME_INTERVAL
Time interval between reads in seconds. Use with -c
-j, --json
Prints json formatted string with all devices status to stdout
-n, --datetime
Include date and time and send to url. Use with -u.
-u URL, --send-json-url=URL
Send json via POST to specified url
-t TOKEN, --token=TOKEN
Include security token and send to url. Use with -u.
-r IP_PORT, --repeat-mate=IP_PORT
Re-send Mate3 datastream to specified ip and port in format IP:PORT
Gets a json string with devices status and record it in the database.
Gets data from database an returns a json string.
Visual representation of devices status and history. Works with getstatus.php for history and with matelog for “real time” status.
Configuration file. Contains database connection parameters, record interval, security token and time zone.
Init-style script for running monitormate automaticaly as a daemon. See your specific OS/distributions documentaiton for setting up daemons.
- Download monitormate and extract it.
- Rename the config files to config.php and labels.js (remove .sample)
- Edit the config and labels files to your liking.
- Use database.sql to create tables in your MySQL database. (I suggest phpAdmin to import)
- Copy the “Web Server” directory content to your web server.
- copy the "Data Stream Host" directory content to your host computer (if it's not the one you're using)
- Run monitormate.py on the host with the correct parameters.
Optionally, if you want it to run as a daemon on Linux (assumes Debian-style, modify as necessary):
- Copy monitormate.sh to /etc/init.d
- Edit monitormate.sh with the proper paths and arguments for your system.
- Run "sudo update-rc.d monitormate.sh defaults" to have monitormate automatically run in the background at boot time.
Example:
python monitormate.py -p2700 -u http://www.YOURSERVER.com/regstatus.php -i5 -t YOURTOKEN -c
Go to http://YOURSERVER/monitormate.html, maybe you have to wait a little depending your record interval.
You can send data stream directly to your remote server and run monitormate.py on it.
Time interval on monitormate.py only affects to “real time”. Interval for database record is in config.php.
You can use the -r parameter to resend datastream to other computer or to send to the same using other port and use again the python script to see status in command line.