diff --git a/enedisgateway2mqtt_dev/CHANGELOG.md b/enedisgateway2mqtt_dev/CHANGELOG.md index 851a5e7fa..7af09eaba 100644 --- a/enedisgateway2mqtt_dev/CHANGELOG.md +++ b/enedisgateway2mqtt_dev/CHANGELOG.md @@ -1,15 +1,22 @@ +- Migration to MyElectricalData - WARNING : update to supervisor 2022.11 before installing +- Add codenotary sign +- New standardized logic for Dockerfile build and packages installation ## 0.8.2-dev (26-11-2022) + - Update to latest version from m4dm4rtig4n/enedisgateway2mqtt ## 0.8.0-dev (27-04-2022) + - Update to latest version from m4dm4rtig4n/enedisgateway2mqtt ## 0.7.7 (27-04-2022) + - Update to latest version from m4dm4rtig4n/enedisgateway2mqtt ## 0.8.0-dev (07-04-2022) + - Update to latest version from m4dm4rtig4n/enedisgateway2mqtt - Add codenotary sign - New standardized logic for Dockerfile build and packages installation diff --git a/enedisgateway2mqtt_dev/Dockerfile b/enedisgateway2mqtt_dev/Dockerfile index f35b2851d..858b662d2 100644 --- a/enedisgateway2mqtt_dev/Dockerfile +++ b/enedisgateway2mqtt_dev/Dockerfile @@ -15,7 +15,7 @@ ################# ARG BUILD_UPSTREAM="0.8.2-dev" -FROM m4dm4rtig4n/enedisgateway2mqtt:$BUILD_UPSTREAM +FROM m4dm4rtig4n/myelectricaldata:dev-latest ################## diff --git a/enedisgateway2mqtt_dev/README.md b/enedisgateway2mqtt_dev/README.md index f59fd2e53..f0095033d 100644 --- a/enedisgateway2mqtt_dev/README.md +++ b/enedisgateway2mqtt_dev/README.md @@ -1,10 +1,10 @@ -# Home assistant add-on: Enedisgateway2mqtt +# Home assistant add-on: MyElectricalData [![Donate][donation-badge]](https://www.buymeacoffee.com/alexbelgium) -![Version](https://img.shields.io/badge/dynamic/json?label=Version&query=%24.version&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Fenedisgateway2mqtt_dev%2Fconfig.json) -![Ingress](https://img.shields.io/badge/dynamic/json?label=Ingress&query=%24.ingress&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Fenedisgateway2mqtt_dev%2Fconfig.json) -![Arch](https://img.shields.io/badge/dynamic/json?color=success&label=Arch&query=%24.arch&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Fenedisgateway2mqtt_dev%2Fconfig.json) +![Version](https://img.shields.io/badge/dynamic/json?label=Version&query=%24.version&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Fenedisgateway2mqtt%2Fconfig.json) +![Ingress](https://img.shields.io/badge/dynamic/json?label=Ingress&query=%24.ingress&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Fenedisgateway2mqtt%2Fconfig.json) +![Arch](https://img.shields.io/badge/dynamic/json?color=success&label=Arch&query=%24.arch&url=https%3A%2F%2Fraw.githubusercontent.com%2Falexbelgium%2Fhassio-addons%2Fmaster%2Fenedisgateway2mqtt%2Fconfig.json) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/9c6cf10bdbba45ecb202d7f579b5be0e)](https://www.codacy.com/gh/alexbelgium/hassio-addons/dashboard?utm_source=github.com&utm_medium=referral&utm_content=alexbelgium/hassio-addons&utm_campaign=Badge_Grade) [![GitHub Super-Linter](https://github.com/alexbelgium/hassio-addons/workflows/Lint%20Code%20Base/badge.svg)](https://github.com/marketplace/actions/super-linter) @@ -20,12 +20,24 @@ _Thanks to everyone having starred my repo! To star it click on the image below, ## 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 +See its github for all informations : https://github.com/m4dm4rtig4n/myelectricaldata ## Configuration Install, then start the addon a first time to initialize the templates. -Everything is configured using the config.yaml file found in /config/enedisgateway2mqtt/enedisgateway2mqtt.conf. + +Options can be configured through two ways : + +- Addon options + +```yaml +CONFIG_LOCATION: /config/enedisgateway2mqtt/enedisgateway2mqtt.conf # Sets the location of the config.yaml (see below) +mqtt_autodiscover: true # Shows in the log the detail of the mqtt local server (if available). It can then be added to the config.yaml file. +TZ: Europe/Paris # Sets a specific timezone +``` + +- Config.yaml + Everything is configured using the config.yaml file found in /config/enedisgateway2mqtt/enedisgateway2mqtt.conf. The complete list of options can be seen here : https://github.com/m4dm4rtig4n/enedisgateway2mqtt#environment-variable diff --git a/enedisgateway2mqtt_dev/config.json b/enedisgateway2mqtt_dev/config.json index 4d8ba2d6c..7ff766c4b 100644 --- a/enedisgateway2mqtt_dev/config.json +++ b/enedisgateway2mqtt_dev/config.json @@ -5,19 +5,23 @@ "armv7" ], "codenotary": "alexandrep.github@gmail.com", - "description": "use Enedis Gateway API to send data in your MQTT Broker (latest-dev channel)", + "description": "use Enedis Gateway API to send data in your MQTT Broker (latest channel)", "image": "ghcr.io/alexbelgium/enedisgateway2mqtt_dev-{arch}", "map": [ "config:rw" ], - "name": "Enedisgateway2mqtt Dev", + "name": "MyElectricalData Dev", "options": { "CONFIG_LOCATION": "/config/enedisgateway2mqtt_dev/config.yaml", - "TZ": "Europe/Paris" + "TZ": "Europe/Paris", + "mqtt_autodiscover": true, + "verbose": true }, "schema": { "CONFIG_LOCATION": "str", - "TZ": "str?" + "TZ": "str?", + "mqtt_autodiscover": "bool", + "verbose": "bool" }, "services": [ "mqtt:want" diff --git a/enedisgateway2mqtt_dev/rootfs/etc/cont-init.d/91-mqtt_autodiscover.sh b/enedisgateway2mqtt_dev/rootfs/etc/cont-init.d/91-mqtt_autodiscover.sh new file mode 100644 index 000000000..e72a3f600 --- /dev/null +++ b/enedisgateway2mqtt_dev/rootfs/etc/cont-init.d/91-mqtt_autodiscover.sh @@ -0,0 +1,26 @@ +#!/usr/bin/with-contenv bashio +# shellcheck shell=bash +# shellcheck disable=SC2155 + +##################### +# Autodiscover mqtt # +##################### + +if bashio::config.true 'mqtt_autodiscover'; then + bashio::log.info "mqtt_autodiscover is defined in options, attempting autodiscovery..." + # Check if available + if ! bashio::services.available "mqtt"; then bashio::exit.nok "No internal MQTT service found. Please install Mosquitto broker"; fi + # Get variables + bashio::log.info "... MQTT service found, fetching server detail (you can enter those manually in your config file) ..." + export MQTT_HOST=$(bashio::services mqtt "host") + export MQTT_PORT=$(bashio::services mqtt "port") + export MQTT_SSL=$(bashio::services mqtt "ssl") + export MQTT_USERNAME=$(bashio::services mqtt "username") + export MQTT_PASSWORD=$(bashio::services mqtt "password") + # Export variables + for variables in "MQTT_HOST=$MQTT_HOST" "MQTT_PORT=$MQTT_PORT" "MQTT_SSL=$MQTT_SSL" "MQTT_USERNAME=$MQTT_USERNAME" "MQTT_PASSWORD=$MQTT_PASSWORD"; do + sed -i "1a export $variables" /etc/services.d/*/*run* 2>/dev/null + # Log + bashio::log.blue "$variables" + done +fi diff --git a/enedisgateway2mqtt_dev/updater.json b/enedisgateway2mqtt_dev/updater.json index 2086f9dd4..2846a7e07 100644 --- a/enedisgateway2mqtt_dev/updater.json +++ b/enedisgateway2mqtt_dev/updater.json @@ -1,9 +1,9 @@ { "github_beta": "true", - "last_update": "26-11-2022", + "last_update": "25-11-2021", "repository": "alexbelgium/hassio-addons", "slug": "enedisgateway2mqtt_dev", "source": "dockerhub", - "upstream_repo": "m4dm4rtig4n/enedisgateway2mqtt", + "upstream_repo": "m4dm4rtig4n/myelectricaldata", "upstream_version": "0.8.2-dev" -} +} \ No newline at end of file