This is a small bot for pulling feed data from EmonCMS and posting it to a Mastodon bot account;
This app is configured via environment variables:
- CULTURE - .NET culture name to use for numeric and currency formating
- TZ - Set timezone within the container
- BOT_NAME - Name of the bot to ouput in the mastodon status message
- HASHTAGS - Additional hashtags to add to the status
- EMONCMS_BASE_URI - Base url of your cloud or self hosted EmonCMS intall
- EMONCMS_READ_API_KEY - Readonly API key for EmonCMS
- EMONCMS_SOLAR_KWH_FEED_ID - Feed ID for solar generation kWh
- EMONCMS_USE_KWH_FEED_ID - Feed ID for household usage kWh
- EMONCMS_SOLAR_FEED_ID - Feed ID for solar generation
- EMONCMS_USE_FEED_ID - Feed ID for household usage
- EMONCMS_IMPORT_KWH_FEED_ID - Feed ID for import kWh
- EMONCMS_EXPORT_KWH_FEED_ID - Feed ID for export kWh
- RATE - Power rate in fractional dollars (ie 28.5¢/kWh would be configured as 0.285)
- MASTODON_URI - URI for the mastodon instance (ie https://botsin.space)
- MASTODON_API_KEY - API Key for API application see below
- PUBLISH - Set this to false to just output the post to STDOUT and bypass sending to mastodon, useful for testing
- Make graphs/output more configurable
- Add hourly graphs/statistics
- dotnet restore
- dotnet build
- set environment variables as per above (or create a appsettings.json)
- dotnet run
- Login to your bot mastodon instance
- Navigate to Edit Profile
- Navigate to Development
- Click New Application
- Name application whatever you like
- Give the application read, write:statuses, write:media scopes
- Hit submit
- Use the value from Your Access Token for MASTODON_API_KEY
docker run \
-it --rm \
-e BOT_NAME="Test Bot" \
-e HASHTAGS="#solar" \
-e EMONCMS_BASE_URI=https://<emoncms host/ip>:port\
-e EMONCMS_READ_API_KEY=<read api key> \
-e EMONCMS_SOLAR_KWH_FEED_ID=<solar kwh feed id>\
-e EMONCMS_USE_KWH_FEED_ID=<use kwh feed id> \
-e EMONCMS_SOLAR_FEED_ID=<solar feed id>\
-e EMONCMS_USE_FEED_ID=<use feed id> \
-e EMONCMS_IMPORT_KWH_FEED_ID=<import feed id> \
-e EMONCMS_EXPORT_KWH_FEED_ID=<export feed id> \
-e RATE=<power rate> \
-e MASTODON_URI=https://<mastodon host> \
-e MASTODON_API_KEY=<mastodon app access token> \
-n emoncms-masto \
msroest/emoncms-masto
