#timer that counts how much time the tv is on

1 messages · Page 1 of 1 (latest)

upbeat cedar
#

Is it possible to start a timer when the tv is turned off, "stop" it when it is turned off for more than 1 minute and make it available at some type of "history"? so I can see the time I'm spending using the tv

pale stratus
#

i think you can do that kind of thing with the history stats helper

bitter turtle
#

That seems like the point of history_stats

upbeat cedar
#

oh

#

yeah I forgot about that

#

thanks

#

"Estado" = "State"

#

theres no available options

ivory totem
#

There are more on the next page. What are you looking for?

bitter turtle
#

and you can just type the state you want

#

find the entity in devtools -> States and figure out what state you want. If it's a switch, it will be "on"

upbeat cedar
#

what should I put here? I want it to track 4 ever(while the tv is on, which was configured in the previous page)

bitter turtle
deep scaffold
#
- platform: history_stats
  name: "Temps de chauffage chambre"
  unique_id: "temps_chauffage_chambre_netatmo"
  entity_id: sensor.etat_netatmo_chambre
  state: "heating"
  type: time
  start: "{{ now().replace(hour=0, minute=0, second=0) }}"
  end: "{{ now() }}"```

create a template
bitter turtle
#

easier as per the docs:

start: "{{ 0 }}"
end: "{{ now() }}"
#

that's "4 ever"

ivory totem
#

start: "{{ now().replace(hour=0, minute=0, second=0) }}"

This could also just be start: "{{ today_at() }}"

upbeat cedar
#

kinda doesnt work

bitter turtle
#

It does. Toggle power on the TV

upbeat cedar
#

it is already

bitter turtle
#

What I wrote above works for me

upbeat cedar
#

okay so it showed up that

#

and I manually checked on smartthings

#

and it have been on for 5 hours the entire week

#

and I installed home assistant for the first time a week ago

#

any way to reset that?

bitter turtle
#

That's 5 days. My guess is that you chose the wrong entity

upbeat cedar
#

I don't think so

#

im trying to check how much time my tv switch stays in "on" state

#

I probably could start tracking from now by changing that

bitter turtle
#

you can use whatever start or end time you want, and the docs show many examples