New Integration: Grünbeck softliQ

SD18 manual update with press for 3 seconds. Automatic is enabled but nothing came. Sorry my post originally stated SD21.

which version do you have now ?

Hardware 000000003 Software 0002.0046

Okay my did already an update
hardwareversion:00000004
softwareversion: 0002.0046

Thank you! I finally integrated my SD21 (Software 0002.0028). I hope that this will be possible without the need of ioBroker in the future. But its good for now I guess!

1 Like

Fantastic!
So here is my final solution for a SD water-softener:

  • Install ioBroker as HASS-Addon
  • Enable Gruenbeck-Adapter within ioBroker
  • Enable MQTT-client-Adapter within ioBroker
  • for now I publish the following four values through MQTT (I checked the “retain” checkbox to have the last value always available)
    – Stream/mcountwater1
    – Stream/msaltusage
    – Stream/mmaint
    – hasError
  • Next, I created a script within homeassistant to use the “MQTT Discovery” feature of homeassistant (sorry for the german)
mqtt_gruenbeck:
  sequence:
  - service: mqtt.publish
    data:
      topic: homeassistant/binary_sensor/gruenbeck-fehler/config
      payload: '{"name":"Grünbeck Fehler","device_class":"problem","state_topic":"gruenbeck/0/softliQ/D/BSxxxxxxxx/hasError","payload_off":"false","payload_on":"true","unique_id":"gruenbeck-fehler","device":{"manufacturer":"Grünbeck","model":"softliQ:SD18","name":"Enthärter","identifiers":["BSxxxxxxxx"]}}'
  - service: mqtt.publish
    data:
      topic: homeassistant/sensor/gruenbeck-wartung/config
      payload: '{"name":"Grünbeck Wartung","state_topic":"gruenbeck/0/softliQ/D/BSxxxxxxxx/Stream/mmaint","unit_of_measurement":"Tage","unique_id":"gruenbeck-wartung","icon":"mdi:wrench-clock","device":{"manufacturer":"Grünbeck","model":"softliQ:SD18","name":"Enthärter","identifiers":["BSxxxxxxxx"]}}'
  - service: mqtt.publish
    data:
      topic: homeassistant/sensor/gruenbeck-salzverbrauch/config
      payload: '{"name":"Grünbeck Salzverbrauch","state_topic":"gruenbeck/0/softliQ/D/BSxxxxxxxx/Stream/msaltusage","unit_of_measurement":"kg","unique_id":"gruenbeck-salzverbrauch","icon":"mdi:shaker-outline","state_class":"total_increasing","device":{"manufacturer":"Grünbeck","model":"softliQ:SD18","name":"Enthärter","identifiers":["BSxxxxxxxx"]}}'
  - service: mqtt.publish
    data:
      topic: homeassistant/sensor/gruenbeck-wasserverbrauch/config
      payload: '{"name":"Grünbeck Wasserverbrauch","state_topic":"gruenbeck/0/softliQ/D/BSxxxxxxxx/Stream/mcountwater1","unit_of_measurement":"l","unique_id":"gruenbeck-wasserverbrauch","icon":"mdi:water-pump","state_class":"total_increasing","device":{"manufacturer":"Grünbeck","model":"softliQ:SD18","name":"Enthärter","identifiers":["BSxxxxxxxx"]}}'
  mode: single
  alias: MQTT-Gruenbeck
  • And an automation, which fires when homeassistant starts
- id: 'gruenbeck'
  alias: Gruenbeck
  description: ''
  trigger:
  - platform: homeassistant
    event: start
  condition: []
  action:
  - service: script.mqtt_gruenbeck
    data: {}
  mode: single
  • Finally, six Utility-Meters to see the daily, weekly and monthly water- and salt-usage
utility_meter:
  salt_day:
    source: sensor.grunbeck_salzverbrauch
    cycle: daily
  salt_week:
    source: sensor.grunbeck_salzverbrauch
    cycle: weekly
  salt_month:
    source: sensor.grunbeck_salzverbrauch
    cycle: monthly
  water_day:
    source: sensor.grunbeck_wasserverbrauch
    cycle: daily
  water_week:
    source: sensor.grunbeck_wasserverbrauch
    cycle: weekly
  water_month:
    source: sensor.grunbeck_wasserverbrauch
    cycle: monthly

With this I have all entities within one device and it just looks neat :smiley:

Once again, thanks for the hint with the ioBroker-Addon and yes, hopefully this will be - sometimes in the future - replaced by a native HASS-Addon

Joerg

4 Likes

Nice, its not the best solution but it is working as i said :+1:t2:

I am confused how to get ioBroker on my HASS os Raspberry Pi 4.
Is ioBroker available in HACs under experimental?
I have another rasbperry 3+ doing nothing that I could use.

I don’t have the skills to make a HA plugins, but at some stage if such a plugin does not materialise I will make a node-red flow with the HA Helper nodes. All the information needed is available in the post for Markis and the main.js posted by gomble above. This is on my list after the get Miele TwinDos liquid levels from the non-public API.

Add this repo in your addon menu:

A instruction is in the github readme

3 Likes

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:

6 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!