Power Meter Reporter
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
- 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.
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