Step 1: PlayStation Network (now playing)
- Sign in to playstation.com in a private browser window. The HA docs recommend this, especially with several PlayStation accounts, and say to close the window afterwards without logging out, because logging out invalidates the token.
- In Home Assistant go to Settings > Devices & services. If PlayStation Network was discovered, set it up. Otherwise add the integration and follow the link in the dialog to get your NPSSO token. Paste it in.
- You should get a media player per console, and sensors including Now playing, Online status and Last online. The docs say the active state only reports for the last used device. The NPSSO token lasts two months, after which HA prompts you to re-authenticate. Treat the token as a password.
Step 2: Lights when a game starts
Using the Now playing sensor (name it for yours). Check in Developer tools > States what the sensor reads when nothing is running, because the exact "idle" state may differ:
Code: Select all
alias: "Game on: lounge lights down"
triggers:
- trigger: state
entity_id: sensor.my_psn_now_playing
conditions:
- condition: template
value_template: >
{{ trigger.to_state.state not in ['unknown', 'unavailable', 'none', ''] }}
- condition: sun
after: sunset
actions:
- action: scene.turn_on
target:
entity_id: scene.lounge_gaming
Step 3: Xbox
The Xbox integration needs a non-child (18+) Microsoft account, remote features turned on (Settings > Devices & connections > Remote features), and "cloud:" or "default_config:" in your configuration because it uses Home Assistant Cloud's account-linking service. It gives you a media player and remote entity. From the Xbox docs, this example sends it back to the dashboard each night:
Code: Select all
alias: "Return to the Xbox dashboard at night"
triggers:
- trigger: time
at: "23:00:00"
actions:
- action: media_player.play_media
target:
entity_id: media_player.xboxone
data:
media_content_id: "Home"
media_content_type: app
Step 4: Switch bedtime and screen time
The Nintendo Switch Parental Controls integration needs a token from your Nintendo account. The HA docs say you must obtain it on a device without the official parental controls app installed. Follow the dialog's link in the setup. You get these entities:
- Used screen time and Time remaining sensors;
- a Max screentime today number (-1 for unlimited);
- a Restriction mode select (same limit each day or different per day);
- a Suspend software switch that suspends running software at the bedtime alarm.
Step 5: Wake a gaming PC
The Wake on LAN integration sends a magic packet. The docs suggest a helper button plus an automation (a better pattern than a switch if you do not need "off"). Use their YAML for the action, with your own PC's MAC address:
Code: Select all
action: wake_on_lan.send_magic_packet
data:
broadcast_port: 9
mac: 00:11:22:33:44:55
Safety and security
- Tokens (NPSSO, Nintendo, Xbox) are account logins. Never post them or screenshots of them. Revoke or re-issue if exposed.
- Do not port-forward to a console or PC. Remote access to Home Assistant itself should use a VPN or an encrypted remote-access service.
- Keep the consoles' system software up to date.
Question for the group: which game-time automations have you built for the household, and which ones did the family actually put up with?