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

Reviving this. Is it possible to include mdi icons in the template, or is it limited to font characters?

Simply adding the mdi name (e.g. mdi:car-electric) to the template just displays the name. Is there some trick I haven’t yet worked out?

I don’t believe it is currently possible to include mdi icons in a template but the icons you can copy from EmojiCopy might hopefully work. e.g. :zap::electric_plug::blue_car:

I can confirm that does work

I added emojis from my phone keyboard. Much uglier than MDI icons.

MDI icons applied to entities are shown on the Shortcuts Tiles, so it is possible to get them into the watch.

Unfortunately the template code to add MDI icons doesn’t work with the tile template:

<ha-icon icon="mdi:home-assistant"></ha-icon>

Nothing is shown. The tag isn’t one of the supported ones. What would be necessary to add this?

There is a GitHub issue already: Support for Home Assistant (MDI) icons in template widgets · Issue #4135 · home-assistant/android · GitHub

This is mine, a work in progress:

<h1>🔋SoC {{states('sensor.home_battery_soc') | round}} %</h1>
<h2>🗑{{states('sensor.waste_collection_short')}}</h2

screenshot-2024-07-19-14-59-41

Ideally, I would like more control over the font size as I’m not able to read H1 without my glasses. :man_facepalming:

I’m just here to share my template tile.

<b><u>Klima</b></u>🌡
{% if is_state('input_boolean.boost_sz',  'on') %} Boost SZ {% elif is_state('input_boolean.boost_bad',  'on') %} Boost Bad {% elif is_state('input_boolean.therme_manuell', 'on') %} Override {% elif ( (is_state('input_boolean.therme_manuell','off')) and (is_state('climate.raumthermostat','off')) ) %} Aus {% else %} Auto • {{state_attr('input_datetime.wake2', 'timestamp') | timestamp_custom('%H:%M ', false)}} {% endif %} • {% if is_state("switch.steuerung_therme", "off") %} Standby {% else %} in Betrieb {% endif %}
{{ states.climate.raumthermostat.attributes.current_temperature}} °C 🛋 {{ states.climate.raumthermostat.attributes.temperature}} °C
 {{ states('sensor.schlafzimmer_nachttisch_ds18b20_temperature') }} °C 🛏 {{states('sensor.shellyht_79a8b8_humidity')}} % • {{states('sensor.taupunkt_sz')}} °C
<b><u>Energie</b></u>⚡️
{{states('sensor.shellyem_energy_voltage')}} V | {{states('sensor.shellyem_energy_power_1')}} W | {{states('sensor.shellyem_energy_frequency')}} Hz
{{states('sensor.energy_today')}} kWh | {{states('sensor.shellyem_energy_current_1') | round(2)}} A
🔥 {{states('sensor.gasverbrauch_3') | round(2)}} m³
 ♣️♦️♠️♥️

It looks like

1000026616