Created
March 7, 2020 22:00
-
-
Save oischinger/cde7eece336275874a2993e5c07548ce to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- alias: count tv shows | |
trigger: | |
- entity_id: media_player.android_tv | |
platform: state | |
to: playing | |
action: | |
- delay: 00:06:00 | |
- condition: state | |
entity_id: media_player.android_tv | |
state: playing | |
for: | |
minutes: 5 | |
- service: input_number.set_value | |
data_template: | |
entity_id: input_number.num_tv_shows | |
value: '{{ (states.input_number.num_tv_shows.state | int ) + 1 }}' | |
- alias: reset tv shows | |
trigger: | |
- entity_id: media_player.android_tv | |
platform: state | |
to: 'off' | |
action: | |
- service: input_number.set_value | |
data_template: | |
entity_id: input_number.num_tv_shows | |
value: 0 | |
- alias: TV Kindersicherung | |
condition: | |
condition: numeric_state | |
entity_id: input_number.num_tv_shows | |
above: 1 | |
trigger: | |
- entity_id: media_player.android_tv | |
platform: state | |
to: 'playing' | |
action: | |
- entity_id: media_player.android_tv | |
service: media_player.turn_off | |
- alias: "Parental mode audio notification" | |
trigger: | |
platform: numeric_state | |
entity_id: input_number.num_tv_shows | |
above: 0 | |
action: | |
- service: tts.google_say | |
entity_id: media_player.wall_tablet_app | |
data_template: | |
message: "You have watched {{ states('input_number.num_tv_shows')|int }} TV shows" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment