Skip to content

Schermers/DynamicTariff2MQTT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DynamicTariff2MQTT

Dynamic Tariff 2 MQTT

What is it?

This is an Azure Function App that retrieves and stores Energy prices (from Enever.nl) and publish this to MQTT. Next to the prices it will publish statistics as well like:

  • Current price
  • Next hour price
  • Average price
  • Lowest price
  • Highest price
  • Hours above average
  • and more..

This function app is written in PowerShell and does require the dll file 'M2Mqtt.Net.dll' in the modules folder. Downloadble from NuGet (nuget.exe install M2Mqtt -o c:\lib)

Enever.nl

This function app does retrieve its data from enever.nl. You can easily request an API token to use the pricefeed that is listed there. https://enever.nl/prijzenfeeds/

How to use it

Prerequisites

  1. Enever.nl API token
  2. Docker-Compose (or docker)
  3. You need an Azure functions container. More info: Azure Functions Powershell

Azure function app (PowerShell)

This function app will run the script every hour. Look at the docker-comopose.yml for the docker setup that contains:

  1. Azure Functions container
  2. Azureite (storage account emulator)

Next steps

  1. Download the Function Apps folder to '/home/{USER}/Function Apps'
  2. Download the .env.azfunc file next to your docker-compose.yml file
  3. Update the .env.azfunc file with its environment variables (like Enever API token, MQTT server, etc)

Optional

  • ElectricSupplier <If you want to apply a filter on energy supplier (ZP e.g.)>
  • GasSupplier <If you want to apply a filter on energy supplier (ZP e.g.)>
  • EnableLog

Support

This script was not possible without the help of others. Especially about the MQTT part: https://jackgruber.github.io/2019-06-05-ps-mqtt/

About

Dynamic Tariff 2 MQTT

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published