An open API service indexing awesome lists of open source software.

https://github.com/manelix2000/docker-electricity-spain-pvpc-chart

Docker image to show Spain Electricity price in HomeKit
https://github.com/manelix2000/docker-electricity-spain-pvpc-chart

docker docker-compose homebridge homekit pvpc spain

Last synced: 2 months ago
JSON representation

Docker image to show Spain Electricity price in HomeKit

Awesome Lists containing this project

README

          

# Spain Electricity Price Graph

## πŸ“˜ Introduction

Docker image to broadcast Spain electricity prices as a camara feed to use with [Homebridge Camera FFmpeg](https://github.com/homebridge-plugins/homebridge-camera-ffmpeg) and integrate it into HomeKit.

Prices are loaded from **Red ElΓ©ctrica** [ESIOS API](https://api.esios.ree.es/). You will need a *personal token* (you can request it [here](https://api.esios.ree.es/)).

Home App

Sample widget 1

Camera Widget

Sample widget 2

## βœ… Project structure

```
project-root/
β”œβ”€β”€ docker-compose.yml
β”œβ”€β”€ README.md
└── prices/
β”œβ”€β”€ Dockerfile
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ prices_server.py
β”œβ”€β”€ prices_generator.py
└── images/ # Directory to hold price png's
```

## πŸ” Explanation

- ```docker-compose.yml```: docker compose configuration
- ```prices/Dockerfile```: docker build configuration

## πŸ› οΈ Installation

1. Copy files into your docker installation
2. Execute
```
docker compose up --build -d
```

## πŸ§ͺ Test Installation

Open your favourite browser to:
1. *Camera feed*
```
http://:8080/prices
````
2. *Camera snapshot*
```
http://:8080/prices.png
````

## πŸ› οΈ Docker compose environment values

Change values as your needs:
```
version: '3.8'

services:
pvpc_prices_server:
build: ./prices
container_name: pvpc-prices-server
restart: unless-stopped
ports:
- "8080:8080"
environment:
- TZ=Europe/Madrid
- ESIOS_API_TOKEN=_your_esios_token_here_

```

## πŸ› οΈ Integration with your homebridge-camera-ffmpeg plugin

Once you have your docker image up, install the homebridge plugin [Homebridge Camera FFmpeg](https://github.com/homebridge-plugins/homebridge-camera-ffmpeg) and configure it as follows:

- ```source```:
-f mjpeg -i http://:8080/prices
- ```stillImageSource```: -i http://:8080/prices.png
- ```maxStreams```: 2
- ```maxWidth```: 800
- ```maxHeight```: 600
- ```maxFPS```: 1