-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
157 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,4 +22,7 @@ | |
**/secrets.dev.yaml | ||
**/values.dev.yaml | ||
LICENSE | ||
README.md | ||
README.md | ||
|
||
addon | ||
repository.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
FROM dim145/hariane2mqtt:latest AS base | ||
|
||
|
||
COPY entrypoint.sh /addon_entrypoint.sh | ||
|
||
RUN chmod +x /addon_entrypoint.sh | ||
|
||
VOLUME /data | ||
|
||
ENTRYPOINT ["/addon_entrypoint.sh"] | ||
|
||
############ | ||
# 5 Labels # | ||
############ | ||
|
||
LABEL \ | ||
io.hass.version="0.1.0" \ | ||
io.hass.type="addon" \ | ||
io.hass.arch="armv7|amd64|arm64" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: "Hariane 2 MQTT" | ||
description: "Extracts Hariane water data into MQTT a.o." | ||
version: 0.1.0 | ||
slug: "hariane_2_mqtt" | ||
url: https://github.com/Dim145/Hariane2Mqtt | ||
init: false | ||
homeassistant_api: true | ||
arch: | ||
- aarch64 | ||
- amd64 | ||
- armhf | ||
- armv7 | ||
- i386 | ||
map: | ||
- addon_config:rw | ||
- addon_configs:rw | ||
- homeassistant_config:rw | ||
- all_addon_configs:rw | ||
services: | ||
- mqtt:need | ||
options: | ||
log_level: info | ||
debug: true | ||
cron: "0 * * * *" | ||
hariane_num_contrat: "" | ||
hariane_password: "" | ||
hariane_username: "" | ||
mqtt_client_id: harianne2mqtt_client | ||
mqtt_host: "" | ||
mqtt_password: "" | ||
mqtt_port: 1883 | ||
mqtt_topic: homeassistant | ||
mqtt_username: "" | ||
schema: | ||
log_level: list(trace|debug|info|notice|warning|error|fatal)? | ||
debug: boolean? | ||
cron: string? | ||
hariane_password: string? | ||
hariane_username: string? | ||
hariane_num_contrat: string? | ||
mqtt_host: string? | ||
mqtt_port: int? | ||
mqtt_username: string? | ||
mqtt_password: string? | ||
mqtt_client_id: string? | ||
mqtt_topic: string? | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/sh | ||
|
||
# Exit if /config is not mounted | ||
if [ ! -d /config ]; then | ||
echo "Error: /config not mounted" | ||
exit 0 | ||
fi | ||
|
||
# Default location | ||
CONFIGSOURCE="/config/gazpar_2_mqtt/config.yaml" | ||
|
||
mkdir -p /config/gazpar_2_mqtt | ||
|
||
# transform each config.yaml entries to env variables | ||
if [ -f $CONFIGSOURCE ]; then | ||
echo "Loading config from $CONFIGSOURCE" | ||
while IFS=': ' read -r key value | ||
do | ||
if [ ! -z "$key" ] && [ ! -z "$value" ]; then | ||
key=$(echo $key | tr '[:lower:]' '[:upper:]' | tr '-' '_' | tr '.' '_') | ||
value=$(echo $value | sed 's/^ *//g' | sed 's/ *$//g') | ||
|
||
# add to env for cron jobs | ||
export $key=$value | ||
fi | ||
done < $CONFIGSOURCE | ||
fi | ||
|
||
exec "$@" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- | ||
configuration: | ||
log_level: | ||
name: Log level | ||
description: >- | ||
Controls the level of log details the add-on provides. | ||
debug: | ||
name: Debug | ||
description: >- | ||
Enable debug mode | ||
cron: | ||
name: Cron | ||
description: >- | ||
Cron schedule | ||
hariane_password: | ||
name: Hariane password | ||
description: >- | ||
Hariane website password. | ||
hariane_username: | ||
name: Hariane username | ||
description: >- | ||
Hariane website username. | ||
hariane_num_contrat: | ||
name: Hariane contract number | ||
description: >- | ||
Hariane contract number. You can find it on your Hariane account or on your bill. | ||
mqtt_host: | ||
name: MQTT host | ||
description: >- | ||
MQTT broker host. You can use the IP address or the hostname. | ||
mqtt_port: | ||
name: MQTT port | ||
description: >- | ||
MQTT broker port. | ||
mqtt_username: | ||
name: MQTT username | ||
description: >- | ||
MQTT broker username. | ||
mqtt_password: | ||
name: MQTT password | ||
description: >- | ||
MQTT broker password. | ||
mqtt_client_id: | ||
name: MQTT client ID | ||
description: >- | ||
Unique ID. | ||
mqtt_topic: | ||
name: MQTT topic | ||
description: >- | ||
Base topic to publish the data. Use your topic configured in MQTT service to permit Home Assistant to read the data. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"name": "Hariane 2 Mqtt ", | ||
"url": "hhttps://github.com/Dim145/Hariane2Mqtt", | ||
"maintainer": "Dim145" | ||
} |