My automations triggers when the kids have been playing for 2 hours. First the Google Hub tells them that it has been 2 hours and that they should to something else, after 10 minutes the automation turns off the Xbox setup, that is done via the Harmony hub. It works great
My problem is that the kids just turns it back on if i am not home (clever as they are). I want to have an automation after it has been turn off that stops the Harmony to restart the Xbox setup again for at least 30-60 min.
How to do that in the automation?
Best regards
Thekholm
alias: TTS - Turn off Xbox
description: ''
trigger:
- platform: state
entity_id: switch.harmony_hub_xbox
to: 'on'
for:
hours: 2
minutes: 0
seconds: 0
condition: []
action:
- service: script.x
data: {}
- delay:
hours: 0
minutes: 10
seconds: 0
milliseconds: 0
- type: turn_off
device_id: My device id
entity_id: switch.harmony_hub_xbox
domain: switch
mode: single
I don’t have any experience using Harmony hub, so there may be easier/better ways to do this from that angle. The basic method is to use an Input Boolean as a flag:
alias: TTS - Turn off Xbox
description: ''
trigger:
- platform: state
id: 2hr
entity_id: switch.harmony_hub_xbox
to: 'on'
for:
hours: 2
minutes: 0
seconds: 0
- platform: state
id: On
entity_id: switch.harmony_hub_xbox
to: 'on'
- platform: state
id: Reset
entity_id: input_boolean.XXXX
to: 'on'
for:
hours: 1
minutes: 0
seconds: 0
condition: []
action:
- choose:
- conditions:
- condition: trigger
id: 2hr
sequence:
- service: input_boolean.turn_on
entity_id: input_boolean.XXXX
- service: script.x
data: {}
- delay:
hours: 0
minutes: 10
seconds: 0
milliseconds: 0
- type: turn_off
device_id: My device id
entity_id: switch.harmony_hub_xbox
domain: switch
- conditions:
- condition: trigger
id: On
- condition: state
entity_id: input_boolean.XXXX
state: 'on'
sequence:
- service: switch.turn_off
entity_id: switch.harmony_hub_xbox
- conditions:
- condition: trigger
id: Reset
sequence:
- service: input_boolean.turn_off
entity_id: input_boolean.XXXX
default: []
mode: single
Couldn’t they just use the power button on the xbox to turn it back on?
I’d look into turning off the power to the Xbox with a smart plug.
Ideally also place the smart plug somewhere nog easily accessible, like behind a media closet or something.
Looking back to my younger years, software would not have stopped me.
You needed to take away the power cable.
Yeah, there are a lot of possible failure points when you’re relying on smart plugs or smart remotes to control a device that the kids have physical access to. I’ve never used it, but XBox does have a parental control app that can exercise higher level control of the XBox itself.
It might be a good backup to use the DLNA Digital Media Renderer integration and a HIstory Stats sensor to track how many hours the Xbox is ebing used every day.