Here my simple Solution of a small Widget.
OH3 - Widget to adjust the setpoint of my KNX Heating Actuators by an 1bit element. I use the heating actor MDT AKH-0800.
It takes me several hours to program this, because the documentation of the syntax is very poor.
(I was not able to find one, so I started with try and error.)
→ Maybe my code helps someone.
→ Or maybe someone has ideas to make is more beautiful.
(Change the color, make the columns better…)
Code
This is the code of my simple widget:
uid: widget_adjust_setpoint_2
tags:
- temperature
props:
parameters:
- description: A text prop
label: Raum der Heizung
name: prop1
required: false
type: TEXT
- context: item
description: An item to control
label: Sollwertverschiebungs item
name: Sollwertverschiebung
required: true
type: TEXT
- context: item
description: An item to control
label: Sollwert item
name: Sollwert
required: true
type: TEXT
- context: item
description: An item to control
label: Istwert item
name: Istwert
required: true
type: TEXT
- context: item
description: An item to control
label: Stellwert des Ventils item
name: Stellwert
required: true
type: TEXT
parameterGroups: []
timestamp: Feb 8, 2021, 12:01:18 AM
component: f7-row
config:
title: Test
slots:
default:
- component: Label
config:
text: =props.prop1
style:
margin-left: 20px
- component: Label
config:
text: =(items[props.Istwert].displayState )
style:
margin-left: 20px
- component: Label
config:
text: =(items[props.Stellwert].displayState )
style:
margin-left: 20px
- component: oh-button
config:
action: command
actionItem: =(props.Sollwertverschiebung)
actionCommand: OFF
actionModal: widget:YOURWIDGET
icon-f7: minus_circle
iconSize: 20
iconColor: white
raised: true
large: true
fill: true
style:
colour: blue
- component: Label
config:
text: =(items[props.Sollwert].displayState )
- component: oh-button
config:
action: command
actionItem: =(props.Sollwertverschiebung)
actionCommand: ON
actionModal: widget:YOURWIDGET
icon-f7: plus_circle
iconSize: 20
iconColor: white
raised: true
large: true
fill: true