New Integration: Grünbeck softliQ

Cheers mate.
Slight problem: MQTT Cleint Version 1.5 from 26th January 2022 complains: iobroker Invalid version of “js-controller”. Installed “3.2.16”, required ">=3.3.22

The changelog says It requires js-controller 3.3.x. but the iobroker from Max’s Repo is 3.2.16
It was an interesting journey SSHing into the docker container to update this. First time for me.

I see my SD18 values in iobroker but the Home Assistant States and Dashboard shows “Unknown”


I am not sure what is wrong here. Everthing is configured in HA and Green in ioBroker.
I think the screenshot is the MQTT Data going to HA. Not sure though.

EDIT: Found the problem: Replaced BSxxxxx 6 times in the mqtt_gruenbeck script from Jörg above.
And for the record MQTT messages to a mqtt broker in ioBroker looks like this:debug (2458) successfully published gruenbeck.0.softliQ.D/BSxxxxx.Stream.mcountwater1: {“topic”:“gruenbeck/0/softliQ/D/BSxxxxxxxx/Stream/mcountwater1”,“message”:“130391”}

flawless
maybe i will adapt this to the other sensors next week

image
Thanks for the Yaml and guide.
I’m guessing gomble has 25°dh water

25°dh water ?

Hi,
nice write-up on how to get data from softliQ to Home Assistant :slight_smile:

However, have a few questions/challenges, that I hope someone can help answer…

I have the softliQ SD23 - and as I understand it, only data from the cloud can be pulled?
And there is a limit on polling on 360 seconds?

Consequently, the settings in IOBroker about retrieval interval for consumption (“Abrufinterval Aktualwerte sec” and “Abrufinterval Wasserverbrauch sec”) doesn’t have any consequence?

Have noticed, that sometimes it seems like there is a “burst” of MQTT messages sent/received wihtin af few seconds. Was wondering, if this is all the values collected in (in the cloud) since last poll from IOBroker?

Anyway, I’d like to have a graph of the actual flow as detaled as possible.
If doesnøt necessarily be in real-time - as long as the values are with the correct timestamp (when it was measured) and not anyting else…

Any advice?

Regards,
Chr.

For the SC variants, I resolved to writing a small python script rather than running x-times curl commands using the command line sensor. Code was inspired by Gruenbeck Soft Water sensor Durchfluss - #9 by DanielWagner
Script returns a JSON object with several attributes that can be affected to multiple sensors.

@gomble thanks for the great write-up how to get the Grünbeck SoftliQ SDx data into Home Assistant.

EDIT 11/10/2022:
I adapted the below config to be used with water statistics in energy dashboard. If you used the config before
a) add device_class: water to the sensors gruenbeck_weichwassermenge and grunbeck_gesamtwassermenge
b) change the unit of measurement from l to L for the same sensors as in a). It should look like this:

      unit_of_measurement: "L"
      device_class: water

c) After a reload of the template configuration, make sure to change the unit under “Developer tools” → “Statistics” from l to L for both sensors and the affected counters. This might be only possible, after you got new sensor values. So be patient and look for the error sign in the developers statistics tab.

START HOW TO
Inspired from the iOBroker forum, I rebuilt one main view of the Grünbeck (Android) app in Home Assistant (all text is generated from the data from the water softener):

(Sorry for the German in the screenshot and the following yaml code)

To get to this screen:
1.) Follow the instructions on how to get the SoftliQ SDx data into Home Assistant from the posts above: New Integration: Grünbeck softliQ - #29 by gomble

2.) I used the following MQTT sensors in configuration.yaml:

# Grünbeck water softener via iOBroker and MQTT
# EDIT 8th June 2022: changed to MQTT platform
# EDIT 10th November 2022: made compatible with water in energy dashboard
mqtt:

# Sensors
  sensor:

    - name: Grünbeck Weichwassermenge
      unique_id: gruenbeck_weichwassermenge
      state_topic: "gruenbeck/0/softliQ/D/BSxxx/Stream/mcountwater1"
      unit_of_measurement: "L"
      device_class: water
      state_class: total_increasing

    - name: Grünbeck Regenerations Zähler
      unique_id: gruenbeck_regenerations_zaehler
      state_topic: "gruenbeck/0/softliQ/D/BSxxx/Stream/mcountreg"
      state_class: total_increasing

    - name: Grünbeck aktueller Durchfluss
      unique_id: gruenbeck_aktueller_durchfluss
      state_topic: "gruenbeck/0/softliQ/D/BSxxx/Stream/mflow1"
      unit_of_measurement: "m³/h"
      state_class: measurement

    - name: Grünbeck Restkapazität m³
      unique_id: gruenbeck_restkapazitaet_m3
      state_topic: "gruenbeck/0/softliQ/D/BSxxx/Stream/mrescapa1"
      value_template: '{{value | round(1) }}'
      unit_of_measurement: "m³"

    - name: Grünbeck Restkapazität %
      unique_id: gruenbeck_restkapazitaet_percent
      state_topic: "gruenbeck/0/softliQ/D/BSxxx/Stream/mresidcap1"
      unit_of_measurement: "%"

    - name: Grünbeck Salz Reichweite
      unique_id: gruenbeck_salz_reichweite
      state_topic: "gruenbeck/0/softliQ/D/BSxxx/Stream/msaltrange"
      unit_of_measurement: "Tage"

    - name: Grünbeck Salz Verbrauch
      unique_id: gruenbeck_salz_verbrauch
      state_topic: "gruenbeck/0/softliQ/D/BSxxx/Stream/msaltusage"
      value_template: '{{ value|round(4)|float(0) }}'
      unit_of_measurement: "kg"
      state_class: total_increasing

    - name: Grünbeck nächste Regeneration
      unique_id: gruenbeck_naechste_regeneration
      state_topic: "gruenbeck/0/softliQ/D/BSxxx/nextRegeneration"
      value_template: '{{ as_timestamp(value)|timestamp_local(default) }}'
      device_class: timestamp

    - name: Grünbeck Rohwasser Härte
      unique_id: gruenbeck_rohwasser_haerte
      state_topic: "gruenbeck/0/softliQ/D/BSxxx/rawWater"
      unit_of_measurement: "°dH"

    - name: Grünbeck Weichwasser Härte
      unique_id: gruenbeck_weichwasser_haerte
      state_topic: "gruenbeck/0/softliQ/D/BSxxx/softWater"
      unit_of_measurement: "°dH"

    - name: Grünbeck Modus
      unique_id: gruenbeck_modus
      state_topic: "gruenbeck/0/softliQ/D/BSxxx/mode"
      value_template: >-
          {% if value == '1' %}
              {% set modus = 'Eco' %}
          {% endif %}
          {% if value == '2' %}
              {% set modus = 'Comfort' %}
          {% endif %}
          {% if value == '3' %}
              {% set modus = 'Power' %}
          {% endif %}
          {{ modus }}

    - name: Grünbeck letzter Neustart
      unique_id: gruenbeck_letzter_neustart
      state_topic: "gruenbeck/0/softliQ/D/BSxxx/startup"

    - name: Grünbeck Wartung in
      unique_id: gruenbeck_wartung_in
      state_topic: "gruenbeck/0/softliQ/D/BSxxx/Stream/mmaint"
      unit_of_measurement: "Tagen"

    - name: Grünbeck Fehler
      unique_id: gruenbeck_fehler
      state_topic: "gruenbeck/0/softliQ/D/BSxxx/errors"
      value_template: '{{ value_json.0.message }}'

# Binary Sensor
  binary_sensor:
    - name: Grünbeck Anlagen Status
      unique_id: gruenbeck_anlagen_status
      payload_on: 'true'
      payload_off: 'false'
      state_topic: "gruenbeck/0/softliQ/D/BSxxx/hasError"
      device_class: problem

Exchange all “BSxxx” with your ID you see in iOBroker MQTT settings. Ensure to enable all needed MQTT messages in iOBroker and also select “retain”.

3.) Create the following 6 Utility Meter (Link to Integrations: Add integration – My Home Assistant)
a) for soft water consumption the entity “sensor.grunbeck_weichwassermenge” is the input sensor.

  • grunbeck_weichwassermenge_tag (meter reset cycle: daily)
  • grunbeck_weichwassermenge_monat (meter reset cycle: monthly)
  • grunbeck_weichwassermenge_jahr (meter reset cycle: yearly)

b) for salt consumption the entity “sensor.grunbeck_salz_verbrauch” is the input sensor.

  • grunbeck_salz_verbrauch_tag (meter reset cycle: daily)
  • grunbeck_salz_verbrauch_monat (meter reset cycle: monthly)
  • grunbeck_salz_verbrauch_jahr (meter reset cycle: yearly)

4.) Upload the picture from the end of this post to www/picture/Gruenbeck.png

5.) Create a “pictures-elements” card in the Home Assistant dashboard:

type: picture-elements
theme: Google Light Theme
elements:
  - type: conditional
    conditions:
      - entity: binary_sensor.grunbeck_anlagen_status
        state: 'off'
    elements:
      - type: state-label
        entity: binary_sensor.grunbeck_anlagen_status
        prefix: 'Anlagenstatus: '
        style:
          top: 3%
          left: 80%
          color: green
  - type: conditional
    conditions:
      - entity: binary_sensor.grunbeck_anlagen_status
        state: 'on'
    elements:
      - type: state-label
        entity: binary_sensor.grunbeck_anlagen_status
        prefix: 'Anlagenstatus: '
        style:
          top: 2%
          left: 80%
          color: red
  - type: conditional
    conditions:
      - entity: binary_sensor.grunbeck_anlagen_status
        state: 'on'
    elements:
      - type: state-label
        entity: sensor.grunbeck_fehler
        style:
          top: 5%
          left: 80%
          color: red
  - type: state-label
    entity: sensor.grunbeck_rohwasser_harte
    style:
      top: 9%
      left: 13%
      color: white
  - type: state-label
    entity: sensor.grunbeck_weichwasser_harte
    style:
      top: 9%
      left: 73%
      color: white
  - type: state-label
    entity: sensor.grunbeck_modus
    style:
      top: 22.5%
      left: 38%
      color: grey
    prefix: 'Modus: '
  - type: state-label
    entity: sensor.grunbeck_weichwassermenge_tag
    style:
      top: 23.5%
      left: 78%
    prefix: 'heute: '
  - type: state-label
    entity: sensor.grunbeck_weichwassermenge_monat
    style:
      top: 29.5%
      left: 78%
    prefix: 'Monat: '
  - type: state-label
    entity: sensor.grunbeck_weichwassermenge_jahr
    style:
      top: 32.5%
      left: 78%
    prefix: 'Jahr: '
  - type: state-label
    entity: sensor.grunbeck_restkapazitat_m3
    style:
      top: 43.5%
      left: 70%
  - type: state-label
    entity: sensor.grunbeck_restkapazitat
    style:
      top: 43.5%
      left: 85%
  - type: state-label
    entity: sensor.grunbeck_nachste_regeneration
    style:
      top: 59%
      left: 78%
  - type: state-label
    entity: sensor.grunbeck_salz_verbrauch_tag
    style:
      top: 72%
      left: 78%
    prefix: 'heute: '
  - type: state-label
    entity: sensor.grunbeck_salz_verbrauch_monat
    style:
      top: 78%
      left: 78%
    prefix: 'Monat: '
  - type: state-label
    entity: sensor.grunbeck_salz_verbrauch_jahr
    style:
      top: 81%
      left: 78%
    prefix: 'Jahr: '
  - type: state-label
    entity: sensor.grunbeck_wartung_in
    style:
      top: 98%
      left: 20%
      color: grey
    prefix: 'Wartung in: '
  - type: state-label
    entity: sensor.grunbeck_salz_reichweite
    style:
      top: 92.2%
      left: 78%
image: /local/picture/Gruenbeck.png

optional) If you would like to calculate the total water consumption (soft water + blend water) without the cleaning water, you can use this sensor in configuration.yaml. I do not use this information in the picture but in my statistics:

template:
  - sensor:
      - name: "Grünbeck Gesamtwassermenge"
        unique_id: grunbeck_gesamtwassermenge
        unit_of_measurement: "L"
        state_class: total_increasing
        device_class: water
        state: >-
            {% set wwh = states("sensor.grunbeck_weichwasser_harte")|float(0) %}
            {% set rwh = states("sensor.grunbeck_rohwasser_harte")|float(0) %}
            {% set wwm = states("sensor.grunbeck_weichwassermenge")|float(0) %}
            {% if (is_number(wwh) and (wwh > 1)) and (is_number(rwh) and (rwh > 1)) and (is_number(wwm) and (wwm > 1)) %}
              {% set gwn = ((wwh*wwm)/(rwh-wwh)+wwm)|round(4) |float(unavailable) %}
            {% endif %}
            {% if is_number(gwn) %}
              {{ gwn }}
            {% endif %}

Empty picture for the background of the “picture-elements” card:

5 Likes

Wow thanks :+1:t2: I will test this :+1:t2:

Holy moly that looks real nice. Might be a long time before I try it out and give some feedback

Thanks :+1:

Hi all,

I’m would like to get a water softener. My goal is not only to monitor, but also control the water softener. (e.g. auto-switch-off, when sprinkler in the garden is running.)

Is there a solution to control?
If not, are there other water softeners, you would recommend?

Thanks a lot!

And here for a SD18 without “Salzreichweite”

And here an update to get the errors from your device.

In my setup the “errors” variable holds the last 5 errors, but the payload is too big for HA

  - service: mqtt.publish
    data:
      topic: homeassistant/sensor/gruenbeck-errors/config
      payload: |
        {
          "name":"Grünbeck Fehlerliste",
          "state_topic":"gruenbeck/0/softliQ/D/BSxxxxxxxx/errors",
          "value_template":"{{ "{{ value_json | count }}" }}",
          "json_attributes_topic":"gruenbeck/0/softliQ/D/BSxxxxxxxx/errors",
          "json_attributes_template":"{{ "{{ value_json[0] | tojson }}" }}",
          "unique_id":"gruenbeck-errors",
          "device":
            {
              "manufacturer":"Grünbeck",
              "model":"softliQ:SD18",
              "name":"Enthärter",
              "identifiers":["BSxxxxxxxx"]
            }
          }

With this there is a new entity, which shows the amount of errors and as attributes the content of the newest message.

1 Like

Filled, it looks like this

Hey and thanks for providing this solution / workaround to add the Gruenbeck Water Softening device.

I tried to add my ioBroker instance via Add-On.
Is there a way to connect to a “outsourced” ioBroker System with different IP address?

How can I add it / connect it to my home assistant?

Thanks a lot in advance! :slight_smile:

Best Regards,
Dominik

Hi Dominik,

HA just runs the MQTT-broker. You can send MQTT-messages (= publish) from any device out ouf your network → the broker must be reachable of course (if you are using different VLAN or something in similar) :wink: IP (broker), username, password are defined client-side (= publish-device). Username/PW are from HA-Users → you can also create a new HA-user just for MQTT.

Und falls du zufällig deutsch sprichst - fällt mir einfacher :slight_smile:

Auf HA läuft der MQTT-Broker. Dieser Empfängt alle MQTT-Nachrichten, welche an ihn versendet (= publish) werden. Du kannst von jedem Gerät aus Deinem Netzwerk MQTT-Nachrichten an den HA-MQTT-Broker schicken. der Broker muss natürlich erreichbar sein (falls Du verschiedene VLAN oder so verwendest). Die Adresse des Brokers Username/Passwort müssen im Client definiert werden (also beim Sender / publisher). Für Username/PW kannst Du auch einen separaten HA-User einrichten.

Viele Grüße / best regards
Sascha

Hi Sascha,

ja deutsch ist besser :wink:
Also heißt das, MQTT Broker (Home Assistant) und MQTT Client (ioBroker, auf anderer VM betrieben) ist komplett ausreichend?

Ich hatte gelesen, dass ich ein ioBroker Add-On für meinen HA benötige, allerdings kann ich hier nur den Port definieren und nicht die IP Adresse der ioBroker VM. Demnach gehe ich davon aus, dass für dieses Add-On eine ioBroker Installation auf dem selben System / selbe VM laufen müsste?

Wenn natürlich die MQTT Geschichte ausreichend würde, wäre top.

Viele Grüße,
Dominik

Die Daten werden via mqtt gesendet daher ist es nicht notwendig das iobrocker und HA auf dem selben System laufen.

1 Like

Hallo zusammen,

ich habe entsprechend eure Vorlagen genutzt und bei mir eingebunden - nochmals vielen Dank hierfür!
Nun habe ich die Problematik, dass ich mit meiner SD21 noch keine Tages-, Monats- sowie Jahres- Verbrauchsanzeigen ausgegeben bekomme.

Ich habe die Verbrauchszähler Helfer angelegt, das Retain habe ich nachgeholt.
Verstehe ich das richtig und muss hier dann jetzt entsprechend Tag, Monat, Jahr abwarten? :slight_smile:

Dann passt nun ja alles?

Vielen Dank vorab!

Liebe Grüße
Dominik

1 Like

Hey, unfortunately i’m facing the same problem with the old js-controller. Could you please tell me how you managed to install the newer version?
Thank you in advance and best regards
Marwin