I am trying to count my screen hours based on the ‘device_interactive’ entitiy provided by the companion app. This is in my config file:
- platform: history_stats
name: Phone screentime
entity_id: binary_sensor.phone.on
state: "on"
type: time
start: "{{ now().replace(hour=0, minute=0, second=0) }}"
end: "{{ now() }}"
The output is some strange value that is not even remotely close. It says “8:48:36” in the state, while I in reality it is closer to 3 hours.
tom_l
July 4, 2023, 7:28pm
2
I assume that indentation error is just a copy/paste issue?
tom_l
July 8, 2023, 3:58pm
4
I mean it should be indented like this:
- platform: history_stats
name: Phone screentime
entity_id: binary_sensor.phone.on
state: "on"
type: time
start: "{{ now().replace(hour=0, minute=0, second=0) }}"
end: "{{ now() }}"
Ah, yes. That’s just a copy/paste thing.
I have noticed under dev options, it said something about having switched the unit to hour, which is strange, because it worked for a really short time. The sensor still updates, but with ‘useless’ data (because I can’t do anything with it).