Merci beaucoup pour ce superbe travail, impeccable de mon coté, tout roule parfaitement bien.
Bonjour,
Intégration au top.
Voici un Graph application top 5 :
type: custom:config-template-card
entities:
- sensor.manon__top_app_1
- sensor.manon__top_app_2
- sensor.manon__top_app_3
- sensor.manon__top_app_4
- sensor.manon__top_app_5
card:
type: custom:apexcharts-card
cache: true
update_interval: 5min
chart_type: donut
show:
last_updated: true
header:
show: true
show_states: false
colorize_states: true
title: Top 5 application Manon
series:
- entity: sensor.manon__top_app_1
name: >-
${ var val =
Math.ceil(parseFloat(states['sensor.manon__top_app_1'].state));
var h = Math.floor(val / 60); var m = val % 60;
states['sensor.manon__top_app_1'].attributes['app_name'] + ' (' +
h + ' h ' + m + ' min)' }
show:
legend_value: false
- entity: sensor.manon__top_app_2
name: >-
${ var val =
Math.ceil(parseFloat(states['sensor.manon__top_app_2'].state));
var h = Math.floor(val / 60); var m = val % 60;
states['sensor.manon__top_app_2'].attributes['app_name'] + ' (' +
h + ' h ' + m + ' min)' }
show:
legend_value: false
- entity: sensor.manon__top_app_3
name: >-
${ var val =
Math.ceil(parseFloat(states['sensor.manon__top_app_3'].state));
var h = Math.floor(val / 60); var m = val % 60;
states['sensor.manon__top_app_3'].attributes['app_name'] + ' (' +
h + ' h ' + m + ' min)' }
show:
legend_value: false
- entity: sensor.manon__top_app_4
name: >-
${ var val =
Math.ceil(parseFloat(states['sensor.manon__top_app_4'].state));
var h = Math.floor(val / 60); var m = val % 60;
states['sensor.manon__top_app_4'].attributes['app_name'] + ' (' +
h + ' h ' + m + ' min)' }
show:
legend_value: false
- entity: sensor.manon__top_app_5
name: >-
${ var val =
Math.ceil(parseFloat(states['sensor.manon__top_app_5'].state));
var h = Math.floor(val / 60); var m = val % 60;
states['sensor.manon__top_app_5'].attributes['app_name'] + ' (' +
h + ' h ' + m + ' min)' }
show:
legend_value: false
Bonjour @noiwid ,
Voici le logbook, le mode bedtime se met bien en route à 22h mais se désactive à minuit.
Et dans ce cas (Bedtime qui ne reflète pas la réalité) le switch.tel reste sur on alors que le téléphone est bien verrouillé.
Je ne sais pas si je suis le seul dans ce cas
Merci pour ce screenshot, il manque la partie la plus intéressante, le bas de l’écran, pour voir si c’est H.A qui désactive où l’API… Sur quelle version de l’intégration êtes vous?
Quelle est votre plage horaire de nuit ?
J’aurais était bien incapable de faire ce graph, merci, ça fonctionne bien !
Tu pense que c’est possible de rajouter un tap_action pour afficher le graph du temps de l’appli en question sur la journée ( je crois que c’est le service browser_mod.more_info )
Bonne journée
Bonjour,
Passe show_states de false à true dans la section header et tu verras les 5 applications et en cliquant dessus tu auras le graph.
Hello,
Voici un peu plus d’informations, il me semble que le sensor ait bien fonctionné une seule nuit. La plage de nuit configurée est 22h00 - 07h05.
Lorsque l’on passe en mode nuit l’entité du téléphone devrait passer bien à désactivé car chez moi ça reste actif et si je désactive, ça revient en activé au bout de 60s ?
Bonjour,
Merci pour ce super rendu mais le graph s’affiche bien mais les déterminations des noms ne fonctionne pas. Il doit me manquer un module dans HACS.
- config-template-card ok
- apex ok
Il en faut un 3e ?
Merci ![]()
Bonjour, non c’est suffisant, attention aux nomages des différents sensors.
J’ai aussi ajouté quelques informations supplémentaires sur la pages et réalisé des automatisations. Je vais essayer de publier tout ça en début de semaine.
Bonjour à tous,
voici ma Lovelace pour les informations essentielles de Family Link.
type: custom:vertical-stack-in-card
title: Family Link
cards:
- type: custom:mushroom-legacy-template-card
primary: Temps d'écran Manon
secondary: >-
{% set time = states(entity) %} {% if time != 'unavailable' and time !=
'unknown' %}
{{ time.split(':')[0] }}h{{ time.split(':')[1] }}min
{% else %}
--h--min
{% endif %}
tap_action:
action: more-info
icon: mdi:cellphone
icon_color: ""
fill_container: true
layout: horizontal
entity: sensor.manon__screen_time_formatted
badge_color: ""
card_mod:
style:
mushroom-state-info$: |
.container {
{% set time = states(config.entity) %}
{% set hours = time.split(':')[0] | int(0) %}
{% set mins = time.split(':')[1] | int(0) %}
{% set total_mins = (hours * 60) + mins %}
{% if total_mins > 120 %}
--card-primary-color: tomato;
--card-secondary-color: tomato;
{% else %}
--card-primary-color: ;
--card-secondary-color: #0080FF;
{% endif %};
}
mushroom-shape-icon$: |
.shape {
{% set time = states(config.entity) %}
{% set hours = time.split(':')[0] | int(0) %}
{% set mins = time.split(':')[1] | int(0) %}
{% set total_mins = (hours * 60) + mins %}
{% if total_mins > 120 %}
color: tomato !important;
--shape-animation: ping 5s infinite;
--shape-color: none;
--shape-color-disabled: transparent !important;
--icon-symbol-size: 0.8em;
--icon-color: tomato
{% else %}
border: 2.5px outset #0080FF;
color: green !important;
--shape-color: none;
--shape-color-disabled: transparent !important;
--icon-symbol-size: 0.8em;
--icon-color: #0080FF
{% endif %};
}
@keyframes ping {
0% {box-shadow: 0 0 0 0 rgba(var(--rgb-red), 0.7);}
70% {box-shadow: 0 0 0 15px transparent;}
100% {box-shadow: 0 0 0 0 transparent;}
- type: custom:mushroom-legacy-template-card
primary: Temps restant
secondary: "{{states('sensor.manon_screen_time_remaining')}}min"
tap_action:
action: more-info
icon: mdi:cellphone-arrow-down-variant
icon_color: ""
fill_container: true
layout: horizontal
entity: sensor.manon_screen_time_remaining
badge_color: ""
card_mod:
style:
mushroom-state-info$: |
.container {
{% set time = states('sensor.manon_screen_time_remaining') | float(0) %}
{% if time < 5 %}
--card-primary-color: tomato;
--card-secondary-color: tomato;
{% else %}
--card-primary-color: ;
--card-secondary-color: #0080FF;
{% endif %};
}
mushroom-shape-icon$: |
.shape {
{% set time = states('sensor.manon_screen_time_remaining') | float(0) %}
{% if time < 5 %}
color: tomato !important;
--shape-animation: ping 5s infinite;
--shape-color: none;
--shape-color-disabled: transparent !important;
--icon-symbol-size: 0.8em;
--icon-color: tomato
{% else %}
border: 2.5px outset #0080FF;
color: green !important;
--shape-color: none;
--shape-color-disabled: transparent !important;
--icon-symbol-size: 0.8em;
--icon-color: #0080FF
{% endif %};
}
@keyframes ping {
0% {box-shadow: 0 0 0 0 rgba(var(--rgb-red), 0.7);}
70% {box-shadow: 0 0 0 15px transparent;}
100% {box-shadow: 0 0 0 0 transparent;}
- type: custom:mushroom-legacy-template-card
secondary: |-
{% if is_state(config.entity,'on') %}
Déverrouillé
{% elif is_state(config.entity,'off') %}
Verrouillé
{% else %}
Bug
{% endif %}
icon: |-
{% if is_state(config.entity,'on') %}
mdi:cellphone-check
{% elif is_state(config.entity,'off') %}
mdi:cellphone-key
{% else %}
mdi:alert
{% endif %}
icon_color: ""
tap_action:
action: toggle
hold_action:
action: none
double_tap_action:
action: none
fill_container: true
layout: horizontal
entity: switch.manon
badge_color: ""
primary: Téléphone
card_mod:
style:
mushroom-state-info$: |
.container {
{% if states(config.entity) == 'on' %}
--card-primary-color: ;
--card-secondary-color: #0080FF;
{% endif %}
{% if states(config.entity) == 'off' %}
--card-primary-color: tomato;
--card-secondary-color: tomato;
{% endif %}
}
mushroom-shape-icon$: |
.shape {
{% if states(config.entity) == 'off' %}
color: tomato !important;
--shape-animation: ping 5s infinite;
--shape-color: none;
--shape-color-disabled: transparent !important;
--icon-symbol-size: 0.8em;
--icon-color: tomato
{% endif %}
{% if states(config.entity) == 'on' %}
border: 2.5px outset #0080FF;
color: green !important;
--shape-color: none;
--shape-color-disabled: transparent !important;
--icon-symbol-size: 0.8em;
--icon-color: #0080FF
{% endif %}
}
@keyframes ping {
0% {box-shadow: 0 0 0 0 rgba(var(--rgb-red), 0.7);}
70% {box-shadow: 0 0 0 15px transparent;}
100% {box-shadow: 0 0 0 0 transparent;}
- type: custom:mushroom-legacy-template-card
secondary: |-
{% if is_state(config.entity,'on') %}
Activées
{% elif is_state(config.entity,'off') %}
Désactivées
{% else %}
Bug
{% endif %}
icon: |-
{% if is_state(config.entity,'on') %}
mdi:sleep
{% elif is_state(config.entity,'off') %}
mdi:sleep-off
{% else %}
mdi:alert
{% endif %}
icon_color: ""
tap_action:
action: toggle
hold_action:
action: none
double_tap_action:
action: none
fill_container: true
layout: horizontal
entity: switch.manon__bedtime
badge_color: ""
primary: Heures de nuit
card_mod:
style:
mushroom-state-info$: |
.container {
{% if states(config.entity) == 'on' %}
--card-primary-color: ;
--card-secondary-color: #0080FF;
{% endif %}
{% if states(config.entity) == 'off' %}
--card-primary-color: tomato;
--card-secondary-color: tomato;
{% endif %}
}
mushroom-shape-icon$: |
.shape {
{% if states(config.entity) == 'off' %}
color: tomato !important;
--shape-animation: ping 5s infinite;
--shape-color: none;
--shape-color-disabled: transparent !important;
--icon-symbol-size: 0.8em;
--icon-color: tomato
{% endif %}
{% if states(config.entity) == 'on' %}
border: 2.5px outset #0080FF;
color: green !important;
--shape-color: none;
--shape-color-disabled: transparent !important;
--icon-symbol-size: 0.8em;
--icon-color: #0080FF
{% endif %}
}
@keyframes ping {
0% {box-shadow: 0 0 0 0 rgba(var(--rgb-red), 0.7);}
70% {box-shadow: 0 0 0 15px transparent;}
100% {box-shadow: 0 0 0 0 transparent;}
- type: custom:mushroom-legacy-template-card
secondary: |-
{% if is_state(config.entity,'on') %}
Déverrouillé
{% elif is_state(config.entity,'off') %}
Verrouillé
{% else %}
Bug
{% endif %}
icon: |-
{% if is_state(config.entity,'on') %}
mdi:television
{% elif is_state(config.entity,'off') %}
mdi:television-off
{% else %}
mdi:alert
{% endif %}
icon_color: ""
tap_action:
action: toggle
hold_action:
action: none
double_tap_action:
action: none
fill_container: true
layout: horizontal
entity: switch.google_tv_streamer
badge_color: ""
primary: Télévision
card_mod:
style:
mushroom-state-info$: |
.container {
{% if states(config.entity) == 'on' %}
--card-primary-color: ;
--card-secondary-color: #0080FF;
{% endif %}
{% if states(config.entity) == 'off' %}
--card-primary-color: tomato;
--card-secondary-color: tomato;
{% endif %}
}
mushroom-shape-icon$: |
.shape {
{% if states(config.entity) == 'off' %}
color: tomato !important;
--shape-animation: ping 5s infinite;
--shape-color: none;
--shape-color-disabled: transparent !important;
--icon-symbol-size: 0.8em;
--icon-color: tomato
{% endif %}
{% if states(config.entity) == 'on' %}
border: 2.5px outset #0080FF;
color: green !important;
--shape-color: none;
--shape-color-disabled: transparent !important;
--icon-symbol-size: 0.8em;
--icon-color: #0080FF
{% endif %}
}
@keyframes ping {
0% {box-shadow: 0 0 0 0 rgba(var(--rgb-red), 0.7);}
70% {box-shadow: 0 0 0 15px transparent;}
100% {box-shadow: 0 0 0 0 transparent;}
- type: custom:mushroom-select-card
#J'ai créé une entrée liste de choix +15min, +30min, +60min, **Choisir**#
entity: input_select.family_link
primary_info: name
tap_action:
action: none
hold_action:
action: none
double_tap_action:
action: none
fill_container: false
secondary_info: none
name: Ajouter temps
layout: horizontal
card_mod:
style:
mushroom-shape-icon$: |
.shape {
border: 2.5px outset #0080FF;
--shape-color: none;
--shape-color-disabled: transparent !important;
--icon-symbol-size: 0.5em;
--icon-color: 5em;
--icon-color: #0080FF
.: |
ha-card{
height: 80px !important;
}
card_mod:
style:
.: |
ha-card {
font-family: "Days One";
}
type: custom:config-template-card
entities:
- sensor.manon__top_app_1
- sensor.manon__top_app_2
- sensor.manon__top_app_3
- sensor.manon__top_app_4
- sensor.manon__top_app_5
card:
type: custom:apexcharts-card
cache: true
update_interval: 5min
chart_type: donut
show:
last_updated: true
header:
show: true
show_states: false
colorize_states: true
title: Top 5 application Manon
series:
- entity: sensor.manon__top_app_1
name: >-
${ var val =
Math.ceil(parseFloat(states['sensor.manon__top_app_1'].state));
var h = Math.floor(val / 60); var m = val % 60;
states['sensor.manon__top_app_1'].attributes['app_name'] + ' (' +
h + ' h ' + m + ' min)' }
show:
legend_value: false
- entity: sensor.manon__top_app_2
name: >-
${ var val =
Math.ceil(parseFloat(states['sensor.manon__top_app_2'].state));
var h = Math.floor(val / 60); var m = val % 60;
states['sensor.manon__top_app_2'].attributes['app_name'] + ' (' +
h + ' h ' + m + ' min)' }
show:
legend_value: false
- entity: sensor.manon__top_app_3
name: >-
${ var val =
Math.ceil(parseFloat(states['sensor.manon__top_app_3'].state));
var h = Math.floor(val / 60); var m = val % 60;
states['sensor.manon__top_app_3'].attributes['app_name'] + ' (' +
h + ' h ' + m + ' min)' }
show:
legend_value: false
- entity: sensor.manon__top_app_4
name: >-
${ var val =
Math.ceil(parseFloat(states['sensor.manon__top_app_4'].state));
var h = Math.floor(val / 60); var m = val % 60;
states['sensor.manon__top_app_4'].attributes['app_name'] + ' (' +
h + ' h ' + m + ' min)' }
show:
legend_value: false
- entity: sensor.manon__top_app_5
name: >-
${ var val =
Math.ceil(parseFloat(states['sensor.manon__top_app_5'].state));
var h = Math.floor(val / 60); var m = val % 60;
states['sensor.manon__top_app_5'].attributes['app_name'] + ' (' +
h + ' h ' + m + ' min)' }
show:
legend_value: false
Les automatisations :
1 - Envoi quotidien de la liste Top 5 et du temps associé sur mon bot Telegram :
alias: Family Link - Utilisation Apps Manon
description: >-
Envoie un rapport quotidien sur l'utilisation des applications de Manon via
Family Link sur Telegram.
triggers:
- trigger: time
at: "20:55:00"
conditions: []
actions:
- action: telegram_bot.send_message
metadata: {}
data:
config_entry_id: mon bot telegram
message: |-
Utilisation des Apps - Manon :
{%- for i in range(1, 6) -%}
{%- set sensor = 'sensor.manon__top_app_' ~ i -%}
{%- set app = state_attr(sensor, 'app_name') -%}
{%- set time = state_attr(sensor, 'formatted_time') -%}
{%- if app and time -%}
{{ "\n" }}{{ i }}. *{{ app }}* : {% set t = time.split(':') -%}
{%- if t[0] | int > 0 -%}
{{ t[0] }}h {{ t[1] }}min {{ t[2] }}s
{%- else -%}
{{ t[1] }}min {{ t[2] }}s
{%- endif -%}
{%- endif -%}
{%- endfor -%}
title: 📱FAMILY LINK 📲
mode: single
2 - Automatisation déclenchée par la sélection +15min de l’entrée input_select.family_link :
alias: Manon - Temps Supplémentaire (+15min)
description: >-
Ajoute 15 minutes de temps d'écran pour Manon et envoie une notification via Telegram.
triggers:
- trigger: state
entity_id:
- input_select.family_link
to:
- +15min
conditions: []
actions:
- action: button.press
metadata: {}
data: {}
target:
entity_id: button.manon_15min
enabled: true
- action: telegram_bot.send_message
metadata: {}
data:
config_entry_id: mon bot telegram
title: 📱FAMILY LINK 📲
message: Ajout de 15 minutes de temps supplémentaire !
- target:
entity_id: input_select.family_link
data:
option: "**Choisir**"
action: input_select.select_option
mode: single
A dupliquer pour +30min et +60min ![]()
3 - Notification Télégram quand le temps est écoulé avec bouton pour rajouter du temps ou pas :
alias: Manon - Temps écran écoulé
description: >-
Notification lorsque Manon a épuisé son temps d'écran quotidien et ajout de temps supplémentaire.
triggers:
- trigger: numeric_state
entity_id:
- sensor.manon_screen_time_remaining
below: 1
conditions: []
actions:
- action: telegram_bot.send_message
metadata: {}
data:
config_entry_id: mon bot telegram
title: 📱FAMILY LINK 📲
message: Manon à écoulée tout sont temps d'acran aujourd'hui en rajouter❓
inline_keyboard: +15min 👍 :/15m_oui, Non 👎 :/15m_non
mode: single
Si sélection +15min ![]()
alias: Action > Confirmer +15min (Manon)
description: >-
Répond à la commande Telegram '/15m_oui' pour confirmer l'ajout de 15 minutes
de temps d'écran pour Manon.
triggers:
- event_type: telegram_callback
event_data:
command: /15m_oui
trigger: event
conditions: []
actions:
- action: button.press
metadata: {}
data: {}
target:
entity_id: button.manon_15min
enabled: true
- action: telegram_bot.answer_callback_query
metadata: {}
data:
show_alert: false
callback_query_id: "{{ trigger.event.data.id }}"
message: C'est fait ! 👍
config_entry_id: mon bot telegram
- data:
message_id: "{{ trigger.event.data.message.message_id }}"
chat_id: "{{ trigger.event.data.chat_id }}"
inline_keyboard: null
config_entry_id: mon bot telegram
action: telegram_bot.edit_replymarkup
- action: telegram_bot.set_message_reaction
metadata: {}
data:
message_id: "{{ trigger.event.data.message.message_id }}"
chat_id: "{{ trigger.event.data.chat_id }}"
reaction: 👍
config_entry_id: mon bot telegram
mode: single
Si sélection Non ![]()
alias: Action > Refuser +15min (Manon)
description: >-
Répond à la commande Telegram '/15m_non' pour refuser l'ajout de 15 minutes de
temps d'écran pour Manon.
triggers:
- event_type: telegram_callback
event_data:
command: /15m_non
trigger: event
conditions: []
actions:
- action: telegram_bot.answer_callback_query
metadata: {}
data:
show_alert: false
callback_query_id: "{{ trigger.event.data.id }}"
message: ❌ Pas de temps supplémentaire ❌
config_entry_id: mon bot telegram
- data:
message_id: "{{ trigger.event.data.message.message_id }}"
chat_id: "{{ trigger.event.data.chat_id }}"
inline_keyboard: null
config_entry_id: mon bot telegram
action: telegram_bot.edit_replymarkup
- action: telegram_bot.set_message_reaction
metadata: {}
data:
message_id: "{{ trigger.event.data.message.message_id }}"
chat_id: "{{ trigger.event.data.chat_id }}"
reaction: 👎
config_entry_id: mon bot telegram
mode: single
Simple et efficace comme j’aime !
Merci !
dans la légende, pour améliorer l’affichage dans le apexcharts-card, on peut afficher que les minutes si c’est moins d’une heure.
De plus, c’est permet dans certains cas, on passe de 3 a 2 lignes de légende donc le graph est plus gros, lui, comme la légende prend moins de hauteur
le code qu’il faut changer
${ var val =
Math.ceil(parseFloat(states['sensor.manon__top_app_5'].state));
var h = Math.floor(val / 60); var m = val % 60;
states['sensor.manon__top_app_5'].attributes['app_name'] + ' (' +
h + ' h ' + m + ' min)' }
à
${ var val = Math.ceil(parseFloat(states['sensor.manon__top_app_5'].state));
var h = Math.floor(val / 60); var m = val % 60; if (Number(h) >=
Number(1)) { var h_texte = h + 'h' ;} else { var h_texte = '' ; }
states['sensor.manon__top_app_5'].attributes['app_name'] + ' (' +
h_texte + m + 'min)' }
( a faire 5 fois: manon__top_app_1 , manon__top_app_2 , … )
Effectivement c’est plus esthétique ![]()
Bonjour,
Je suis intéressé par le YAML de tes cartes si tu veux bien les partager
C’est vraiment top comme affichage
Merci.
hello,
Le voici ![]()
J’utilise le thème ios-dark-mode-blue-red.
J’ai rajouté 4 automations qui ne sont pas fournies par l’intégration (les watchdogs), qui permettent à H.A de rester maître du jeu, n’hésite pas à les supprimer si ils ne sont pas utiles..
J’ai également rajouté 2 automations non visibles sur mon dashboard pour automatiquement vérrouiller le téléphone pendant les heures de cours, récupérées via l’intégration PRONOTE.. Dès qu’un cours démarre, ca vérrouille son téléphone, pendant les pauses / heure de dej / cours annulés / fin de journée, ça déverrouille automatiquement son téléphone.. il faut que je relie ça au bouton School, car je n’utilise pas la feature native de Google Family Link, trop contraignante a paramétrer…
title: Family Link - Prénom
views:
- title: Contrôle Parental
icon: mdi:shield-family
path: controle
cards:
- type: vertical-stack
cards:
- type: custom:vertical-stack-in-card
cards:
- type: custom:button-card
name: Temps d'écran Prénom
tap_action:
action: none
styles:
card:
- height: 40px
- box-shadow: none
- border: none
- padding: 0 0 0 16px
- margin: 0
name:
- font-size: 15px
- font-weight: bold
- justify-self: start
- type: custom:mod-card
card_mod:
style: |
ha-card {
height: 1px;
background: rgba(152, 152, 157, 0.3);
box-shadow: none;
border: none;
}
card:
type: custom:mushroom-title-card
title: ''
- type: horizontal-stack
cards:
- type: custom:button-card
entity: sensor.prenom_nom_screen_time_formatted
name: Temps total
icon: mdi:clock-outline
show_state: true
tap_action:
action: none
styles:
card:
- height: 90px
- background: none
- box-shadow: none
- border: none
- border-right: 1px solid rgba(152, 152, 157, 0.3)
- border-radius: 0
- padding: 20
icon:
- width: 32px
- color: var(--primary-color)
name:
- font-size: 12px
- opacity: 0.7
state:
- font-size: 16px
- font-weight: bold
- type: custom:button-card
entity: sensor.prenom_nom_installed_apps
name: Applications
icon: mdi:apps
show_state: true
state_display: |
[[[
return entity.state + ' apps';
]]]
tap_action:
action: none
styles:
card:
- height: 90px
- background: none
- box-shadow: none
- border: none
- border-right: 1px solid rgba(152, 152, 157, 0.3)
- border-radius: 0
- padding: 20
icon:
- width: 32px
- color: var(--primary-color)
name:
- font-size: 12px
- opacity: 0.7
state:
- font-size: 16px
- font-weight: bold
- type: custom:button-card
entity: sensor.prenom_nom_blocked_apps
name: Bloquées
icon: mdi:block-helper
show_state: true
state_display: |
[[[
return entity.state + ' apps';
]]]
styles:
card:
- height: 90px
- background: none
- box-shadow: none
- border: none
- border-radius: 0
- padding: 20
icon:
- width: 32px
- color: '#F44336'
name:
- font-size: 12px
- opacity: 0.7
state:
- font-size: 16px
- font-weight: bold
- type: custom:mod-card
card_mod:
style: |
ha-card {
height: 1px;
background: rgba(152, 152, 157, 0.3);
box-shadow: none;
border: none;
}
card:
type: custom:mushroom-title-card
title: ''
- type: horizontal-stack
cards:
- type: custom:button-card
card_mod:
style: |
ha-card {
display: block !important;
padding: 10px 0 !important;
}
entity: switch.prenom_nom_daily_limit
name: Daily Limit
icon: mdi:timer-sand
state:
- value: 'on'
color: '#FF9800'
styles:
card:
- background: rgba(255, 152, 0, 0.15)
- value: 'off'
styles:
icon:
- opacity: 0.5
styles:
card:
- height: 70px
- background: none
- box-shadow: none
- border: none
- border-right: 1px solid rgba(152, 152, 157, 0.3)
- border-radius: 0
icon:
- width: 28px
name:
- font-size: 13px
- font-weight: 500
- type: custom:button-card
card_mod:
style: |
ha-card {
display: block !important;
padding: 10px 0 !important;
}
entity: switch.prenom_nom_bedtime
name: Bedtime
icon: mdi:weather-night
state:
- value: 'on'
color: '#FF9800'
styles:
card:
- background: rgba(255, 152, 0, 0.15)
- value: 'off'
styles:
icon:
- opacity: 0.5
styles:
card:
- height: 70px
- background: none
- box-shadow: none
- border: none
- border-right: 1px solid rgba(152, 152, 157, 0.3)
- border-radius: 0
icon:
- width: 28px
name:
- font-size: 13px
- font-weight: 500
- type: custom:button-card
card_mod:
style: |
ha-card {
display: block !important;
padding: 10px 0 !important;
}
entity: switch.prenom_nom_school_time
name: School
icon: mdi:school
state:
- value: 'on'
color: '#FF9800'
styles:
card:
- background: rgba(255, 152, 0, 0.15)
- value: 'off'
styles:
icon:
- opacity: 0.5
styles:
card:
- height: 70px
- background: none
- box-shadow: none
- border: none
- border-radius: 0
icon:
- width: 28px
name:
- font-size: 13px
- font-weight: 500
card_mod:
style: |
ha-card {
background-color: var(--ha-card-background, var(--card-background-color, white));
}
- type: custom:vertical-stack-in-card
cards:
- type: custom:button-card
name: Téléphone Samsung (SM-S916B)
tap_action:
action: none
styles:
card:
- height: 40px
- box-shadow: none
- border: none
- padding: 0 0 0 16px
- margin: 0
name:
- font-size: 15px
- font-weight: bold
- justify-self: start
- type: custom:mod-card
card_mod:
style: |
ha-card {
height: 1px;
background: rgba(152, 152, 157, 0.3);
box-shadow: none;
border: none;
}
card:
type: custom:mushroom-title-card
title: ''
- type: horizontal-stack
cards:
- type: custom:button-card
entity: switch.sm_s916b
name: |
[[[
if (entity.state === 'on') {
return 'Déverrouillé';
} else {
return 'Verrouillé';
}
]]]
icon: mdi:cellphone
show_state: false
state:
- value: 'on'
color: '#4CAF50'
icon: mdi:cellphone
- value: 'off'
color: '#F44336'
icon: mdi:cellphone-lock
styles:
card:
- height: 70px
- background: none
- box-shadow: none
- border: none
- border-right: 1px solid rgba(152, 152, 157, 0.3)
- border-radius: 0
- padding: 0
icon:
- width: 36px
name:
- font-size: 13px
card_mod:
style: |
ha-card {
margin: 5px 0;
}
- type: custom:button-card
entity: sensor.sm_s916b_screen_time_remaining
name: Temps restant
icon: mdi:timer
show_name: false
show_state: true
state_display: |
[[[
var remaining = entity.state;
var limit = states['sensor.sm_s916b_daily_limit'].state;
return remaining + ' / ' + limit + ' min';
]]]
state:
- operator: <=
value: 15
color: '#F44336'
- operator: <=
value: 30
color: '#FF9800'
- operator: default
color: '#4CAF50'
styles:
card:
- height: 70px
- background: none
- box-shadow: none
- border: none
- border-radius: 0
- padding: 0
icon:
- width: 36px
name:
- font-size: 12px
- opacity: 0.7
state:
- font-size: 16px
- font-weight: bold
card_mod:
style: |
ha-card {
margin: 5px 0 15px;
}
- type: custom:mod-card
card_mod:
style: |
ha-card {
height: 1px;
background: rgba(152, 152, 157, 0.3);
box-shadow: none;
border: none;
margin: 0;
}
card:
type: custom:mushroom-title-card
title: ''
- type: horizontal-stack
cards:
- type: custom:button-card
name: '+15'
icon: mdi:plus
tap_action:
action: call-service
service: button.press
target:
entity_id: button.sm_s916b_15min
styles:
card:
- height: 50px
- background: none
- box-shadow: none
- border: none
- border-right: 1px solid rgba(152, 152, 157, 0.3)
- border-radius: 0
- padding: 0
icon:
- width: 24px
name:
- font-size: 13px
- font-weight: bold
- type: custom:button-card
name: '+30'
icon: mdi:plus
tap_action:
action: call-service
service: button.press
target:
entity_id: button.sm_s916b_30min
styles:
card:
- height: 50px
- background: none
- box-shadow: none
- border: none
- border-right: 1px solid rgba(152, 152, 157, 0.3)
- border-radius: 0
- padding: 0
icon:
- width: 24px
name:
- font-size: 13px
- font-weight: bold
- type: custom:button-card
name: '+60'
icon: mdi:plus
tap_action:
action: call-service
service: button.press
target:
entity_id: button.sm_s916b_60min
styles:
card:
- height: 50px
- background: none
- box-shadow: none
- border: none
- border-right: 1px solid rgba(152, 152, 157, 0.3)
- border-radius: 0
- padding: 0
icon:
- width: 24px
name:
- font-size: 13px
- font-weight: bold
- type: custom:button-card
name: Reset
icon: mdi:close
color: '#F44336'
tap_action:
action: call-service
service: button.press
target:
entity_id: button.sm_s916b_reset_bonus
styles:
card:
- height: 50px
- background: none
- box-shadow: none
- border: none
- border-radius: 0
- padding: 0
icon:
- width: 24px
name:
- font-size: 13px
- font-weight: bold
card_mod:
style: |
ha-card {
background-color: var(--ha-card-background, var(--card-background-color, white));
}
- type: custom:mod-card
card_mod:
style: |
ha-card {
height: 1px;
background: rgba(152, 152, 157, 0.3);
box-shadow: none;
border: none;
margin: 10px 0 0 0;
}
card:
type: custom:mushroom-title-card
title: ''
- type: entities
entities:
- entity: automation.antibonus
name: Bonus watchdog
- entity: automation.prenom_antideverrouillage
name: Unlock watchdog
- entity: automation.prenom_bedtime_enabler
name: Bedtime watchdog
- entity: automation.prenom_daily_limit_enabler
name: Daily limit watchdog
card_mod:
style: |
ha-card {
background-color: var(--ha-card-background, var(--card-background-color, white));
}
- type: custom:vertical-stack-in-card
cards:
- type: custom:button-card
name: Tablette Galaxy Tab
tap_action:
action: none
styles:
card:
- height: 40px
- box-shadow: none
- border: none
- padding: 0 0 0 16px
- margin: 0
name:
- font-size: 15px
- font-weight: bold
- justify-self: start
- type: custom:mod-card
card_mod:
style: |
ha-card {
height: 1px;
background: rgba(152, 152, 157, 0.3);
box-shadow: none;
border: none;
}
card:
type: custom:mushroom-title-card
title: ''
- type: horizontal-stack
cards:
- type: custom:button-card
entity: switch.galaxy_tab_prenom
name: |
[[[
if (entity.state === 'on') {
return 'Déverrouillée';
} else {
return 'Verrouillée';
}
]]]
icon: mdi:tablet
show_state: false
state:
- value: 'on'
color: '#4CAF50'
icon: mdi:tablet
- value: 'off'
color: '#F44336'
icon: mdi:tablet
styles:
card:
- height: 70px
- background: none
- box-shadow: none
- border: none
- border-right: 1px solid rgba(152, 152, 157, 0.3)
- border-radius: 0
- padding: 0
icon:
- width: 36px
name:
- font-size: 13px
card_mod:
style: |
ha-card {
margin: 5px 0;
}
- type: custom:button-card
entity: sensor.galaxy_tab_prenom_screen_time_remaining
icon: mdi:timer
show_state: true
show_name: false
state_display: |
[[[
var remaining = entity.state;
var limit = states['sensor.galaxy_tab_prenom_daily_limit'].state;
return remaining + ' / ' + limit + ' min';
]]]
state:
- operator: <=
value: 15
color: '#F44336'
- operator: <=
value: 30
color: '#FF9800'
- operator: default
color: '#4CAF50'
styles:
card:
- height: 70px
- background: none
- box-shadow: none
- border: none
- border-radius: 0
- padding: 0
icon:
- width: 36px
state:
- font-size: 16px
- font-weight: bold
card_mod:
style: |
ha-card {
margin: 5px 0;
}
- type: custom:mod-card
card_mod:
style: |
ha-card {
height: 1px;
background: rgba(152, 152, 157, 0.3);
box-shadow: none;
border: none;
margin: 0;
}
card:
type: custom:mushroom-title-card
title: ''
- type: horizontal-stack
cards:
- type: custom:button-card
name: '+15'
icon: mdi:plus
tap_action:
action: call-service
service: button.press
target:
entity_id: button.galaxy_tab_prenom_15min
styles:
card:
- height: 50px
- background: none
- box-shadow: none
- border: none
- border-right: 1px solid rgba(152, 152, 157, 0.3)
- border-radius: 0
- padding: 0
icon:
- width: 24px
name:
- font-size: 13px
- font-weight: bold
card_mod:
style: |
ha-card {
margin: 10px 0;
}
- type: custom:button-card
name: '+30'
icon: mdi:plus
tap_action:
action: call-service
service: button.press
target:
entity_id: button.galaxy_tab_prenom_30min
styles:
card:
- height: 50px
- background: none
- box-shadow: none
- border: none
- border-right: 1px solid rgba(152, 152, 157, 0.3)
- border-radius: 0
- padding: 0
icon:
- width: 24px
name:
- font-size: 13px
- font-weight: bold
card_mod:
style: |
ha-card {
margin: 10px 0;
}
- type: custom:button-card
name: '+60'
icon: mdi:plus
tap_action:
action: call-service
service: button.press
target:
entity_id: button.galaxy_tab_prenom_60min
styles:
card:
- height: 50px
- background: none
- box-shadow: none
- border: none
- border-right: 1px solid rgba(152, 152, 157, 0.3)
- border-radius: 0
- padding: 0
icon:
- width: 24px
name:
- font-size: 13px
- font-weight: bold
card_mod:
style: |
ha-card {
margin: 10px 0;
}
- type: custom:button-card
name: Reset
icon: mdi:close
color: '#F44336'
tap_action:
action: call-service
service: button.press
target:
entity_id: button.galaxy_tab_prenom_reset_bonus
styles:
card:
- height: 50px
- background: none
- box-shadow: none
- border: none
- border-radius: 0
- padding: 0
icon:
- width: 24px
name:
- font-size: 13px
- font-weight: bold
card_mod:
style: |
ha-card {
margin: 10px 0;
}
card_mod:
style: |
ha-card {
background-color: var(--ha-card-background, var(--card-background-color, white));
}
- type: custom:vertical-stack-in-card
cards:
- type: markdown
content: |
### 🏆 **Top Applications**
*Temps d'utilisation aujourd'hui*
card_mod:
style: |
ha-card {
background: none !important;
box-shadow: none !important;
border: none !important;
padding: 16px 16px 8px 16px !important;
}
- type: entities
show_header_toggle: false
card_mod:
style: |
ha-card {
background-color: inherit !important;
}
entities:
- type: custom:template-entity-row
entity: sensor.prenom_nom_top_app_1
name: >-
{{ '1. ' + (state_attr('sensor.prenom_nom_top_app_1',
'app_name') | default('Application')) }}
state: '{{ states(''sensor.prenom_nom_top_app_1'') | round(1) }} min'
icon: mdi:numeric-1-circle
- type: custom:template-entity-row
entity: sensor.prenom_nom_top_app_2
name: >-
{{ '2. ' + (state_attr('sensor.prenom_nom_top_app_2',
'app_name') | default('Application')) }}
state: '{{ states(''sensor.prenom_nom_top_app_2'') | round(1) }} min'
icon: mdi:numeric-2-circle
- type: custom:template-entity-row
entity: sensor.prenom_nom_top_app_3
name: >-
{{ '3. ' + (state_attr('sensor.prenom_nom_top_app_3',
'app_name') | default('Application')) }}
state: '{{ states(''sensor.prenom_nom_top_app_3'') | round(1) }} min'
icon: mdi:numeric-3-circle
- type: custom:template-entity-row
entity: sensor.prenom_nom_top_app_4
name: >-
{{ '4. ' + (state_attr('sensor.prenom_nom_top_app_4',
'app_name') | default('Application')) }}
state: '{{ states(''sensor.prenom_nom_top_app_4'') | round(1) }} min'
icon: mdi:numeric-4-circle
- type: custom:template-entity-row
entity: sensor.prenom_nom_top_app_5
name: >-
{{ '5. ' + (state_attr('sensor.prenom_nom_top_app_5',
'app_name') | default('Application')) }}
state: '{{ states(''sensor.prenom_nom_top_app_5'') | round(1) }} min'
icon: mdi:numeric-5-circle
- type: custom:template-entity-row
entity: sensor.prenom_nom_top_app_6
name: >-
{{ '6. ' + (state_attr('sensor.prenom_nom_top_app_6',
'app_name') | default('Application')) }}
state: '{{ states(''sensor.prenom_nom_top_app_6'') | round(1) }} min'
icon: mdi:numeric-6-circle
- type: custom:template-entity-row
entity: sensor.prenom_nom_top_app_7
name: >-
{{ '7. ' + (state_attr('sensor.prenom_nom_top_app_7',
'app_name') | default('Application')) }}
state: '{{ states(''sensor.prenom_nom_top_app_7'') | round(1) }} min'
icon: mdi:numeric-7-circle
card_mod:
style: |
ha-card {
background-color: var(--ha-card-background, var(--card-background-color, white));
}
- show_name: true
show_icon: true
show_state: true
type: glance
title: Applications téléphone
columns: 4
entities:
- entity: sensor.prenom_nom_installed_apps
name: Installées
icon: mdi:apps
- entity: sensor.prenom_nom_blocked_apps
name: Bloquées
icon: mdi:block-helper
- entity: sensor.prenom_nom_apps_with_time_limits
name: Limitées
icon: mdi:timer-lock
- entity: sensor.prenom_nom_device_count
name: Appareils
icon: mdi:devices
- type: vertical-stack
cards:
- type: custom:vertical-stack-in-card
cards:
- type: custom:button-card
name: Nintendo Switch
tap_action:
action: none
styles:
card:
- height: 40px
- box-shadow: none
- border: none
- padding: 0 0 0 16px
- margin: 0
name:
- font-size: 15px
- font-weight: bold
- justify-self: start
- type: custom:mod-card
card_mod:
style: |
ha-card {
height: 1px;
background: rgba(152, 152, 157, 0.3);
box-shadow: none;
border: none;
}
card:
type: custom:mushroom-title-card
title: ''
- type: horizontal-stack
cards:
- type: custom:button-card
entity: switch.switch_1_suspend_software_limit
name: |
[[[
if (entity.state === 'on') {
return 'Limite activée';
} else {
return 'Limite désactivée';
}
]]]
icon: mdi:tablet
show_state: false
state:
- value: 'on'
color: '#4CAF50'
icon: mdi:nintendo-switch
- value: 'off'
color: '#F44336'
icon: mdi:nintendo-switch
styles:
card:
- height: 70px
- background: none
- box-shadow: none
- border: none
- border-right: 1px solid rgba(152, 152, 157, 0.3)
- border-radius: 0
- padding: 0
icon:
- width: 36px
name:
- font-size: 13px
card_mod:
style: |
ha-card {
margin: 5px 0;
}
- type: custom:button-card
entity: sensor.switch_1_time_remaining
icon: mdi:timer
show_state: true
show_name: false
state_display: |
[[[
var remaining = Number(entity.state);
var used = Number(states['sensor.switch_1_used_screen_time'].state);
var total = remaining + used;
if (isNaN(remaining) || isNaN(used)) {
return entity.state + ' min';
}
return remaining + ' / ' + total + ' min';
]]]
state:
- operator: <=
value: 15
color: '#F44336'
- operator: <=
value: 30
color: '#FF9800'
- operator: default
color: '#4CAF50'
styles:
card:
- height: 70px
- background: none
- box-shadow: none
- border: none
- border-radius: 0
- padding: 0
icon:
- width: 36px
state:
- font-size: 16px
- font-weight: bold
card_mod:
style: |
ha-card {
margin: 5px 0;
}
card_mod:
style: |
ha-card {
background-color: var(--ha-card-background, var(--card-background-color, white));
}
title: Family Link - Prénom
views:
- title: Contrôle Parental
icon: mdi:shield-family
path: controle
cards:
- type: vertical-stack
cards:
- type: custom:vertical-stack-in-card
cards:
- type: custom:button-card
name: Temps d'écran Prénom
tap_action:
action: none
styles:
card:
- height: 40px
- box-shadow: none
- border: none
- padding: 0 0 0 16px
- margin: 0
name:
- font-size: 15px
- font-weight: bold
- justify-self: start
- type: custom:mod-card
card_mod:
style: |
ha-card {
height: 1px;
background: rgba(152, 152, 157, 0.3);
box-shadow: none;
border: none;
}
card:
type: custom:mushroom-title-card
title: ''
- type: horizontal-stack
cards:
- type: custom:button-card
entity: sensor.prenom_nom_screen_time_formatted
name: Temps total
icon: mdi:clock-outline
show_state: true
tap_action:
action: none
styles:
card:
- height: 90px
- background: none
- box-shadow: none
- border: none
- border-right: 1px solid rgba(152, 152, 157, 0.3)
- border-radius: 0
- padding: 20
icon:
- width: 32px
- color: var(--primary-color)
name:
- font-size: 12px
- opacity: 0.7
state:
- font-size: 16px
- font-weight: bold
- type: custom:button-card
entity: sensor.prenom_nom_installed_apps
name: Applications
icon: mdi:apps
show_state: true
state_display: |
[[[
return entity.state + ' apps';
]]]
tap_action:
action: none
styles:
card:
- height: 90px
- background: none
- box-shadow: none
- border: none
- border-right: 1px solid rgba(152, 152, 157, 0.3)
- border-radius: 0
- padding: 20
icon:
- width: 32px
- color: var(--primary-color)
name:
- font-size: 12px
- opacity: 0.7
state:
- font-size: 16px
- font-weight: bold
- type: custom:button-card
entity: sensor.prenom_nom_blocked_apps
name: Bloquées
icon: mdi:block-helper
show_state: true
state_display: |
[[[
return entity.state + ' apps';
]]]
styles:
card:
- height: 90px
- background: none
- box-shadow: none
- border: none
- border-radius: 0
- padding: 20
icon:
- width: 32px
- color: '#F44336'
name:
- font-size: 12px
- opacity: 0.7
state:
- font-size: 16px
- font-weight: bold
- type: custom:mod-card
card_mod:
style: |
ha-card {
height: 1px;
background: rgba(152, 152, 157, 0.3);
box-shadow: none;
border: none;
}
card:
type: custom:mushroom-title-card
title: ''
- type: horizontal-stack
cards:
- type: custom:button-card
card_mod:
style: |
ha-card {
display: block !important;
padding: 10px 0 !important;
}
entity: switch.prenom_nom_daily_limit
name: Daily Limit
icon: mdi:timer-sand
state:
- value: 'on'
color: '#FF9800'
styles:
card:
- background: rgba(255, 152, 0, 0.15)
- value: 'off'
styles:
icon:
- opacity: 0.5
styles:
card:
- height: 70px
- background: none
- box-shadow: none
- border: none
- border-right: 1px solid rgba(152, 152, 157, 0.3)
- border-radius: 0
icon:
- width: 28px
name:
- font-size: 13px
- font-weight: 500
- type: custom:button-card
card_mod:
style: |
ha-card {
display: block !important;
padding: 10px 0 !important;
}
entity: switch.prenom_nom_bedtime
name: Bedtime
icon: mdi:weather-night
state:
- value: 'on'
color: '#FF9800'
styles:
card:
- background: rgba(255, 152, 0, 0.15)
- value: 'off'
styles:
icon:
- opacity: 0.5
styles:
card:
- height: 70px
- background: none
- box-shadow: none
- border: none
- border-right: 1px solid rgba(152, 152, 157, 0.3)
- border-radius: 0
icon:
- width: 28px
name:
- font-size: 13px
- font-weight: 500
- type: custom:button-card
card_mod:
style: |
ha-card {
display: block !important;
padding: 10px 0 !important;
}
entity: switch.prenom_nom_school_time
name: School
icon: mdi:school
state:
- value: 'on'
color: '#FF9800'
styles:
card:
- background: rgba(255, 152, 0, 0.15)
- value: 'off'
styles:
icon:
- opacity: 0.5
styles:
card:
- height: 70px
- background: none
- box-shadow: none
- border: none
- border-radius: 0
icon:
- width: 28px
name:
- font-size: 13px
- font-weight: 500
card_mod:
style: |
ha-card {
background-color: var(--ha-card-background, var(--card-background-color, white));
}
- type: custom:vertical-stack-in-card
cards:
- type: custom:button-card
name: Téléphone Samsung (SM-S916B)
tap_action:
action: none
styles:
card:
- height: 40px
- box-shadow: none
- border: none
- padding: 0 0 0 16px
- margin: 0
name:
- font-size: 15px
- font-weight: bold
- justify-self: start
- type: custom:mod-card
card_mod:
style: |
ha-card {
height: 1px;
background: rgba(152, 152, 157, 0.3);
box-shadow: none;
border: none;
}
card:
type: custom:mushroom-title-card
title: ''
- type: horizontal-stack
cards:
- type: custom:button-card
entity: switch.sm_s916b
name: |
[[[
if (entity.state === 'on') {
return 'Déverrouillé';
} else {
return 'Verrouillé';
}
]]]
icon: mdi:cellphone
show_state: false
state:
- value: 'on'
color: '#4CAF50'
icon: mdi:cellphone
- value: 'off'
color: '#F44336'
icon: mdi:cellphone-lock
styles:
card:
- height: 70px
- background: none
- box-shadow: none
- border: none
- border-right: 1px solid rgba(152, 152, 157, 0.3)
- border-radius: 0
- padding: 0
icon:
- width: 36px
name:
- font-size: 13px
card_mod:
style: |
ha-card {
margin: 5px 0;
}
- type: custom:button-card
entity: sensor.sm_s916b_screen_time_remaining
name: Temps restant
icon: mdi:timer
show_name: false
show_state: true
state_display: |
[[[
var remaining = entity.state;
var limit = states['sensor.sm_s916b_daily_limit'].state;
return remaining + ' / ' + limit + ' min';
]]]
state:
- operator: <=
value: 15
color: '#F44336'
- operator: <=
value: 30
color: '#FF9800'
- operator: default
color: '#4CAF50'
styles:
card:
- height: 70px
- background: none
- box-shadow: none
- border: none
- border-radius: 0
- padding: 0
icon:
- width: 36px
name:
- font-size: 12px
- opacity: 0.7
state:
- font-size: 16px
- font-weight: bold
card_mod:
style: |
ha-card {
margin: 5px 0 15px;
}
- type: custom:mod-card
card_mod:
style: |
ha-card {
height: 1px;
background: rgba(152, 152, 157, 0.3);
box-shadow: none;
border: none;
margin: 0;
}
card:
type: custom:mushroom-title-card
title: ''
- type: horizontal-stack
cards:
- type: custom:button-card
name: '+15'
icon: mdi:plus
tap_action:
action: call-service
service: button.press
target:
entity_id: button.sm_s916b_15min
styles:
card:
- height: 50px
- background: none
- box-shadow: none
- border: none
- border-right: 1px solid rgba(152, 152, 157, 0.3)
- border-radius: 0
- padding: 0
icon:
- width: 24px
name:
- font-size: 13px
- font-weight: bold
- type: custom:button-card
name: '+30'
icon: mdi:plus
tap_action:
action: call-service
service: button.press
target:
entity_id: button.sm_s916b_30min
styles:
card:
- height: 50px
- background: none
- box-shadow: none
- border: none
- border-right: 1px solid rgba(152, 152, 157, 0.3)
- border-radius: 0
- padding: 0
icon:
- width: 24px
name:
- font-size: 13px
- font-weight: bold
- type: custom:button-card
name: '+60'
icon: mdi:plus
tap_action:
action: call-service
service: button.press
target:
entity_id: button.sm_s916b_60min
styles:
card:
- height: 50px
- background: none
- box-shadow: none
- border: none
- border-right: 1px solid rgba(152, 152, 157, 0.3)
- border-radius: 0
- padding: 0
icon:
- width: 24px
name:
- font-size: 13px
- font-weight: bold
- type: custom:button-card
name: Reset
icon: mdi:close
tap_action:
action: call-service
service: button.press
target:
entity_id: button.sm_s916b_reset_bonus
entity: sensor.sm_s916b_active_bonus
triggers_update: sensor.sm_s916b_active_bonus
color: >-
[[[ return
(Number(states['sensor.sm_s916b_active_bonus']?.state) >
0) ? '#F44336' : 'var(--secondary-text-color)'; ]]]
styles:
card:
- height: 50px
- background: none
- box-shadow: none
- border: none
- border-radius: 0
- padding: 0
icon:
- width: 24px
name:
- font-size: 13px
- font-weight: bold
card_mod:
style: |
ha-card {
background-color: var(--ha-card-background, var(--card-background-color, white));
}
- type: custom:mod-card
card_mod:
style: |
ha-card {
height: 1px;
background: rgba(152, 152, 157, 0.3);
box-shadow: none;
border: none;
margin: 10px 0 0 0;
}
card:
type: custom:mushroom-title-card
title: ''
- type: entities
entities:
- entity: automation.antibonus
name: Bonus watchdog
- entity: automation.prenom_antideverrouillage
name: Unlock watchdog
- entity: automation.prenom_bedtime_enabler
name: Bedtime watchdog
- entity: automation.prenom_daily_limit_enabler
name: Daily limit watchdog
card_mod:
style: |
ha-card {
background-color: inherit;
}
card_mod:
style: |
ha-card {
background-color: var(--ha-card-background, var(--card-background-color, white));
}
- type: custom:vertical-stack-in-card
cards:
- type: custom:button-card
name: Tablette Galaxy Tab
tap_action:
action: none
styles:
card:
- height: 40px
- box-shadow: none
- border: none
- padding: 0 0 0 16px
- margin: 0
name:
- font-size: 15px
- font-weight: bold
- justify-self: start
- type: custom:mod-card
card_mod:
style: |
ha-card {
height: 1px;
background: rgba(152, 152, 157, 0.3);
box-shadow: none;
border: none;
}
card:
type: custom:mushroom-title-card
title: ''
- type: horizontal-stack
cards:
- type: custom:button-card
entity: switch.galaxy_tab_prenom
name: |
[[[
if (entity.state === 'on') {
return 'Déverrouillée';
} else {
return 'Verrouillée';
}
]]]
icon: mdi:tablet
show_state: false
state:
- value: 'on'
color: '#4CAF50'
icon: mdi:tablet
- value: 'off'
color: '#F44336'
icon: mdi:tablet
styles:
card:
- height: 70px
- background: none
- box-shadow: none
- border: none
- border-right: 1px solid rgba(152, 152, 157, 0.3)
- border-radius: 0
- padding: 0
icon:
- width: 36px
name:
- font-size: 13px
card_mod:
style: |
ha-card {
margin: 5px 0;
}
- type: custom:button-card
entity: sensor.galaxy_tab_prenom_screen_time_remaining
icon: mdi:timer
show_state: true
show_name: false
state_display: |
[[[
var remaining = entity.state;
var limit = states['sensor.galaxy_tab_prenom_daily_limit'].state;
return remaining + ' / ' + limit + ' min';
]]]
state:
- operator: <=
value: 15
color: '#F44336'
- operator: <=
value: 30
color: '#FF9800'
- operator: default
color: '#4CAF50'
styles:
card:
- height: 70px
- background: none
- box-shadow: none
- border: none
- border-radius: 0
- padding: 0
icon:
- width: 36px
state:
- font-size: 16px
- font-weight: bold
card_mod:
style: |
ha-card {
margin: 5px 0;
}
- type: custom:mod-card
card_mod:
style: |
ha-card {
height: 1px;
background: rgba(152, 152, 157, 0.3);
box-shadow: none;
border: none;
margin: 0;
}
card:
type: custom:mushroom-title-card
title: ''
- type: horizontal-stack
cards:
- type: custom:button-card
name: '+15'
icon: mdi:plus
tap_action:
action: call-service
service: button.press
target:
entity_id: button.galaxy_tab_prenom_15min
styles:
card:
- height: 50px
- background: none
- box-shadow: none
- border: none
- border-right: 1px solid rgba(152, 152, 157, 0.3)
- border-radius: 0
- padding: 0
icon:
- width: 24px
name:
- font-size: 13px
- font-weight: bold
card_mod:
style: |
ha-card {
margin: 10px 0;
}
- type: custom:button-card
name: '+30'
icon: mdi:plus
tap_action:
action: call-service
service: button.press
target:
entity_id: button.galaxy_tab_prenom_30min
styles:
card:
- height: 50px
- background: none
- box-shadow: none
- border: none
- border-right: 1px solid rgba(152, 152, 157, 0.3)
- border-radius: 0
- padding: 0
icon:
- width: 24px
name:
- font-size: 13px
- font-weight: bold
card_mod:
style: |
ha-card {
margin: 10px 0;
}
- type: custom:button-card
name: '+60'
icon: mdi:plus
tap_action:
action: call-service
service: button.press
target:
entity_id: button.galaxy_tab_prenom_60min
styles:
card:
- height: 50px
- background: none
- box-shadow: none
- border: none
- border-right: 1px solid rgba(152, 152, 157, 0.3)
- border-radius: 0
- padding: 0
icon:
- width: 24px
name:
- font-size: 13px
- font-weight: bold
card_mod:
style: |
ha-card {
margin: 10px 0;
}
- type: custom:button-card
name: Reset
icon: mdi:close
tap_action:
action: call-service
service: button.press
target:
entity_id: button.galaxy_tab_prenom_reset_bonus
entity: sensor.galaxy_tab_prenom_active_bonus
triggers_update: sensor.galaxy_tab_prenom_active_bonus
color: >-
[[[ return
(Number(states['sensor.galaxy_tab_prenom_active_bonus']?.state)
> 0) ? '#F44336' : 'var(--secondary-text-color)'; ]]]
styles:
card:
- height: 50px
- background: none
- box-shadow: none
- border: none
- border-radius: 0
- padding: 0
icon:
- width: 24px
name:
- font-size: 13px
- font-weight: bold
card_mod:
style: |
ha-card {
margin: 10px 0;
}
card_mod:
style: |
ha-card {
background-color: var(--ha-card-background, var(--card-background-color, white));
}
- type: custom:vertical-stack-in-card
cards:
- type: custom:button-card
name: Applications les + utilisées aujourd'hui
tap_action:
action: none
styles:
card:
- height: 40px
- box-shadow: none
- border: none
- padding: 0 0 0 16px
- margin: 0
name:
- font-size: 15px
- font-weight: bold
- justify-self: start
- type: custom:mod-card
card_mod:
style: |
ha-card {
height: 1px;
background: rgba(152, 152, 157, 0.3);
box-shadow: none;
border: none;
}
card:
type: custom:mushroom-title-card
title: ''
- type: entities
show_header_toggle: false
card_mod:
style: |
ha-card {
background-color: inherit !important;
}
entities:
- type: custom:template-entity-row
entity: sensor.prenom_nom_top_app_1
name: >-
{{ state_attr('sensor.prenom_nom_top_app_1', 'app_name') |
default('Application') }}
state: '{{ states(''sensor.prenom_nom_top_app_1'') | round(1) }} min'
icon: mdi:numeric-1-circle
- type: custom:template-entity-row
entity: sensor.prenom_nom_top_app_2
name: >-
{{ state_attr('sensor.prenom_nom_top_app_2', 'app_name') |
default('Application') }}
state: '{{ states(''sensor.prenom_nom_top_app_2'') | round(1) }} min'
icon: mdi:numeric-2-circle
- type: custom:template-entity-row
entity: sensor.prenom_nom_top_app_3
name: >-
{{ state_attr('sensor.prenom_nom_top_app_3', 'app_name') |
default('Application') }}
state: '{{ states(''sensor.prenom_nom_top_app_3'') | round(1) }} min'
icon: mdi:numeric-3-circle
- type: custom:template-entity-row
entity: sensor.prenom_nom_top_app_4
name: >-
{{ state_attr('sensor.prenom_nom_top_app_4', 'app_name') |
default('Application') }}
state: '{{ states(''sensor.prenom_nom_top_app_4'') | round(1) }} min'
icon: mdi:numeric-4-circle
- type: custom:template-entity-row
entity: sensor.prenom_nom_top_app_5
name: >-
{{ state_attr('sensor.prenom_nom_top_app_5', 'app_name') |
default('Application') }}
state: '{{ states(''sensor.prenom_nom_top_app_5'') | round(1) }} min'
icon: mdi:numeric-5-circle
- type: custom:template-entity-row
entity: sensor.prenom_nom_top_app_6
name: >-
{{ state_attr('sensor.prenom_nom_top_app_6', 'app_name') |
default('Application') }}
state: '{{ states(''sensor.prenom_nom_top_app_6'') | round(1) }} min'
icon: mdi:numeric-6-circle
- type: custom:template-entity-row
entity: sensor.prenom_nom_top_app_7
name: >-
{{ state_attr('sensor.prenom_nom_top_app_7', 'app_name') |
default('Application') }}
state: '{{ states(''sensor.prenom_nom_top_app_7'') | round(1) }} min'
icon: mdi:numeric-7-circle
card_mod:
style: |
ha-card {
background-color: var(--ha-card-background, var(--card-background-color, white));
}
- type: custom:vertical-stack-in-card
cards:
- type: custom:button-card
name: Statistiques des appareils
tap_action:
action: none
styles:
card:
- height: 40px
- box-shadow: none
- border: none
- padding: 0 0 0 16px
- margin: 0
name:
- font-size: 15px
- font-weight: bold
- justify-self: start
- type: custom:mod-card
card_mod:
style: |
ha-card {
height: 1px;
background: rgba(152, 152, 157, 0.3);
box-shadow: none;
border: none;
}
card:
type: custom:mushroom-title-card
title: ''
- show_name: true
show_icon: true
show_state: true
type: glance
columns: 4
entities:
- entity: sensor.prenom_nom_installed_apps
name: Installées
icon: mdi:apps
- entity: sensor.prenom_nom_blocked_apps
name: Bloquées
icon: mdi:block-helper
- entity: sensor.prenom_nom_apps_with_time_limits
name: Limitées
icon: mdi:timer-lock
- entity: sensor.prenom_nom_device_count
name: Appareils
icon: mdi:devices
card_mod:
style: |
ha-card {
background-color: inherit !important;
}
- type: vertical-stack
cards:
- type: custom:vertical-stack-in-card
cards:
- type: custom:button-card
name: Nintendo Switch
tap_action:
action: none
styles:
card:
- height: 40px
- box-shadow: none
- border: none
- padding: 0 0 0 16px
- margin: 0
name:
- font-size: 15px
- font-weight: bold
- justify-self: start
- type: custom:mod-card
card_mod:
style: |
ha-card {
height: 1px;
background: rgba(152, 152, 157, 0.3);
box-shadow: none;
border: none;
}
card:
type: custom:mushroom-title-card
title: ''
- type: horizontal-stack
cards:
- type: custom:button-card
entity: switch.switch_1_suspend_software_limit
name: |
[[[
if (entity.state === 'on') {
return 'Limite activée';
} else {
return 'Limite désactivée';
}
]]]
icon: mdi:tablet
show_state: false
state:
- value: 'on'
color: '#4CAF50'
icon: mdi:nintendo-switch
- value: 'off'
color: '#F44336'
icon: mdi:nintendo-switch
styles:
card:
- height: 70px
- background: none
- box-shadow: none
- border: none
- border-right: 1px solid rgba(152, 152, 157, 0.3)
- border-radius: 0
- padding: 0
icon:
- width: 36px
name:
- font-size: 13px
card_mod:
style: |
ha-card {
margin: 5px 0;
}
- type: custom:button-card
entity: sensor.switch_1_time_remaining
icon: mdi:timer
show_state: true
show_name: false
state_display: |
[[[
var remaining = Number(entity.state);
var used = Number(states['sensor.switch_1_used_screen_time'].state);
var total = remaining + used;
if (isNaN(remaining) || isNaN(used)) {
return entity.state + ' min';
}
return remaining + ' / ' + total + ' min';
]]]
state:
- operator: <=
value: 15
color: '#F44336'
- operator: <=
value: 30
color: '#FF9800'
- operator: default
color: '#4CAF50'
styles:
card:
- height: 70px
- background: none
- box-shadow: none
- border: none
- border-radius: 0
- padding: 0
icon:
- width: 36px
state:
- font-size: 16px
- font-weight: bold
card_mod:
style: |
ha-card {
margin: 5px 0;
}
card_mod:
style: |
ha-card {
background-color: var(--ha-card-background, var(--card-background-color, white));
}
- type: custom:vertical-stack-in-card
cards:
- type: custom:button-card
name: Temps d'écran Prénom
tap_action:
action: none
styles:
card:
- height: 40px
- box-shadow: none
- border: none
- padding: 0 0 0 16px
- margin: 0
name:
- font-size: 15px
- font-weight: bold
- justify-self: start
- type: custom:mod-card
card_mod:
style: |
ha-card {
height: 1px;
background: rgba(152, 152, 157, 0.3);
box-shadow: none;
border: none;
}
card:
type: custom:mushroom-title-card
title: ''
- type: custom:stack-in-card
card_mod:
style: |
ha-card {
background-color: inherit;
}
:host {
--stack-card-gap: 0;
}
mode: horizontal
cards:
- type: custom:button-card
entity: sensor.prenom_nom_screen_time_formatted
name: Temps total
icon: mdi:clock-outline
show_state: true
tap_action:
action: none
styles:
card:
- height: 90px
- background: none
- box-shadow: none
- border: none
- border-right: 1px solid rgba(152, 152, 157, 0.3)
- border-radius: 0
- padding: 20
icon:
- width: 32px
- color: var(--primary-color)
name:
- font-size: 12px
- opacity: 0.7
state:
- font-size: 16px
- font-weight: bold
- type: custom:button-card
entity: sensor.prenom_nom_installed_apps
name: Applications
icon: mdi:apps
show_state: true
state_display: |
[[[
return entity.state + ' apps';
]]]
tap_action:
action: none
styles:
card:
- height: 90px
- background: none
- box-shadow: none
- border: none
- border-right: 1px solid rgba(152, 152, 157, 0.3)
- border-radius: 0
- padding: 20
icon:
- width: 32px
- color: var(--primary-color)
name:
- font-size: 12px
- opacity: 0.7
state:
- font-size: 16px
- font-weight: bold
- type: custom:button-card
entity: sensor.prenom_nom_blocked_apps
name: Bloquées
icon: mdi:block-helper
show_state: true
state_display: |
[[[
return entity.state + ' apps';
]]]
styles:
card:
- height: 90px
- background: none
- box-shadow: none
- border: none
- border-radius: 0
- padding: 20
icon:
- width: 32px
- color: '#F44336'
name:
- font-size: 12px
- opacity: 0.7
state:
- font-size: 16px
- font-weight: bold
- type: custom:mod-card
card_mod:
style: |
ha-card {
height: 1px;
background: rgba(152, 152, 157, 0.3);
box-shadow: none;
border: none;
}
card:
type: custom:mushroom-title-card
title: ''
- type: custom:stack-in-card
card_mod:
style: |
ha-card {
background-color: inherit;
}
:host {
--stack-card-gap: 0;
}
mode: horizontal
cards:
- type: custom:button-card
card_mod:
style: |
ha-card {
display: block !important;
padding: 10px 0 !important;
}
entity: switch.prenom_nom_daily_limit
name: Daily Limit
icon: mdi:timer-sand
state:
- value: 'on'
color: '#FF9800'
styles:
card:
- background: rgba(255, 152, 0, 0.15)
- value: 'off'
styles:
icon:
- opacity: 0.5
styles:
card:
- height: 70px
- background: none
- box-shadow: none
- border: none
- border-right: 1px solid rgba(152, 152, 157, 0.3)
- border-radius: 0
icon:
- width: 28px
name:
- font-size: 13px
- font-weight: 500
- type: custom:button-card
card_mod:
style: |
ha-card {
display: block !important;
padding: 10px 0 !important;
}
entity: switch.prenom_nom_bedtime
name: Bedtime
icon: mdi:weather-night
state:
- value: 'on'
color: '#FF9800'
styles:
card:
- background: rgba(255, 152, 0, 0.15)
- value: 'off'
styles:
icon:
- opacity: 0.5
styles:
card:
- height: 70px
- background: none
- box-shadow: none
- border: none
- border-right: 1px solid rgba(152, 152, 157, 0.3)
- border-radius: 0
icon:
- width: 28px
name:
- font-size: 13px
- font-weight: 500
- type: custom:button-card
card_mod:
style: |
ha-card {
display: block !important;
padding: 10px 0 !important;
}
entity: switch.prenom_nom_school_time
name: School
icon: mdi:school
state:
- value: 'on'
color: '#FF9800'
styles:
card:
- background: rgba(255, 152, 0, 0.15)
- value: 'off'
styles:
icon:
- opacity: 0.5
styles:
card:
- height: 70px
- background: none
- box-shadow: none
- border: none
- border-radius: 0
icon:
- width: 28px
name:
- font-size: 13px
- font-weight: 500
card_mod:
style: |
ha-card {
background-color: var(--ha-card-background, var(--card-background-color, white));
}
type: masonry
theme: ios-dark-mode-blue-red
Merci beaucoup pour les templates. Ca fonctionne nickel.
Qu’entends-tu par rester maître ?
Merci
Mon fils a visiblement trouvé comment hacker Family Link… Grâce à ces watchdogs, H.A reprends le dessus.. un bonus ajouté par Family Link? Les limites du soir désactivés?
H.A annule tout ![]()
Super partage de code mais je serais curieux comment faire pour que HA prenne le dessus par rapport à Family link parce que ma fille à l’air de savoir aussi hacker Family link .
Pourrais tu developer tes watchdogs ? Si possible bien entendu en espérant que je n’abuse pas
Haha, aucun souci, je me sens moins seul ![]()
voici mes 4 automations :
Anti bonus
alias: "Prénom - Antibonus "
description: ""
triggers:
- trigger: numeric_state
entity_id:
- sensor.sm_s916b_active_bonus
attribute: has_bonus
above: 0
conditions: []
actions:
- action: button.press
metadata: {}
data: {}
target:
entity_id: button.sm_s916b_reset_bonus
- action: notify.mobile_app_sm_s936b
metadata: {}
data:
title: Antibonus téléphone
message: >
Antibonus déclenché. has_bonus actuel: {{
trigger.to_state.attributes.has_bonus }} (précédent: {{
trigger.from_state.attributes.has_bonus | default('n/a') }})
mode: single
Anti déverrouillage
alias: Prénom - Antideverrouillage
description: Si le switch est activé alors qu'il ne reste plus de temps, le repasser à OFF.
triggers:
- trigger: state
entity_id: switch.sm_s916b
to: "on"
conditions:
- condition: numeric_state
entity_id: sensor.sm_s916b_screen_time_remaining
below: 1
actions:
- action: switch.turn_off
target:
entity_id: switch.sm_s916b
data: {}
mode: single
Bedtime auto-enabler
alias: Prénom - Bedtime enabler
description: ""
triggers:
- trigger: state
entity_id:
- switch.firstname_name_bedtime
from: "on"
to: "off"
conditions: []
actions:
- action: switch.turn_on
metadata: {}
data: {}
target:
entity_id: switch.firstname_name_bedtime
mode: single
Daily limit auto-enabler
alias: Prénom - Daily limit enabler
description: ""
triggers:
- trigger: state
entity_id:
- switch.firstname_name_daily_limit
from: "on"
to: "off"
conditions: []
actions:
- action: switch.turn_on
metadata: {}
data: {}
target:
entity_id: switch.firstname_name_daily_limit
mode: single
Les enfants sont sauvés de l’espionnage parental, trop super content pour eux ![]()
Ils viennent aussi sur ce forum trouver des solutions ![]()
Bob




