Parental controls: Sum time spent over all devices and adjust allowed time accordingly

Hi all,

I’m using pantherale0/ha-nintendoparentalcontrols to operate parental controls on two Nintendo Switches and as we only have basically a single kid that uses both, I’d like to have the allowed play time aggregated over both devices. I created a helper of type Timer (“total_allowed_switch_time”) to set the allowed time. Next, I would like to read the sensor.switch1_play_time when it changes and set the control switch2_time_limit (which is in minutes) to be the values of total_allowed_switch_time minus switch1_play_time. And vice versa for the other switch. I know how to set it, but I’m grasping on how to do the calculation to get to a correct value that I can use? I’m a bit of a noob and using the visual editor, but if anyone can give me guidance for the yaml part, I’m sure I can figure that out as well.

Thanks in advance!

It may improve the likelihood or speed in which you get an answer if you clearly list and give a few more details about the available sensors and the data they hold.

You mentioned that you created a Timer helper. How do you envision that helper working in relationship to the sensors and switches provided by the Nintendo integration? Is it just a reference for the starting duration, or does it count down during play?

If you have automations or scripts that you have started, share them and describe your goals, what parts of them are working, and which parts aren’t.