Screen time for the kids

Problem to fix

Our two kids (6 and 9 yo) are limited in the amount of time they can use screens (tv, tablet, switch, …) and used to argue over it all the time. We would allow them to play on the switch, and after a few hours when they had to stop they would argue about how one of them would have played more/less than the other one etc :roll_eyes:. They also would end up playing a lot, because I would allow them to play when my wife was not at home, not knowing that they had been playing all day earlier this week while I was not at home etc. The kids certainly wouldn’t inform us :sweat_smile:

Solution

Screen time to the rescue.

Every kid gets a given amount of “screen time” every week (6 during school, 12 during school holidays), which they can consume at Wednesday, Saturday and Sunday. Each has an RFID tag with which they can turn on/off their screen time counter, which is confirmed using a TTS speaker.

The system warns (using a TTS announcement) when they are about to exceed 2 hours on a given day. They are allowed to consume more or less time than the 2 hours (e.g. they can decide not to play at Wednesday to have more time Saturday. When their week time is consumed, they are requested to stop immediately.

They can ask us for an update on how much time they’ve already spent.

When watching a movie, they both have to have their screen time on. When playing a game on the switch, every kid holding a controller should have their screen time turned on. When holding no controller, they can watch along.

There are penalties for not having their screen time turned on; as we can’t know how long they have been playing, we assume all time for that week has been consumed and they have to stop immediately. We only had to enforce this rule a few times in the beginning, now they never forget.

Results

It has been working great for many months :heart_eyes:. The kids are more conservative with their screen time, so often they will only play for 30 minutes at Wednesday to save up for the weekend, to play outside in the weekend. They have been playing outside or playing with screenless toys far more than before, without us having to ask. They also don’t argue anymore about screen time related stuff.

Technical implementation

I put the yaml in a gist for easier mantenance: Kids screentime · GitHub

Feedback

I’d love to hear feedback :slightly_smiling_face:. Where do you see improvements? Do you have a similar system at home? Do you have implemented this at home?

Updates

  • 2023-12-06: Added support for a “correction” (e.g. when one of the kids forgot to turn on the screen time, or something like that). Correction is always reset, while the extra time is taken to the next week.
  • 2023-01-02: Moved to a gist. Now also features automatic resetting “extra time”
  • 2022-08-24: Extended the screen time start/stop announcements
  • 2022-08-24: Made the progress announcement automations handle multiple kids
7 Likes

I also use the history stats but just to keep track of the time on each device.
Then I have a boolean that I can turn on and this makes it impossible to turn on the devices.
Each time the screen on is detected an automation sends a screen off command.

I have not had a reason to make it more complex yet.

What a great solution, started implementing immediately but with a small change to not use a rfid-tag but an aqara button. Because the youngest one is 4 years old I will also place a visual indicator somewhere (green & red led, maybe a control screen) because he won’t hear the notifications with his headphones on.

1 Like

Great to hear :slightly_smiling_face:.

The screen is also something that’s on my TODO list for exactly the same reason. My kids can read the clock and should not only rely on the announcement, but still, a screen can make it easier.

Extended my TTS announcement a bit to it also announces the consumed time today, and how much is left this week:

  • When started, it would announce: Foo, your screen time is started. You already have used x hours and x minutes.
  • When stopped, it would announce: Foo, your screen time is stopped. You already have used x hours and x minutes today. You have x hours and x minutes left this week.
- id: notify_screen_time
  alias: "Notify screen time"
  mode: single
  max_exceeded: silent
  variables:
    names:
      input_boolean.foo_screen_time_active:
        pronunciation: "Foo"   # This is because the TTS engine can't correctly pronounce the name of my kids
        name: "foo"
  trigger:
    - platform: state
      entity_id: input_boolean.foo_screen_time_active
      to: null
  action:
    - variables:
        pronunciation: "{{ names[trigger.entity_id].pronunciation }}"
        name: "{{ names[trigger.entity_id].name }}"
    - service: tts.cloud_say
      data:
        entity_id: media_player.living_mini
        message: >-
          {% set today = (states('sensor.' + name + '_screen_time_today') | float(0) * 60) | int(0) %}
          {% set today_hours = today // 60 %}
          {% set today_minutes = today % 60 %}
          {% set remaining = (states('sensor.' + name + '_weekly_screen_time_threshold') | float(0) * 60) | int(0) - (states('sensor.' + name + '_screen_time_this_week') | float(0) * 60) | int(0) %}
          {% set remaining_hours = remaining // 60 %}
          {% set remaining_minutes = remaining % 60 %}
          {{ pronunciation }}, je schermtijd is {{ 'gestart' if is_state(trigger.entity_id, 'on') else 'gestopt' }}.   # Foo, your screen_time is started|stopped.
          Je hebt vandaag al   # Today, you already consumed
          {%- if today_hours > 0 -%}
            {{ ' ' }}{{ today_hours }} uur  # x hours
          {%- endif -%}
          {%- if today_hours > 0 and today_minutes > 0 -%}
            {{ ' ' }}en  # and
          {%- endif -%}
          {%- if today_minutes > 0 -%}
            {{ ' ' }}{{ today_minutes }} min{{ 'uut' if today_minutes == 1 else 'uten' }}  # x minute(s)
          {%- endif %} gebruikt.
          {%- if not is_state(trigger.entity_id, 'on') -%}
            {{ ' ' }}Je hebt  # You have
            {%- if remaining <= 0 -%}
              {{ ' ' }}geen tijd meer over deze week.  # no time left this week.
            {%- else -%}
              {{ ' ' }}nog  # still 
              {%- if remaining_hours > 0 -%}
                {{ ' ' }}{{ remaining_hours }} uur  # x hours
              {%- endif -%}
              {%- if remaining_hours > 0 and remaining_minutes > 0 -%}
                {{ ' ' }}en  # and 
              {%- endif -%}
              {%- if remaining_minutes > 0 -%}
                {{ ' ' }}{{ remaining_minutes }} min{{ 'uut' if remaining_minutes == 1 else 'uten' }}  # x minute(s)
              {%- endif %} over deze week.  # remaining this week.
            {% endif %}
          {% endif %}
        language: "nl-NL"
        options:
          gender: "male"

I’ve updated the topic start post.

I’ve also updated the other announcement automations so they can be used for multiple kids. Topic start post updated.

You could also set up some counter just to see how log will take them to crack and hack all of these. :smile:

1 Like

Nice! I like this and am wanting something similar.

Been thinking on it for awhile and like you, need a way to earn time. A daily recurring Todo list of items with an assigned time value that they can ‘mark off’ using a wall tablet

1 Like

Combining yours and this one may be the ticket: Created a "Chore Tracker" with points system in Home Assistant - #17 by djbrooks022

Haven’t stumbled across a solution for the Switch, Chromebook, or Android Tablet (aside from just relying on Family Link and Parental Controls) but for Roku TVs we can get the daily time ‘playing’.

ok newbie here, how do I go about using this automation, I tried importing the gist via blueprint but it did not work?

Any tips on how to get this working?

On the gist you’ll see that there are different files where the filename indicates what kind of entity it is. It assumes you’re familiar with yaml and can refer those files from your global configuration.yaml file or merge them in already existing files.

Unfortunately, it depends on too many helpers and various automations to make it available as a blueprint.

Ok that is what I was thinking, just wanted to make sure I wasn’t missing anything, thanks!