Simple Widget to show a svg with value of an item

Ok, I think I understand. You have been trying to add something to the svg file that will respond to values from OH. That will not work with the MainUI (using the oh-image container).

=items.Solarthermie_S1_Vorlauf.state is a correct form for accessing the state of that item in a widget, but that must be the value of one of the yaml keys in the widget configuration, it does not work in any things else (like inside an svg file).

There is a way to achieve what you want, but it will take just a little more work. You can actually build the svg directly in the widget. This is a moderately advanced use of the widget system, but once you get proficient with it it’s very powerful. There are several examples in the forums for building svg’s. Here are a couple:

(scroll down to the second half of that thread)

Or

or many others.

You also don’t need everything in that svg file. Inkscape adds a lot of extra information. If you go to inkscape and use save as and then select optimized svg, you’ll get a significantly smaller file which will be reasonably easy to convert over to the widget.

1 Like