When migrating a simple OH2 sitemap (which I could conveniently use in the OH app on my mobile)…
… I thought about building a simple page layout in OH4. I came across the list card which I deemed useful for this use case.
I am now facing an issue while implementing the channel numerical switch (LP1 active [0,1]) into the list.
I thought I can use a toggle list item. But nowhere (in the GUI at least) can I configure what values to use when toggling. The documentation only describes the same config elements which I can find in the GUI. I wonder what the code behind does for toggling? Is it fixed on “ON/OFF”?
In the OH2 sitemap, I used a simple mapping [0=“off”, 1=“on”], but not sure where to put this in the case of a list toggle…
When I use the numerical item, I get an immediate Communication Error popup when toggling the switch. Strangely enough, I don’t get consistent log entries, sometimes I get:
2023-09-04 13:18:55.589 [WARN ] [e.internal.SseItemStatesEventBuilder] - Attempting to send a state update of an item which doesn't exist: undefined
I then (just for testing purposes) configured a slider list item with range 0 to 1 and this works fine but isn’t really what I wanted to use.
When I move the LP1 active slider from 0 to 1, the LP1 active toggle switch also changes to the active position. When moving the slider to 0, this also works (and deactivates the toggle switch). So in a way, as a readout, the toggle button is working, I just don’t seem to be able to actively use it. Any idea what I am doing wrong? Maybe I cannot use a toggle button for a numerical item but then I wonder what else to use for this?
I tried finding forum topics with a similar issue (using a numerical item in a toggle switch) but couldn’t find anything even close to this (which surprises me a bit, I hope I didn’t do a bad job in researching this).
I did find some documentation on using a widget and configuring a button this way, but that would significanlty change the clean list layout which I wanted to aim for. Therefore I would prefer to understand whether it is possible to use a list card for readouts and a suitable switch for a numerical 0,1 item.
- Platform information:
- Hardware: Intel Celeron
- OS: Debian 12 on unraid virtual environment (VM)
- Java Runtime Environment: OpenJDK Runtime Environment (build 17.0.8+7-Debian-1deb12u1)
- openHAB version: OH 4.0.2