How to configure oh-input component (toggle)

I try to assign the value of an oh-input component to a variable. I have spent two hours with all sorts of variations in the config section to get it working but to no avail.
After pressing the toggle button the Label component is always “undefined”.

Does anybody know how to do it?

- component: oh-input
  config:
    type: toggle
    variable: var1
    variableKey: key1
    checked: true
    value: "test"
    defaultValue: "ON"
- component: Label
  config:
    text: =vars.var1

I don’t think toggle is a valid input type. Why not just use the oh-toggle component instead?

Because I was able to set the toggle component by default to “true”. I did not find a way to do the same with oh-toggle.
Sure, I could also bind the component to an item, but in this widget I try to do it without.

edit:
Uh, wait. I can pre-define the value with your oh-context component :slight_smile:

1 Like