mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-24 01:31:51 +02:00
initial build
This commit is contained in:
59
enedisGateway2MQTT/Dockerfile
Normal file
59
enedisGateway2MQTT/Dockerfile
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
FROM m4dm4rtig4n/enedisgateway2mqtt:latest
|
||||||
|
|
||||||
|
# Base system
|
||||||
|
ARG BASHIO_VERSION=0.13.1
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
################
|
||||||
|
# Install apps #
|
||||||
|
################
|
||||||
|
apt-get clean \
|
||||||
|
&& apt-get update \
|
||||||
|
&& apt-get install -y \
|
||||||
|
jq \
|
||||||
|
curl \
|
||||||
|
&& apt-get clean \
|
||||||
|
\
|
||||||
|
##################
|
||||||
|
# Install bashio #
|
||||||
|
##################
|
||||||
|
&& mkdir -p /tmp/bashio \
|
||||||
|
&& curl -L -f -s "https://github.com/hassio-addons/bashio/archive/v${BASHIO_VERSION}.tar.gz" \
|
||||||
|
| tar -xzf - --strip 1 -C /tmp/bashio \
|
||||||
|
&& mv /tmp/bashio/lib /usr/lib/bashio \
|
||||||
|
&& ln -s /usr/lib/bashio/bashio /usr/bin/bashio \
|
||||||
|
&& rm -rf /tmp/bashio
|
||||||
|
|
||||||
|
# Copy root filesystem
|
||||||
|
COPY rootfs /
|
||||||
|
RUN chmod 777 /run.sh
|
||||||
|
ENTRYPOINT [ "/usr/bin/env" ]
|
||||||
|
CMD ["/run.sh"]
|
||||||
|
VOLUME [ "/data" ]
|
||||||
|
|
||||||
|
### LABELS
|
||||||
|
ARG BUILD_ARCH
|
||||||
|
ARG BUILD_DATE
|
||||||
|
ARG BUILD_DESCRIPTION
|
||||||
|
ARG BUILD_NAME
|
||||||
|
ARG BUILD_REF
|
||||||
|
ARG BUILD_REPOSITORY
|
||||||
|
ARG BUILD_VERSION
|
||||||
|
LABEL \
|
||||||
|
io.hass.name="${BUILD_NAME}" \
|
||||||
|
io.hass.description="${BUILD_DESCRIPTION}" \
|
||||||
|
io.hass.arch="${BUILD_ARCH}" \
|
||||||
|
io.hass.type="addon" \
|
||||||
|
io.hass.version=${BUILD_VERSION} \
|
||||||
|
maintainer="alexbelgium (https://github.com/alexbelgium)" \
|
||||||
|
org.opencontainers.image.title="${BUILD_NAME}" \
|
||||||
|
org.opencontainers.image.description="${BUILD_DESCRIPTION}" \
|
||||||
|
org.opencontainers.image.vendor="Home Assistant Add-ons" \
|
||||||
|
org.opencontainers.image.authors="alexbelgium (https://github.com/alexbelgium)" \
|
||||||
|
org.opencontainers.image.licenses="MIT" \
|
||||||
|
org.opencontainers.image.url="https://github.com/alexbelgium" \
|
||||||
|
org.opencontainers.image.source="https://github.com/${BUILD_REPOSITORY}" \
|
||||||
|
org.opencontainers.image.documentation="https://github.com/${BUILD_REPOSITORY}/blob/main/README.md" \
|
||||||
|
org.opencontainers.image.created=${BUILD_DATE} \
|
||||||
|
org.opencontainers.image.revision=${BUILD_REF} \
|
||||||
|
org.opencontainers.image.version=${BUILD_VERSION}
|
||||||
37
enedisGateway2MQTT/README.md
Normal file
37
enedisGateway2MQTT/README.md
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
# Home assistant add-on: Enedisgateway2mqtt
|
||||||
|
|
||||||
|
[![Donate][donation-badge]](https://www.buymeacoffee.com/alexbelgium)
|
||||||
|
|
||||||
|
[donation-badge]: https://img.shields.io/badge/Buy%20me%20a%20coffee-%23d32f2f?logo=buy-me-a-coffee&style=flat&logoColor=white
|
||||||
|
|
||||||
|
![Supports
|
||||||
|
Architecture][aarch64-shield] ![Supports amd64 Architecture][amd64-shield] ![Supports armhf Architecture][armhf-shield] ![Supports armv7 Architecture][armv7-shield]
|
||||||
|
|
||||||
|
## About
|
||||||
|
|
||||||
|
Enedisgateway2mqtt use Enedis Gateway API to send data in your MQTT Broker.
|
||||||
|
See its github for all informations : https://github.com/m4dm4rtig4n/enedisgateway2mqtt/blob/master/README.md
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
The installation of this add-on is pretty straightforward and not different in
|
||||||
|
comparison to installing any other Hass.io add-on.
|
||||||
|
|
||||||
|
1. [Add my Hass.io add-ons repository][repository] to your Hass.io instance.
|
||||||
|
1. Install this add-on.
|
||||||
|
1. Click the `Save` button to store your configuration.
|
||||||
|
1. Start the add-on.
|
||||||
|
1. Check the logs of the add-on to see if everything went well.
|
||||||
|
1. Carefully configure the add-on to your preferences, see the official documentation for for that.
|
||||||
|
|
||||||
|
### Configuration
|
||||||
|
|
||||||
|
Configure the addon through its options page.
|
||||||
|
See this page for configuration : https://hub.docker.com/r/m4dm4rtig4n/enedisgateway2mqtt
|
||||||
|
|
||||||
|
[smb-shield]: https://img.shields.io/badge/SMB--green?style=plastic.svg
|
||||||
|
[repository]: https://github.com/alexbelgium/hassio-addons
|
||||||
|
[aarch64-shield]: https://img.shields.io/badge/aarch64-yes-green.svg
|
||||||
|
[amd64-shield]: https://img.shields.io/badge/amd64-yes-green.svg
|
||||||
|
[armhf-shield]: https://img.shields.io/badge/armhf-yes-green.svg
|
||||||
|
[armv7-shield]: https://img.shields.io/badge/armv7-yes-green.svg
|
||||||
38
enedisGateway2MQTT/apparmor.txt
Normal file
38
enedisGateway2MQTT/apparmor.txt
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
#include <tunables/global>
|
||||||
|
|
||||||
|
profile inadyn_addon flags=(attach_disconnected,mediate_deleted) {
|
||||||
|
#include <abstractions/base>
|
||||||
|
|
||||||
|
capability,
|
||||||
|
file,
|
||||||
|
mount,
|
||||||
|
umount,
|
||||||
|
remount,
|
||||||
|
capability setgid,
|
||||||
|
capability setuid,
|
||||||
|
|
||||||
|
|
||||||
|
# S6-Overlay
|
||||||
|
/bin/** ix,
|
||||||
|
/usr/bin/** ix,
|
||||||
|
/usr/lib/bashio/** ix,
|
||||||
|
/etc/s6/** rix,
|
||||||
|
/run/s6/** rix,
|
||||||
|
/etc/services.d/** rwix,
|
||||||
|
/etc/cont-init.d/** rwix,
|
||||||
|
/etc/cont-finish.d/** rwix,
|
||||||
|
/init rix,
|
||||||
|
/var/run/** mrwkl,
|
||||||
|
/var/run/ mrwkl,
|
||||||
|
/dev/i2c-1 mrwkl,
|
||||||
|
|
||||||
|
# Data access
|
||||||
|
/data/** rw,
|
||||||
|
|
||||||
|
# suppress ptrace denials when using 'docker ps' or using 'ps' inside a container
|
||||||
|
ptrace (trace,read) peer=docker-default,
|
||||||
|
|
||||||
|
# docker daemon confinement requires explict allow rule for signal
|
||||||
|
signal (receive) set=(kill,term) peer=/usr/bin/docker,
|
||||||
|
|
||||||
|
}
|
||||||
34
enedisGateway2MQTT/config.json
Normal file
34
enedisGateway2MQTT/config.json
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
{
|
||||||
|
"arch": ["aarch64", "amd64", "armv7", "armhf"],
|
||||||
|
"description": "use Enedis Gateway API to send data in your MQTT Broker",
|
||||||
|
"name": "Enedisgateway2mqtt DO NOT USE",
|
||||||
|
"options": {
|
||||||
|
"ACCESS_TOKEN": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
|
||||||
|
"PDL": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
|
||||||
|
"MQTT_HOST": ""
|
||||||
|
},
|
||||||
|
"schema": {
|
||||||
|
"ACCESS_TOKEN": "str",
|
||||||
|
"PDL": "str",
|
||||||
|
"MQTT_HOST": "str",
|
||||||
|
"MQTT_PORT": "str?",
|
||||||
|
"MQTT_PREFIX": "str?",
|
||||||
|
"MQTT_CLIENT_ID": "str?",
|
||||||
|
"MQTT_USERNAME": "str?",
|
||||||
|
"MQTT_PASSWORD": "str?",
|
||||||
|
"RETAIN": "str?",
|
||||||
|
"QOS": "str?",
|
||||||
|
"GET_CONSUMPTION": "str?",
|
||||||
|
"GET_PRODUCTION": "str?",
|
||||||
|
"HA_AUTODISCOVERY": "str?",
|
||||||
|
"HA_AUTODISCOVERY_PREFIX": "str?",
|
||||||
|
"CONSUMPTION_PRICE_BASE": "str?",
|
||||||
|
"CONSUMPTION_PRICE_HC": "str?",
|
||||||
|
"CONSUMPTION_PRICE_HP": "str?",
|
||||||
|
"CARD_MYENEDIS": "str?"
|
||||||
|
},
|
||||||
|
"slug": "enedisgateway2mqtt",
|
||||||
|
"upstream": "0.5.6",
|
||||||
|
"url": "https://github.com/alexbelgium/hassio-addons",
|
||||||
|
"version": "0.5.6"
|
||||||
|
}
|
||||||
BIN
enedisGateway2MQTT/icon.png
Normal file
BIN
enedisGateway2MQTT/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
BIN
enedisGateway2MQTT/logo.png
Normal file
BIN
enedisGateway2MQTT/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
57
enedisGateway2MQTT/rootfs/run.sh
Normal file
57
enedisGateway2MQTT/rootfs/run.sh
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
#!/usr/bin/env bashio
|
||||||
|
|
||||||
|
# ==============================================================================
|
||||||
|
# Home Assistant Community Add-on: Base Images
|
||||||
|
# Displays a simple add-on banner on startup
|
||||||
|
# ==============================================================================
|
||||||
|
if bashio::supervisor.ping; then
|
||||||
|
bashio::log.blue \
|
||||||
|
'-----------------------------------------------------------'
|
||||||
|
bashio::log.blue " Add-on: $(bashio::addon.name)"
|
||||||
|
bashio::log.blue " $(bashio::addon.description)"
|
||||||
|
bashio::log.blue \
|
||||||
|
'-----------------------------------------------------------'
|
||||||
|
|
||||||
|
bashio::log.blue " Add-on version: $(bashio::addon.version)"
|
||||||
|
if bashio::var.true "$(bashio::addon.update_available)"; then
|
||||||
|
bashio::log.magenta ' There is an update available for this add-on!'
|
||||||
|
bashio::log.magenta \
|
||||||
|
" Latest add-on version: $(bashio::addon.version_latest)"
|
||||||
|
bashio::log.magenta ' Please consider upgrading as soon as possible.'
|
||||||
|
else
|
||||||
|
bashio::log.green ' You are running the latest version of this add-on.'
|
||||||
|
fi
|
||||||
|
|
||||||
|
bashio::log.blue " System: $(bashio::info.operating_system)" \
|
||||||
|
" ($(bashio::info.arch) / $(bashio::info.machine))"
|
||||||
|
bashio::log.blue " Home Assistant Core: $(bashio::info.homeassistant)"
|
||||||
|
bashio::log.blue " Home Assistant Supervisor: $(bashio::info.supervisor)"
|
||||||
|
|
||||||
|
bashio::log.blue \
|
||||||
|
'-----------------------------------------------------------'
|
||||||
|
bashio::log.blue \
|
||||||
|
' Please, share the above information when looking for help'
|
||||||
|
bashio::log.blue \
|
||||||
|
' or support in, e.g., GitHub, forums or the Discord chat.'
|
||||||
|
bashio::log.green \
|
||||||
|
' https://github.com/alexbelgium/hassio-addons'
|
||||||
|
bashio::log.blue \
|
||||||
|
'-----------------------------------------------------------'
|
||||||
|
fi
|
||||||
|
|
||||||
|
#################
|
||||||
|
# Create config #
|
||||||
|
#################
|
||||||
|
echo "Setting variables"
|
||||||
|
echo "................."
|
||||||
|
|
||||||
|
for VARIABLES in "ACCESS_TOKEN" "PDL" "MQTT_HOST" "MQTT_PORT" "MQTT_PREFIX" "MQTT_CLIENT_ID" "MQTT_USERNAME" "MQTT_PASSWORD" "RETAIN" "QOS" "GET_CONSUMPTION" "GET_PRODUCTION" "HA_AUTODISCOVERY" "HA_AUTODISCOVERY_PREFIX" "CONSUMPTION_PRICE_BASE" "CONSUMPTION_PRICE_HC" "CONSUMPTION_PRICE_HP" "CARD_MYENEDIS"; do
|
||||||
|
[ bashio::config.has_value "$VARIABLES" ] && export $VARIABLES=$(bashio::config "$VARIABLES") && echo "$VARIABLES set to $(bashio::config "$VARIABLES")"
|
||||||
|
done
|
||||||
|
|
||||||
|
bashio::log.info "Starting the app"
|
||||||
|
|
||||||
|
##############
|
||||||
|
# Launch App #
|
||||||
|
##############
|
||||||
|
python -u /app/main.py
|
||||||
Reference in New Issue
Block a user