WearOS Template Ideas

Just curious what others are using the template tile for with WearOS.

1 Like

Would love to see some template ideas. I’m not sure how to use it!

4 Likes

I can see how to use the template in WearOS, and can get it to display static text, but not sure how to incorporate sensor states into the template.

I am trying to display my PV Solar output. The sensor entity is sensor.solar_production . I have tried including this in the template

<bold>states.sensor.solar_production.state<\bold>

But it just displays “states.sensor.solar_production.state” as text.

I am obviously doing something wrong.

Can anyone help?

I have figured this out, so thought I would post it in case anyone else has the same issue.

Sensors need to be wrapped in {{}}, so the code should have been:

<bold>{{states.sensor.solar_production.state}}<\bold>

Adding the curly brackets and the sensor data is now showing in the tile.

2 Likes

Truly, the official documentation lacks examples… You can compose a mixture of html and Jinja expressions. Find below an example that displays temperature and humidity of a sensor in the garden:

{{ "<bold>Garten Zuhause</bold><br>🌡️&nbsp;" + (states("sensor.tmpgarten_temperature") | replace(".", ",")) + "&thinsp;" + state_attr("sensor.tmpgarten_temperature", "unit_of_measurement") + "<br>💦&nbsp;" + (states("sensor.tmpgarten_humidity") | replace(".", ",")) + "&thinsp;" + state_attr("sensor.tmpgarten_humidity", "unit_of_measurement")}}

The numbers are formatted as expected in Germany (comma replaces decimal point), the units are read from the respective attributes. HTML makes it look nice.

HTML does not need to be part of the JINJA expression but can also be put in as plain HTML, see below.

<bold>Garten Zuhause</bold><br>🌡️&nbsp;{{ (states("sensor.tmpgarten_temperature") | replace(".", ",")) }}&thinsp;{{state_attr("sensor.tmpgarten_temperature", "unit_of_measurement")}}<br>💦&nbsp;{{(states("sensor.tmpgarten_humidity") | replace(".", ","))}}&thinsp;{{state_attr("sensor.tmpgarten_humidity", "unit_of_measurement")}}
5 Likes