Cell phone usage time in HA

How can I know in Home Assistant how long I use my cell phone? The HA application does not provide that sensor, I thought about using the lock sensor and accumulating the time it is active but it takes a long time to update.

Is there any program that provides the amount of time I use the cell phone and is compatible with HA?

Thanks in Advance!

You should have a phone state sensor to detect when you’re in a call. Is this enough to get you started?

I am more interested in “how much time my child spend for staring at his/her phone”…

I would like to know how long the screen is on for example. Not on call (there it would always be 0 haha)

then you want the interactive sensor

2 Likes

I’m trying to create the sensor that tells me how long the screen is on but it doesn’t tell me anything…


  - platform: history_stats
    name: Celular hoy
    entity_id: binary_sensor.moto_e32_interactive_3
    state: "Encendido"
    type: time
    start: "{{ 0 }}"
    end: "{{ now() }}"

here is my own example, replace with your entity ID :slight_smile:

 - platform: history_stats
   name: Dannys Pixel 8 Pro Daily Screen On Time
   entity_id: binary_sensor.dannys_pixel_8_pro_interactive
   state: 'on'
   type: time
   start: '{{ now().replace(hour=0, minute=0, second=0) }}'
   duration:
     hours: 24

 - platform: history_stats
   name: Dannys Pixel 8 Pro Daily Screen On Count
   entity_id: binary_sensor.dannys_pixel_8_pro_interactive
   state: 'on'
   type: count
   start: '{{ now().replace(hour=0, minute=0, second=0) }}'
   duration:
     hours: 24
2 Likes