I’m trying to create a printer status widget, supposed to show ink levels as well as general status.
EDIT: @yes corrected my version of the widget, see
below - Exactly what I intended. Use the version from his post instead of my “draft” here
What I have so far is this, two instances of the widget here showing two printers:
And here is my template:
PrinterStatus.widget.json (2.8 KB)
I’m struggling in several areas here:
The height of the table in total should match the total size of the widget, something like 10% for the first line, about 20% for the last two lines and the remaining for the ink level diagrams - My table either gets too short or too tall, depending on what i try ?
I’m not able to use my defined variables (values are shown in the first row) to size the ink bars. When I enter the values directly in my template it works fine, either as % or px, but when i try to reference the variables I only get these full size bars. I think I’ve tried almost all combinations of (curly) braces and such, to no avail
I’d like to color the value of the last row of the table based on the setting of printer_status. In case it is “Warning” it should be yellow, in case of “Error” it should be red, and in all other case it should look like above. As above, i think I’ve tried many ways to achieve this, but again i didnt manage to reference my variables
Last but not least i’d like to add a printer icon somewhere, preferably in the lower left corner. How can I make this configurable as with the predefined widgets ?
I need some push into the right direction, but would like to solve these issues myself and learn from it. I thought I had some (old) basic knowledge of html and css, but this seems insufficient. Any hint on where to start to get some better understanding ?