I’m tracking the hours and minutes my kids watch Twitch Streamers. Originally I just had a “COUNTER” that was active when they were watching which have me a NUMBER total.
I followed another thread and used someone’s templating knowledge (far above mine) to create a template that converts it into Hours and Minutes. This is great but if I try and display this in a card (or Dev Tools) it gives the following output (With all the words included in front of the result)
card:
type: entities
entities:
- entity: sensor.template_sensor_twitch_streamers_active_hours_minutes
name: Time Streaming
title: Twitch Streamers Last Active / Total Hours
state_color: true
Are you placing the template code in the card yaml?
That is not how you should do it.
Either in configuration.yaml or easier, do it in settings → devices & Services → Helpers → and add a template sensor.
in the code field just past the last two lines.
Mate
Your a LEGEND
Yes I already had it in a Template Sensor (Setting/Helpers/Sensor)
But yes I had all the text. I didn’t realise I just needed the last two lines
For anyone else that stumbles across this and wants the solution.