Nintendo Switch - Lock (Mwahahahaha!)

I have two young boys at home, who are addicted to Fortnite on their Nintendo Switches. Imagine my surprise and delight when reading the release notes for 2025.11 to see that @pantherale0 has written an integration for the Nintendo Switch Parental Controls!

A couple of scripts later and my wife can now yell at the Google speakers and instantly lock the offending devices. If you too would like to wield such power in your household, the following scripts should help:

sequence:
  - action: number.set_value
    metadata: {}
    data:
      value: "0"
    target:
      entity_id: number.davids_switch_max_screentime_today
  - action: switch.turn_on
    metadata: {}
    data: {}
    target:
      entity_id: switch.davids_switch_suspend_software
alias: Nintendo:Davids Switch:Lock
description: ""
icon: mdi:controller-off

Unlocking can be achieved through:

sequence:
  - action: number.set_value
    metadata: {}
    data:
      value: "-1"
    target:
      entity_id: number.davids_switch_max_screentime_today
  - action: switch.turn_off
    metadata: {}
    data: {}
    target:
      entity_id: switch.davids_switch_suspend_software
alias: Nintendo:Davids Switch:Unlock
description: ""
icon: mdi:controller

These scripts can then be tied together into a switch template:

switch:
  - platform: template
      davids_switch:
        friendly_name: "Davids Switch"
        unique_id: switch.davids_switch
        value_template: "{{ states('number.davids_switch_max_screentime_today')|float(0) != 0 and states('switch.davids_switch_suspend_software') == 'off' }}"
        turn_on:
          action: script.turn_on
          target:
            entity_id: script.nintendo_davids_switch_unlock
          data: {}
        turn_off:
          action: script.turn_on
          target:
            entity_id: script.nintendo_davids_switch_lock
          data: {}

Simple and elegant. Much gratitude to @pantherale0 (although my boys might disagree).

2 Likes

My dinner table conversation this week has consisted of how I’ve probably annoyed many children round the world this month for bringing this to core :joy:

3 Likes

For every annoyed kid there are two happy parents :wink:

1 Like

@pantherale0 you need a Buy Me a Coffee or similar, so we can all say “thank you”!

3 Likes

I actually have one already https://buymeacoffee.com/pantherale0 :slight_smile:

1 Like