Hello openHab community.
I just successfully integrated my water softener into openHab. Now I’m trying to create a widget to basically reproduce the look and feel of the smartphone app in openHab.
Since I’m a very novice widget developer I’m reaching out here for help and inspiration.
My setup:
Grünbeck softliQ:SD21 water-softener
The device sends its data to a cloud-server, the servers API is connected to an iobroker which sends the data to my MQTT server.
openHab receives the data via MQTT binding.
Here’s what I’ve got so far:
Here’s the widget code (I’m sure its terrible):
uid: Gruenbeck10
tags: []
props:
parameters:
- context: item
label: Item Wasserhärte-Rohwasser
name: itemRawWater
required: true
type: TEXT
- context: item
label: Item Wasserhärte-Weichwasser
name: itemSoftWater
required: true
type: TEXT
- context: item
label: Item Wasserverbrauch 3 Tage
name: itemWater3
required: true
type: TEXT
- context: item
label: Item nächste Regeneration
name: itemNextRegen
required: true
type: TEXT
- context: item
label: Item Restkapa 1
name: itemResCapa1
required: true
type: TEXT
- context: item
label: Item Salz-Verbrauch 3 Tage
name: itemSalt3
required: true
type: TEXT
- context: item
label: Item Salz-Reichweite
name: itemSaltRange
required: true
type: TEXT
parameterGroups: []
timestamp: Jul 9, 2024, 7:42:07 AM
component: f7-card
config:
title: Grünbeck SoftliQ:SD21
footer: Messwerte
style:
color: black
background: url(/static/sd21.png)
background-size: cover
background-position: center
height: 650px
width: 450px
slots:
content:
- component: f7-row
slots:
default:
- component: f7-block
config:
style:
align-items: center
display: flex
flex-direction: row
height: 0px
justify-content: center
margin-top: 0
width: 450px
slots:
default:
- component: f7-col
config:
style:
align-items: center
display: flex
flex-direction: column
slots:
default:
- component: f7-block
config:
style:
align-items: center
display: flex
flex-direction: row
height: 50px
justify-content: left
margin-top: 0
width: 225px
slots:
default:
- component: Label
config:
style:
color: green
font-size: 14px
margin-top: 0px
margin-left: 0px
text-align: center
width: 60px
text: =items[props.itemRawWater].state
visible: true
- component: f7-col
config:
style:
align-items: center
display: flex
flex-direction: column
slots:
default:
- component: f7-block
config:
style:
align-items: center
display: flex
flex-direction: row
height: 0px
justify-content: center
margin-top: -0px
width: 225px
slots:
default:
- component: Label
config:
style:
color: black
font-size: 14px
margin-top: -0px
margin-left: 0px
text-align: left
width: 60px
text: =items[props.itemSoftWater].state
- component: f7-row
slots:
default:
- component: f7-block
config:
style:
align-items: center
display: flex
flex-direction: row
height: 0px
justify-content: center
margin-top: 100px
width: 450px
slots:
default:
- component: f7-col
config:
style:
align-items: center
display: flex
flex-direction: column
slots:
default:
- component: f7-block
config:
style:
align-items: center
display: flex
flex-direction: row
height: 50px
justify-content: left
margin-top: 00px
width: 225px
slots: {}
- component: f7-col
config:
style:
align-items: center
display: flex
flex-direction: column
slots:
default:
- component: f7-block
config:
style:
align-items: left
display: flex
flex-direction: row
height: 0px
justify-content: center
margin-top: 00px
margin-left: 0px
width: 225px
slots:
default:
- component: Label
config:
style:
color: black
font-size: 14px
margin-top: -0px
margin-left: 30px
text-align: center
width: 225px
text: =items[props.itemWater3].displayState || items[props.itemWater3].state
- component: f7-row
slots:
default:
- component: f7-block
config:
style:
align-items: center
display: flex
flex-direction: row
height: 0px
justify-content: center
margin-top: 125px
width: 100%
slots:
default:
- component: f7-col
config:
style:
align-items: center
display: flex
flex-direction: column
width: 50%
slots:
default:
- component: f7-block
config:
style:
align-items: center
display: flex
flex-direction: row
height: 50px
justify-content: center
margin-top: 0px
width: 50%
slots: {}
- component: f7-col
config:
style:
align-items: center
display: flex
flex-direction: column
width: 50%
margin-left: 60px
slots:
default:
- component: f7-block
config:
style:
align-items: center
display: flex
flex-direction: row
height: 0px
justify-content: center
margin-top: 0px
margin-left: 0px
width: 100%
slots:
default:
- component: Label
config:
style:
color: black
font-size: 14px
margin-top: -0px
margin-left: 0px
text-align: center
width: 100%
text: =items[props.itemResCapa1].displayState || items[props.itemResCapa1].state
- component: f7-row
slots:
default:
- component: f7-block
config:
style:
align-items: center
display: flex
flex-direction: row
height: 0px
justify-content: center
margin-top: 95px
width: 100%
slots:
default:
- component: f7-col
config:
style:
align-items: center
display: flex
flex-direction: column
width: 50%
slots:
default:
- component: f7-block
config:
style:
align-items: center
display: flex
flex-direction: row
height: 50px
justify-content: center
margin-top: 0px
width: 50%
slots: {}
- component: f7-col
config:
style:
align-items: center
display: flex
flex-direction: column
width: 50%
margin-left: 60px
slots:
default:
- component: f7-block
config:
style:
align-items: center
display: flex
flex-direction: row
height: 0px
justify-content: center
margin-top: 0px
margin-left: 0px
width: 100%
slots:
default:
- component: Label
config:
style:
color: black
font-size: 14px
margin-top: -0px
margin-left: 0px
text-align: center
width: 100%
text: =items[props.itemNextRegen].displayState ||
items[props.itemNextRegen].state
- component: f7-row
slots:
default:
- component: f7-block
config:
style:
align-items: center
display: flex
flex-direction: row
height: 0px
justify-content: center
margin-top: 95px
width: 100%
slots:
default:
- component: f7-col
config:
style:
align-items: center
display: flex
flex-direction: column
width: 50%
slots:
default:
- component: f7-block
config:
style:
align-items: center
display: flex
flex-direction: row
height: 50px
justify-content: center
margin-top: 0px
width: 50%
slots: {}
- component: f7-col
config:
style:
align-items: center
display: flex
flex-direction: column
width: 50%
margin-left: 60px
slots:
default:
- component: f7-block
config:
style:
align-items: center
display: flex
flex-direction: row
height: 0px
justify-content: center
margin-top: 0px
margin-left: 0px
width: 100%
slots:
default:
- component: Label
config:
style:
color: black
font-size: 14px
margin-top: -0px
margin-left: 0px
text-align: center
width: 100%
text: =items[props.itemSalt3].displayState || items[props.itemSalt3].state
- component: f7-row
slots:
default:
- component: f7-block
config:
style:
align-items: center
display: flex
flex-direction: row
height: 0px
justify-content: center
margin-top: 125px
width: 100%
slots:
default:
- component: f7-col
config:
style:
align-items: center
display: flex
flex-direction: column
width: 50%
slots:
default:
- component: f7-block
config:
style:
align-items: center
display: flex
flex-direction: row
height: 50px
justify-content: center
margin-top: 0px
width: 50%
slots: {}
- component: f7-col
config:
style:
align-items: center
display: flex
flex-direction: column
width: 50%
margin-left: 60px
slots:
default:
- component: f7-block
config:
style:
align-items: center
display: flex
flex-direction: row
height: 0px
justify-content: center
margin-top: 0px
margin-left: 0px
width: 100%
slots:
default:
- component: Label
config:
style:
color: black
font-size: 14px
margin-top: -0px
margin-left: 0px
text-align: center
width: 100%
text: =items[props.itemSaltRange].state
The manufactures app looks like this:
So what’s missing is a visualization of the 3 day history for water and salt usage.
This data comes in as two separate items but I was not able to parse the JSON data stream into something usable. The data looks like this:
salt history:
[{“date”:“2024-07-08”,“value”:0},{“date”:“2024-07-07”,“value”:1420},{“date”:“2024-07-06”,“value”:0}]
water history:
[{“date”:“2024-07-08”,“value”:153},{“date”:“2024-07-07”,“value”:1409},{“date”:“2024-07-06”,“value”:207}]
I’d appreciate if any of you has an idea as to how to transform this salt and water history data into a widget illustration in a way, shape or form close to the manufacturers app shown above.
Of course all additional advices/ideas/suggestsions/comments are also very welcome!
Kind regards,
Ralph…
P.S.:
In case any of you have a solution as to how to display water hardness in unit °dH instead of mol, I’d be very interested in that solution as well!
for more detail on that issue, see: Problem with unit °dH for item of type Number:AmountOfSubstance



