Niimbot Label Printer Custom Integration

I tried adding the date_time sensor, so my sticker can have a timestamp, but it doesn’t print the state there in the hover text. I had the same results with your example of the temperature sensor, though I still haven’t thought of any good reason to print that on a label :grinning:

If I enclose the Jinja in quotes, it prints “unknown” instead…


Try changing it like this.

value: "{{states('sensor. date_time')}}" 

I was just about to repeat that it spits out “unknown” when I put it in quotes, even if I copy/past your text and then I noticed that you had removed the leading space but added one before date_time and so I tried it one more time without either space and it did work. I guess I need to be careful not to have extra whitespace, even when copying directly from the forum. thank you!

I didn’t realize there was a leading space because I copied it directly from an image. Looking at it again, I can see the extra whitespace now. :joy:

it might be nice to have an example in the documentation, with careful whitespace management :wink:

If the printer still acts up after fixing the whitespace issue, I’ve had decent results testing label layouts with BarTender 30-day Trial | LabelBasic.com before pushing anything into Home Assistant. It helped me spot formatting quirks early so the Niimbot didn’t choke on unexpected characters. Sometimes the clean template makes all the difference once HA sends the print command.