https://github.com/smartthingscommunity/virtual-solar-smart-meter
https://github.com/smartthingscommunity/virtual-solar-smart-meter
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/smartthingscommunity/virtual-solar-smart-meter
- Owner: SmartThingsCommunity
- Created: 2023-05-19T21:28:05.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-19T21:30:26.000Z (almost 3 years ago)
- Last Synced: 2025-05-19T00:12:38.466Z (10 months ago)
- Language: JavaScript
- Size: 55.7 KB
- Stars: 0
- Watchers: 5
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Virtual Solar Smart Meter
This SmartApp is an example of how to use the SmartThings API to create a virtual device that
represents the current power usage of a home. It also shows how to create a virtual device that
represents the power production of a home's solar panels. These devices integrate with the
SmartThings Energy service in the SmartThings mobile app.
## File Structure
* definitions
* apps
* lambda.json — example Lambda SmartApp definition
* webhook.json — example WebHook SmartApp definition
* profiles
* i18n
* en.json — defines friendly names for the power meter device profile components
* power-meter.json — power meter device profile definition
* solar-panel.json — solar panel device profile definition
* locales
* en.json — English version of the app configuration page text
* src
* handlers
* monthly-reset.js — scheduled event handler that resets the energy usage at the first of each month
* page1.js — handler for SmartApp configuration page
* uninstaled.js — handler called when the app is removed from a location
* updated.js — handler called when the app is installed or updated
* lib
* device.js — creates energy meter and solar panel devices
* house-model.js — simulates house energy usage
* solar-panel-model.js — simulates solar panel energy production
* index.js — AWS Lambda handler that calls the SmartApp
* server.js — web server that calls the SmartApp
* smartapp.js — the SmartApp implementation
* test — unit tests
* .env — environment variables used by the server
* .env.example — example .env file
* .gitignore — files to be ignored by git
* package.json — NodeJS package definition
* README.md — this file
* serverless.yml — Serverless configuration file for deploying to AWS Lambda