Trying to track on/off status of Xbox One and PS4

Really would love to track when the kids are using the devices, not looking for the media player configurations, something much simpler, like a ping. I can do this with the Xbox, but the PS4 is typically in “rest mode”, and still responds to ping. I’m wondering if someone has come up with an alternative solution. I read a post on reddit where someone was using the WOL integration, but I don’t quite see how this is the solution.

I considered using hte device tracker capability and using a template to convert home and away to on and off, but it also reports different things and doesn’t seem to be related to on/off status.

Of course, if my only option is the integration, would be awesome to see what they were doing (what games were running and for how long, etc).

Does anyone have any ideas?

I use this command_line switch.

only for the state of the Playstation.

  - platform: command_line
        command_on: "echo on"
        command_off: "echo off"
        command_state: "nc -z -w 5 9295"
        friendly_name: Playstation 4

I use a power plug, with esphome that monitors power usage of xbox ones and use that to create a binary sensor to show if its on or off. This gives the benefit that the power plug is switched so you can switch it off if needed. Xbox one uses 10-15W on standby, I turn it off during the day when they are “at school”

Thank you for the reply. Going to configure tonight, but I have a question, why do you say it’s only for the state of the playstation? Is there an issue with polling the Xbox state this way?

I wasn’t able to determine how frequent the polling is - do you have any idea? What’s nice is that -z only scans listening daemons without sending data to them, so I don’t anticipate a heavier network load than already existent.

Also I think it should be known that my son made a change on the xbox and now it’s alive on the network all the time, even when it’s “off.” So, now I need to come up with a solution for both.

I like this - it’s pretty creative. I always assumed I didn’t need any smart outlets in these areas because there would never be a time that we’d need to control power like this, but I didn’t consider the fact that I could just monitor the power consumption.

Don’t know, i have no Xbox.

Thanks, I suppose I can sniff the ports to see what becomes available when the Xbox comes online. And so far, so good, appreciate the replies - I like it so far, its’ reporting accurately.

FWIW, used nmap and wireshark and found Xbox traffic is passed on port 2869. All-in-all, very appreciative of the assistance with the nc command.