Power Meter Reporter

View live Power Meter Reporter application demo with embedded widgets!

Usernames: admin, user1, user2, guest

Password: demo

The Power Meter Reporter application is open source. Its code is available on GitHub, where you can also find installation instructions: https://github.com/axibase/atsd-api-php/blob/master/Meters.md

External applications deliver custom reporting and industry-specific functionality on top of data collected in ATSD.

The Power Meter Reporter application was built with PHP using the ATSD PHP client. It displays power usage statistics collected with smart meters.

  • This PHP application consists of two pages: meter report (index.php) and summary report (summary.php).
  • The pages share the same header with user information and a left-hand menu with the list of meters.
  • The header and menu are imported into these php pages using include declaration.
  • The list of meters for the current user is obtained by querying ATSD with the name of entity group specified for this user in the users-group.ini file.
  • The list of users authorized to access this application is configured in Apache .htpasswd file using htdigest utility.
  • Requests for time series data generated by embedded widgets are sent to API Proxy (ApiProxy.php).
  • Requests for CSV reports are sent to CSV Report Generator (CsvGenerator.php).
  • API PHP proxy serves as a façade and performs validation that the entities specified in series data request belong to the list of entities that the user is authorized to view.
  • API PHP proxy acts as a client and transmits series request to ATSD database on behalf of the user. Response from ATSD is returned to the browser via the same API proxy eliminating direct communication between users and ATSD.

Meters are grouped into entity groups in ATSD.

Entity GroupMeters
org-001-entitiesvs-meter-pwr-001
vs-meter-pwr-002
vs-meter-pwr-003
org-002-entitiesvs-meter-pwr-004
vs-meter-pwr-005
org-all-entitiesvs-meter-pwr-001
vs-meter-pwr-002
vs-meter-pwr-003
vs-meter-pwr-004
vs-meter-pwr-005

Users are allowed to view entities belonging to particular entity groups. Users are mapped to entity groups in PHP code.

user001 -> org-001-entities
user002 -> org-002-entities
admin -> org-all-entities
guest -> none