Skip to content

Commit

Permalink
bump ism7mqtt to v0.0.13 with automatic parameters.json generation. C…
Browse files Browse the repository at this point in the history
…loses #11
  • Loading branch information
root committed Jun 27, 2023
1 parent 7c6273f commit ef57467
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 22 deletions.
23 changes: 18 additions & 5 deletions ism7mqtt/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
Bump ism7mqtt to v0.0.12

## What's Changed
# STOP! BREAKING CHANGES! READ CAREFULLY!

## What's Changed
- Bump ism7mqtt to v0.0.13
- added German translation for add-on configuration
- fix output of BinaryReadOnlyConverterTemplate, MicerStateConverterTemplate and corresponding ha discovery topics by @zivillian in #60
- Ism7MQTT now auto-generates parameters.json and stores it in your /config directory

## Breaking Changes

## Breaking Change
- Boolean parameters are no longer as true/false but instead as 0/1 and the corresponding text value
- Mixer state value is no longer reported as -/closed/opened, but as 0/1/2 and the corresponding text value
- Parameters.json file format has changed and will now be generated automatically on first startup:
If you have removed certain parameters from your json file, you will have to redo this. After first start of the new version, you will find the file "ism7-parameters-<device name>.json" in your /config directory.
Re-apply your changes there, then restart the add-on
- Entity IDs have changed. If you only start the new version, all your entities will be duplicated (old/new ID).
Follow these steps to properly update:
- Stop the old version of the Add-on
- Download the program MQTTExplorer, start it, and connect to your MQTT broker
- Search for your device name with an underscore, usually "Wolf_"
- Delete all the topics homeassistant/...Wolf_
- Now update and start the new version
- Adjust your dashboards and automations to use the new instead of the old entity ID. In most cases, it's easiest to edit in "yaml" mode, and insert a 0 in the middle of all the parameter IDs

2 changes: 1 addition & 1 deletion ism7mqtt/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM zivillian/ism7mqtt:v0.0.12
FROM zivillian/ism7mqtt:v0.0.13

# Default ENV
ENV \
Expand Down
6 changes: 2 additions & 4 deletions ism7mqtt/config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "Ism7MQTT"
description: "Addon for direct communication with a Wolf ISM7 module"
version: "0.0.12"
version: "v0.0.13"
slug: "ism7mqtt"
init: false
url: https://github.com/b3nn0/hassio-addon-ism7mqtt
Expand All @@ -11,7 +11,7 @@ arch:
#- armhf
#- i386
map:
- "config:ro"
- "config:rw"
discovery:
- mqtt
services:
Expand All @@ -22,7 +22,6 @@ options:
#ism7_ip: ""
#ism7_password: ""
device_name: Wolf
#parameter_json: ""
interval: 60
debug_logging: False

Expand All @@ -31,7 +30,6 @@ schema:
ism7_ip: str
ism7_password: password
device_name: str
parameter_json: str
interval: int
debug_logging: bool

Expand Down
24 changes: 18 additions & 6 deletions ism7mqtt/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,33 @@ export ISM7_MQTTPASSWORD=$(bashio::services mqtt "password")
export ISM7_IP=$(bashio::config 'ism7_ip')
export ISM7_PASSWORD=$(bashio::config 'ism7_password')
export HA_DISCOVERY_ID=$(bashio::config 'device_name')
export PARAMETER_JSON=$(bashio::config 'parameter_json')
export INTERVAL=$(bashio::config 'interval')
export DEBUG_LOGGING=$(bashio::config 'debug_logging')

export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false

set -x
echo $PARAMETER_JSON > /parameter.json

ISM_ARGS="--hass-id=$HA_DISCOVERY_ID --interval=$INTERVAL -t /parameter.json"
cd /app

parameters="/config/ism7-parameters-$HA_DISCOVERY_ID.json"

if ! [ -f $parameters ]; then
echo "Creating initial configuration $parameters"
/app/ism7config -t $parameters
if ! [ -f $parameters ]; then
echo "Parameter file creation seems to have failed. Please report to the ISM7MQTT Author"
exit -1
fi
fi




ISM_ARGS="--hass-id=$HA_DISCOVERY_ID --interval=$INTERVAL -t $parameters"
if [[ "$DEBUG_LOGGING" == "true" ]]; then
ISM_ARGS+=" -d"
fi

cd /app

while [ true ]; do
echo "Starting ism7mqtt $ISM_ARGS"
/app/ism7mqtt $ISM_ARGS || echo "ism7mqtt unexpectedly quit with return code $?"
Expand Down
3 changes: 0 additions & 3 deletions ism7mqtt/translations/de.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ configuration:
device_name:
name: ISM7 Gerätename
description: Ein eindeutiger Name der dein Wolf-Gerät identifiziert. Wird genutzt um eindeutige Entitynamen zu generieren.
parameter_json:
name: Parameter.json Dateiinhalt
description: Kopiere den Inhalt deiner parameter.json Datei hier hin.
interval:
name: Update Intervall (Sekunden)
debug_logging:
Expand Down
3 changes: 0 additions & 3 deletions ism7mqtt/translations/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ configuration:
device_name:
name: ISM7 Device Name
description: Any unique name to identify your Wolf device. Will be used to generate unique entity names.
parameter_json:
name: Parameter.json File Contents
description: Paste your parameter.json file contents here
interval:
name: Update interval (seconds)
debug_logging:
Expand Down

0 comments on commit ef57467

Please sign in to comment.