Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ########################################################################################################
- # #
- # Design System #
- # #
- ########################################################################################################
- icon:
- color: var(--google-grey-500)
- show_icon: true
- show_name: false
- show_label: false
- size: 20px
- custom_fields:
- notification: >
- [[[
- if (entity.state =='unavailable'){
- return `<ha-icon icon="mdi:exclamation" style="width: 12px; height: 12px; color: white;"></ha-icon>`
- }
- ]]]
- state:
- - styles:
- custom_fields:
- notification:
- - border-radius: 50%
- - position: absolute
- - left: 24px
- - top: -2px
- - height: 16px
- - width: 16px
- - border: 2px solid var(--card-background-color)
- - font-size: 12px
- - line-height: 14px
- - background-color: >
- [[[
- return "rgba(var(--couleur-rouge),1)";
- ]]]
- value: unavailable
- styles:
- card:
- - border-radius: 21px
- - box-shadow: none
- - padding: 0px
- grid:
- - grid-template-areas: '"i"'
- - grid-template-columns: min-content
- - grid-template-rows: min-content
- icon:
- - color: 'rgba(var(--couleur-theme),0.2)'
- img_cell:
- - background-color: 'rgba(var(--couleur-theme),0.05)'
- - border-radius: 50%
- - place-self: center
- - width: 42px
- - height: 42px
- ########################################################################################################
- icon_info:
- color: var(--google-grey-500)
- show_icon: true
- show_name: true
- show_label: true
- size: 20px
- custom_fields:
- notification: >
- [[[
- if (entity.state =='unavailable'){
- return `<ha-icon icon="mdi:exclamation" style="width: 12px; height: 12px; color: white;"></ha-icon>`
- }
- ]]]
- state:
- - styles:
- custom_fields:
- notification:
- - border-radius: 50%
- - position: absolute
- - left: 24px
- - top: -2px
- - height: 16px
- - width: 16px
- - border: 2px solid var(--card-background-color)
- - font-size: 12px
- - line-height: 14px
- - background-color: >
- [[[
- return "rgba(var(--couleur-rouge),1)";
- ]]]
- value: unavailable
- styles:
- card:
- - border-radius: 21px 8px 8px 21px
- - box-shadow: none
- - padding: 0px
- grid:
- - grid-template-areas: '"i n" "i l"'
- - grid-template-columns: min-content auto
- - grid-template-rows: min-content min-content
- icon:
- - color: 'rgba(var(--couleur-theme),0.2)'
- img_cell:
- - background-color: 'rgba(var(--couleur-theme),0.05)'
- - border-radius: 50%
- - place-self: center
- - width: 42px
- - height: 42px
- name:
- - align-self: end
- - justify-self: start
- - font-weight: bold
- - font-size: 14px
- - margin-left: 12px
- label:
- - justify-self: start
- - align-self: start
- - font-weight: bolder
- - font-size: 12px
- - filter: opacity(40%)
- - margin-left: 12px
- state:
- - justify-self: start
- - align-self: start
- - font-weight: bolder
- - font-size: 12px
- - filter: opacity(40%)
- - margin-left: 12px
- ########################################################################################################
- icon_info_bg:
- color: var(--google-grey-500)
- show_icon: true
- show_name: true
- show_label: true
- size: 20px
- custom_fields:
- notification: >
- [[[
- if (entity.state =='unavailable'){
- return `<ha-icon icon="mdi:exclamation" style="width: 12px; height: 12px; color: white;"></ha-icon>`
- }
- ]]]
- state:
- - styles:
- custom_fields:
- notification:
- - border-radius: 50%
- - position: absolute
- - left: 38px
- - top: 8px
- - height: 16px
- - width: 16px
- - border: 2px solid var(--card-background-color)
- - font-size: 12px
- - line-height: 14px
- - background-color: >
- [[[
- return "rgba(var(--couleur-rouge),1)";
- ]]]
- value: unavailable
- styles:
- card:
- - border-radius: 20px
- - box-shadow: var(--box-shadow)
- - padding: 12px
- grid:
- - grid-template-areas: '"i n" "i l"'
- - grid-template-columns: min-content auto
- - grid-template-rows: min-content min-content
- icon:
- - color: 'rgba(var(--couleur-theme),0.2)'
- img_cell:
- - background-color: 'rgba(var(--couleur-theme),0.05)'
- - border-radius: 50%
- - place-self: center
- - width: 42px
- - height: 42px
- name:
- - align-self: end
- - justify-self: start
- - font-weight: bold
- - font-size: 14px
- - margin-left: 12px
- label:
- - justify-self: start
- - align-self: start
- - font-weight: bolder
- - font-size: 12px
- - filter: opacity(40%)
- - margin-left: 12px
- state:
- - justify-self: start
- - align-self: start
- - font-weight: bolder
- - font-size: 12px
- - filter: opacity(40%)
- - margin-left: 12px
- ########################################################################################################
- list_items:
- styles:
- card:
- - box-shadow: none
- - padding: 0px
- grid:
- - grid-template-areas: '"item1 item2 item3"'
- - grid-template-columns: 1fr 1fr 1fr
- - grid-template-rows: min-content
- - column-gap: 7px
- list_items_line:
- styles:
- card:
- - box-shadow: none
- - padding: 0px
- grid:
- - grid-template-areas: '"item1 item2 item3"'
- - grid-template-columns: max-content max-content max-content
- - grid-template-rows: min-content
- - column-gap: 8px
- ########################################################################################################
- icon_info_line:
- color: var(--google-grey-500)
- show_icon: true
- show_name: false
- show_label: true
- size: 100%
- styles:
- card:
- - box-shadow: none
- - padding: 0px
- grid:
- - grid-template-areas: '"i l"'
- - grid-template-columns: max_content auto
- - grid-template-rows: min-content
- img_cell:
- - place-self: center
- - width: 14px
- - height: 24px
- label:
- - justify-self: start
- - align-self: center
- - font-weight: bolder
- - font-size: 12px
- - margin-left: 0px
- - filter: opacity(40%)
- ########################################################################################################
- # #
- # VOLETS #
- # #
- ########################################################################################################
- cover:
- tap_action:
- action: more-info
- icon: |
- [[[
- var icon = 'mdi:window-shutter';
- if (entity.attributes.current_position == 0){
- var icon = 'mdi:window-shutter';
- } else
- var icon = 'mdi:window-shutter-open';
- return icon ;
- ]]]
- label: >-
- [[[
- if (entity.attributes.power_consumption != '0'){
- return 'Mouvement';
- }else{
- if (entity.attributes.current_position == 0){
- var etat = "Fermé";
- }else{
- var etat = "Ouvert" + ' • ' + (entity.attributes.current_position) + '%' ;
- }
- return etat ;
- }
- ]]]
- state:
- - operator: template
- value: >
- [[[
- return entity.attributes.current_position != 0;
- ]]]
- styles:
- icon:
- - color: 'rgba(var(--couleur-bleu),1)'
- img_cell:
- - background-color: 'rgba(var(--couleur-bleu),0.2)'
- ####################################################
- # #
- # VOLETS AVEC BOUTONS #
- # #
- ####################################################
- cover_buttons:
- variables:
- entity: "cover.fibaro_cover_balcon"
- name: "Default name"
- styles:
- card:
- - border-radius: 20px
- - box-shadow: var(--box-shadow)
- - padding: 12px
- grid:
- - grid-template-areas: '"item1" "item2"'
- - grid-template-columns: 1fr
- - grid-template-rows: min-content min-content
- - row-gap: 12px
- custom_fields:
- item1:
- card:
- entity: '[[[ return variables.entity ]]]'
- name: '[[[ return variables.name ]]]'
- tap_action:
- action: more-info
- template:
- - icon_info
- - cover
- type: 'custom:button-card'
- item2:
- card:
- template: list_items
- type: 'custom:button-card'
- custom_fields:
- item1:
- card:
- icon: 'mdi:arrow-down'
- tap_action:
- action: call-service
- service: cover.close_cover
- service_data:
- entity_id: '[[[ return variables.entity ]]]'
- type: 'custom:button-card'
- template: widget_icon
- item2:
- card:
- icon: 'mdi:pause'
- tap_action:
- action: call-service
- service: cover.stop_cover
- service_data:
- entity_id: '[[[ return variables.entity ]]]'
- type: 'custom:button-card'
- template: widget_icon
- item3:
- card:
- icon: 'mdi:arrow-up'
- tap_action:
- action: call-service
- service: cover.open_cover
- service_data:
- entity_id: '[[[ return variables.entity ]]]'
- type: 'custom:button-card'
- template: widget_icon
- ########################################################################################################
- # #
- # LUMIERES #
- # #
- ########################################################################################################
- light:
- tap_action:
- action: toggle
- hold_action:
- action: more-info
- label: >-
- [[[ if (entity.state !='unavailable'){
- if (entity.state =='off'){
- var bri = Math.round(entity.attributes.brightness / 2.55);
- return 'Off';
- }else{
- var bri = Math.round(entity.attributes.brightness / 2.55);
- return (bri ? bri : '0') + '%';
- }
- }else{
- return "Indisponible";
- }
- ]]]
- template:
- - jaune
- ########################################################################################################
- # #
- # GENERIQUE #
- # #
- ########################################################################################################
- generique:
- label: >
- [[[return entity.state + " " + entity.attributes.unit_of_measurement]]]
- styles:
- icon:
- - color: 'rgba(var(--couleur-theme),0.9)'
- grid:
- - grid-template-areas: '"i l" "i n"'
- - grid-template-columns: min-content auto
- - grid-template-rows: min-content min-content
- label:
- - align-self: end
- - justify-self: start
- - font-weight: bold
- - font-size: 14px
- - margin-left: 12px
- - filter: opacity(100%)
- name:
- - justify-self: start
- - align-self: start
- - font-weight: bolder
- - font-size: 12px
- - filter: opacity(40%)
- - margin-left: 12px
- ########################################################################################################
- # #
- # PRISE #
- # #
- ########################################################################################################
- prise:
- tap_action:
- action: more-info
- label: |-
- [[[ if (entity.state =='on')
- var etat = "On";
- else
- var etat = "Off";
- return etat ; ]]]
- template:
- - jaune
- ####################################################
- prise_conso:
- hold_action:
- action: more-info
- entity: sensor.shelly_prise_salon_current_consumption
- label: |-
- [[[ if (entity.state =='on')
- var etat = "On • " + states["sensor.shelly_prise_salon_current_consumption"].state + "W";
- else
- var etat = "Off";
- return etat ; ]]]
- template: prise
- ########################################################################################################
- # #
- # MOUVEMENT #
- # #
- ########################################################################################################
- mouvement:
- show_last_changed: true
- template:
- - bleu
- ########################################################################################################
- # #
- # CHAUFFE EAU #
- # #
- ########################################################################################################
- chauffe-eau:
- icon: 'mdi:waves'
- tap_action:
- action: more-info
- hold_action:
- action: more-info
- entity: switch.shelly_module_couloir
- label: >-
- [[[
- if (entity.state == 'off'){
- return 'Arrêt forcé';
- }else{
- if (states["sensor.shelly_module_couloir_current_consumption"].state > 0){
- var etat = "Chauffe • " + states["sensor.shelly_module_couloir_current_consumption"].state + "W";
- }else{
- var etat = "Inactif";
- }
- return etat ;
- }
- ]]]
- styles:
- icon:
- - color: |
- [[[
- if (states["sensor.shelly_module_couloir_current_consumption"].state > 0)
- return 'rgba(var(--couleur-rouge),1)'
- else
- return 'rgba(var(--couleur-theme),0.2)'
- ]]]
- img_cell:
- - background-color: |
- [[[
- if (states["sensor.shelly_module_couloir_current_consumption"].state > 0)
- return 'rgba(var(--couleur-rouge),0.2)'
- else
- return 'rgba(var(--couleur-theme),0.05)'
- ]]]
- ########################################################################################################
- # #
- # THERMOSTAT #
- # #
- ########################################################################################################
- thermostat:
- hold_action:
- action: more-info
- entity: input_boolean.radiateur_arret_force
- label: >-
- [[[
- if (entity.state =='off'){
- return 'Off' ;
- }else{
- if (states['light.qubino'].state == 'on'){
- var etat = "Chauffe";
- }else{
- var etat = "Inactif";
- }
- return (entity.attributes.temperature ) + '°' + ' • ' + etat ;
- }
- ]]]
- styles:
- icon:
- - color: |
- [[[
- if (states['light.qubino'].state == 'on')
- return 'rgba(var(--couleur-rouge),1)'
- else
- return 'rgba(var(--couleur-theme),0.2)'
- ]]]
- img_cell:
- - background-color: |
- [[[
- if (states['light.qubino'].state == 'on')
- return 'rgba(var(--couleur-rouge),0.2)'
- else
- return 'rgba(var(--couleur-theme),0.05)'
- ]]]
- ########################################################################################################
- # #
- # NAS #
- # #
- ########################################################################################################
- nas:
- tap_action:
- action: more-info
- show_label: true
- label: |-
- [[[ if (entity.state =='on')
- var etat = states["sensor.nas_volume_1_used_space"].state + "/3.5To";
- else
- var etat = "Off";
- return etat ; ]]]
- template:
- - bleu
- ########################################################################################################
- # #
- # MEDIA #
- # #
- ########################################################################################################
- media:
- label: >-
- [[[ if (entity.state =='off'){
- return "Off";
- }else{
- return entity.state;
- }
- ]]]
- icon: |
- [[[
- var application = states["media_player.chromecast_audio_appartement"].attributes.app_name;
- var icon = 'mdi:speaker';
- if (application == 'Oto music'){
- var icon = 'mdi:music-circle';
- } else if(application == 'Spotify'){
- var icon = 'mdi:spotify';
- } else if(application == 'Google Podcasts'){
- var icon = 'mdi:google-podcast';
- } else if(application == 'Plex'){
- var icon = 'mdi:plex';
- }
- return icon ;
- ]]]
- styles:
- icon:
- - color: 'rgba(var(--couleur-theme),0.2)'
- img_cell:
- - background-color: 'rgba(var(--couleur-theme),0.05)'
- card:
- - background-blend-mode: multiply
- - background: >
- [[[
- var image = entity.attributes.entity_picture_local;
- var bg = entity.attributes.entity_picture_local;
- if (image == null){
- var bg = '';
- } else{
- var bg = 'center / cover url(' + image + ') rgba(0, 0, 0, 0.15)';
- }
- return bg;
- ]]]
- state:
- - operator: template
- value: >
- [[[
- return entity.state !='off'
- ]]]
- name: >
- [[[
- return entity.attributes.media_title;
- ]]]
- label: >
- [[[
- return entity.attributes.media_album_name;
- ]]]
- styles:
- label:
- - color: white
- - filter: opacity(100%)
- img_cell:
- - background-color: 'rgba(var(--couleur-theme),0.0)'
- icon:
- - color: white
- name:
- - color: white
- ####################################################
- media_mini_album:
- label: >-
- [[[ if (entity.state =='off'){
- return "Off";
- }else{
- return entity.state;
- }
- ]]]
- styles:
- icon:
- - color: 'rgba(var(--couleur-theme),0.2)'
- img_cell:
- - background-color: 'rgba(var(--couleur-theme),0.05)'
- state:
- - operator: template
- value: >
- [[[
- return entity.state !='off'
- ]]]
- name: >
- [[[
- return entity.attributes.media_title;
- ]]]
- label: >
- [[[
- return entity.attributes.media_album_name;
- ]]]
- styles:
- img_cell:
- - background: >
- [[[
- var image = entity.attributes.entity_picture;
- return 'center / cover url(' + image + ')';
- ]]]
- icon:
- - color: 'rgba(var(--couleur-theme),0.0)'
- ########################################################################################################
- # #
- # PLAYSTATION #
- # #
- ########################################################################################################
- ps4:
- label: >-
- [[[ if (entity.state =='unknown'){
- return "Off";
- }else if (entity.state =='standby'){
- return "En veille";
- }else{
- return "On";
- }
- ]]]
- styles:
- icon:
- - color: 'rgba(var(--couleur-theme),0.2)'
- img_cell:
- - background-color: 'rgba(var(--couleur-theme),0.05)'
- state:
- - value: 'idle'
- styles:
- icon:
- - color: 'rgba(var(--couleur-bleu),1)'
- img_cell:
- - background-color: 'rgba(var(--couleur-bleu), 0.2)'
- - value: 'standby'
- styles:
- icon:
- - color: 'rgba(var(--couleur-theme),0.2)'
- img_cell:
- - background-color: 'rgba(var(--couleur-theme),0.05)'
- - operator: template
- value: >
- [[[
- return entity.state !='unknown'
- ]]]
- name: >
- [[[
- return entity.attributes.media_title;
- ]]]
- label: >
- [[[
- return entity.attributes.friendly_name;
- ]]]
- styles:
- label:
- - color: white
- - filter: opacity(100%)
- img_cell:
- - background-color: 'none'
- icon:
- - color: white
- name:
- - color: white
- card:
- - background-blend-mode: multiply
- - background: >
- [[[
- var image = entity.attributes.entity_picture;
- return 'center / cover url(' + image + ') rgba(0, 0, 0, 0.15)';
- ]]]
- ########################################################################################################
- # #
- # PERSONNE #
- # #
- ########################################################################################################
- personne:
- tap_action:
- action: more-info
- show_label: true
- label: >
- [[[return entity.state]]]
- styles:
- icon:
- - color: 'rgba(var(--couleur-theme),0.9)'
- custom_fields:
- notification:
- - border-radius: 50%
- - position: absolute
- - left: 38px
- - top: 8px
- - height: 16px
- - width: 16px
- - border: 2px solid var(--card-background-color)
- - font-size: 12px
- - line-height: 14px
- ####################################################
- # #
- # THOMAS #
- # #
- ####################################################
- personne-thomas:
- template: personne
- hold_action:
- action: more-info
- entity: input_boolean.thomas_nuit
- styles:
- custom_fields:
- notification:
- - background-color: >
- [[[
- if (states['input_select.localisation_thomas'].state == 'Present'){
- return "rgba(var(--couleur-bleu),1)";
- }else{
- return "rgba(var(--couleur-vert),1)";
- }
- ]]]
- custom_fields:
- notification: >
- [[[
- if (states['input_boolean.thomas_nuit'].state == 'on'){
- return `<ha-icon icon="mdi:power-sleep" style="width: 10px; height: 10px; color: white;"></ha-icon>`
- }else{
- if (states['input_select.localisation_thomas'].state == 'Present'){
- return `<ha-icon icon="mdi:home-variant" style="width: 10px; height: 10px; color: white;"></ha-icon>`
- }else{
- return `<ha-icon icon="mdi:walk" style="width: 10px; height: 10px; color: white;"></ha-icon>`
- }
- }
- ]]]
- ####################################################
- # #
- # MILENA #
- # #
- ####################################################
- personne-milena:
- template: personne
- hold_action:
- action: more-info
- entity: input_boolean.milena_nuit
- styles:
- custom_fields:
- notification:
- - background-color: >
- [[[
- if (states['input_select.localisation_milena'].state == 'Present'){
- return "rgba(var(--couleur-bleu),1)";
- }else{
- return "rgba(var(--couleur-vert),1)";
- }
- ]]]
- custom_fields:
- notification: >
- [[[
- if (states['input_boolean.milena_nuit'].state == 'on'){
- return `<ha-icon icon="mdi:power-sleep" style="width: 10px; height: 10px; color: white;"></ha-icon>`
- }else{
- if (states['input_select.localisation_milena'].state == 'Present'){
- return `<ha-icon icon="mdi:home-variant" style="width: 10px; height: 10px; color: white;"></ha-icon>`
- }else{
- return `<ha-icon icon="mdi:walk" style="width: 10px; height: 10px; color: white;"></ha-icon>`
- }
- }
- ]]]
- ####################################################
- # #
- # INVITE #
- # #
- ####################################################
- personne-invite:
- tap_action:
- action: more-info
- show_label: true
- label: |-
- [[[ if (entity.state =='on')
- var etat = "Present";
- else
- var etat = "Désactivé";
- return etat ; ]]]
- styles:
- grid:
- - grid-template-areas: '"i n" "i l"'
- icon:
- - color: 'rgba(var(--couleur-theme),0.2)'
- img_cell:
- - background-color: 'rgba(var(--couleur-theme),0.05)'
- custom_fields:
- notification: >
- [[[
- if (entity.state =='on'){
- return `<ha-icon icon="mdi:home-variant" style="width: 10px; height: 10px; color: white;"></ha-icon>`
- }
- ]]]
- state:
- - styles:
- icon:
- - color: 'rgba(var(--couleur-theme),0.9)'
- custom_fields:
- notification:
- - border-radius: 50%
- - position: absolute
- - left: 38px
- - top: 6px
- - height: 16px
- - width: 16px
- - border: 2px solid var(--card-background-color)
- - font-size: 12px
- - line-height: 14px
- - background-color: >
- [[[
- return "rgba(var(--couleur-bleu),1)";
- ]]]
- value: 'on'
- ########################################################################################################
- # #
- # QUBINO #
- # #
- ########################################################################################################
- qubino:
- icon: 'mdi:memory'
- tap_action:
- action: more-info
- entity: input_select.ordres_fil_pilote
- label: >-
- [[[ if (entity.state !='unavailable'){
- var bri = Math.round(entity.attributes.brightness / 2.55);
- var bri = (bri ? bri : '0')
- var consigne = 'Inconnue';
- if (bri >= 51){
- var consigne = 'Confort';
- } else if(bri < 51 && bri >= 41){
- var consigne = 'Confort -1°C';
- } else if(bri < 41 && bri >= 31){
- var consigne = 'Confort -2°C️';
- } else if(bri < 31 && bri >= 21){
- var consigne = 'Eco️';
- } else if(bri < 21 && bri >= 11){
- var consigne = 'Hors Gel️';
- } else if(bri < 11 && bri >= 0){
- var consigne = 'Arrêt️';
- }
- return consigne + ' • ' + bri;
- }else{
- return "Indisponible";
- }
- ]]]
- template:
- - bleu
- ####################################################
- # #
- # COULEUR #
- # #
- ####################################################
- jaune:
- state:
- - styles:
- icon:
- - color: 'rgba(var(--couleur-jaune),1)'
- img_cell:
- - background-color: 'rgba(var(--couleur-jaune), 0.2)'
- value: 'on'
- ####################################################
- bleu:
- state:
- - styles:
- icon:
- - color: 'rgba(var(--couleur-bleu),1)'
- img_cell:
- - background-color: 'rgba(var(--couleur-bleu), 0.2)'
- value: 'on'
- ####################################################
- # #
- # GRAPHE #
- # #
- ####################################################
- graph:
- variables:
- entity: "sensor.xiaomi_multisensor_salon_humidite"
- color: "var(--google-blue-500)"
- name: "Default name"
- styles:
- card:
- - border-radius: 20px
- - box-shadow: var(--box-shadow)
- - padding: 0px
- grid:
- - grid-template-areas: '"item1" "item2"'
- - grid-template-columns: 1fr
- - grid-template-rows: min-content min-content
- custom_fields:
- item1:
- card:
- entity: '[[[ return variables.entity ]]]'
- name: '[[[ return variables.name ]]]'
- template:
- - icon_info
- - generique
- styles:
- card:
- - padding: 12px
- type: 'custom:button-card'
- item2:
- card:
- type: 'custom:mini-graph-card'
- entities:
- - entity: '[[[ return variables.entity ]]]'
- line_color: '[[[ return variables.color ]]]'
- show:
- name: false
- icon: false
- legend: false
- state: false
- style: |
- ha-card {
- box-shadow: none;
- border-radius: var(--border-radius);
- }
- ####################################################
- # #
- # BATTERY #
- # #
- ####################################################
- battery:
- template: generique
- icon: |
- [[[
- var battery = entity.state;
- var icon = 'mdi:help-circle-outline';
- if (battery >= 90){
- var icon = 'mdi:battery';
- } else if(battery < 90 && battery >= 80){
- var icon = 'mdi:battery-90';
- } else if(battery < 80 && battery >= 70){
- var icon = 'mdi:battery-80️';
- } else if(battery < 70 && battery >= 60){
- var icon = 'mdi:battery-70️';
- } else if(battery < 60 && battery >= 50){
- var icon = 'mdi:battery-60️';
- } else if(battery < 50 && battery >= 40){
- var icon = 'mdi:battery-50️';
- } else if(battery < 40 && battery >= 30){
- var icon = 'mdi:battery-40️';
- } else if(battery < 30 && battery >= 20){
- var icon = 'mdi:battery-30️';
- } else if(battery < 20 && battery >= 10){
- var icon = 'mdi:battery-20️';
- } else if(battery < 10 && battery >= 0){
- var icon = 'mdi:battery-10️';
- } else if(battery == 0){
- var icon = 'mdi:battery-outline️';
- }
- return icon ;
- ]]]
- ########################################################################################################
- # #
- # WIDGET ICON #
- # #
- ########################################################################################################
- widget_icon:
- tap_action:
- action: toggle
- color: var(--google-grey-500)
- show_icon: true
- show_name: false
- size: 20px
- styles:
- card:
- - box-shadow: none
- - padding: 0px
- - background-color: 'rgba(var(--couleur-theme),0.05)'
- - border-radius: 14px
- - place-self: center
- - height: 42px
- grid:
- - grid-template-areas: '"i"'
- icon:
- - color: 'rgba(var(--couleur-theme),0.9)'
- ####################################################
- # #
- # BURDURES #
- # #
- ####################################################
- bordures:
- styles:
- card:
- - width: 0px
- ########################################################################################################
- # #
- # PILULE #
- # #
- ########################################################################################################
- pilule:
- tap_action:
- action: more-info
- show_icon: false
- show_name: false
- show_state: false
- show_label: true
- size: 80%
- styles:
- img_cell:
- - width: 24px
- card:
- - border-radius: 30px
- - box-shadow: var(--box-shadow)
- - height: 36px
- - width: auto
- - padding-left: 6px
- - padding-right: 6px
- grid:
- - grid-template-areas: '"l"'
- label:
- - justify-self: center
- - padding: 0px 6px
- - font-weight: bold
- - font-size: 14px
- ####################################################
- # #
- # CONSOMMATION #
- # #
- ####################################################
- pilule_consommation:
- template: pilule
- tap_action:
- action: navigate
- navigation_path: /lovelace/consommation
- label: |
- [[[
- var price = states['sensor.atome_price_conso_today'].state;
- return '⚡ ' + price + '€' ;
- ]]]
- pilule_consommation_prix:
- template: pilule
- show_icon: false
- show_state: false
- show_label: true
- tap_action:
- action: navigate
- navigation_path: /lovelace/consommation
- label: |
- [[[
- var price = states['sensor.atome_price_conso_today'].state;
- var conso = states['sensor.atome_daily'].state;
- return '⚡ ' + price + '€ • ' + conso + 'kWh';
- ]]]
- ####################################################
- # #
- # TEMPERATURE #
- # #
- ####################################################
- pilule_temperature:
- template: pilule
- tap_action:
- action: navigate
- navigation_path: /lovelace/temperature
- label: |
- [[[
- var inter = states['sensor.fibaro_multisensor_salon_temperature'].state;
- var exter = states['sensor.xiaomi_multisensor_chambre_temperature'].state;
- var icon = '☀️';
- if (states['sensor.dark_sky_icon'].state == 'clear-day'){
- var icon = '☀️';
- } else if(states['sensor.dark_sky_icon'].state == 'clear-night'){
- var icon = '🌙';
- } else if(states['sensor.dark_sky_icon'].state == 'rain'){
- var icon = '🌧️';
- } else if(states['sensor.dark_sky_icon'].state == 'snow'){
- var icon = '❄️';
- } else if(states['sensor.dark_sky_icon'].state == 'sleet'){
- var icon = '❄️';
- } else if(states['sensor.dark_sky_icon'].state == 'wind'){
- var icon = '🌫️';
- } else if(states['sensor.dark_sky_icon'].state == 'fog'){
- var icon = '🌫️';
- } else if(states['sensor.dark_sky_icon'].state == 'cloudy'){
- var icon = '☁️';
- } else if(states['sensor.dark_sky_icon'].state == 'partly-cloudy-day'){
- var icon = '⛅️';
- } else if(states['sensor.dark_sky_icon'].state == 'partly-cloudy-night'){
- var icon = '⛅';
- }
- return icon + ' ' + inter + '° / ' + exter + '°' ;
- ]]]
- ####################################################
- # #
- # localisation #
- # #
- ####################################################
- pilule_localisation_present:
- tap_action:
- action: navigate
- navigation_path: /lovelace/localisation
- label: |
- [[[
- var personnes_presentes = states['sensor.people_count_present'].state;
- return '🏠 ' + personnes_presentes;
- ]]]
- template: pilule
- pilule_localisation_absent:
- tap_action:
- action: navigate
- navigation_path: /lovelace/localisation
- label: |
- [[[
- var personnes_presentes = states['sensor.people_count_absent'].state;
- return '🚶 ' + personnes_presentes;
- ]]]
- template: pilule
- pilule_localisation_nuit:
- template: pilule
- tap_action:
- action: navigate
- navigation_path: /lovelace/localisation
- label: |
- [[[
- var personnes_presentes = states['sensor.people_count_nuit'].state;
- return '🌙 ' + personnes_presentes;
- ]]]
- ####################################################
- # #
- # BOUTON RETOUR #
- # #
- ####################################################
- return_button:
- template: pilule
- show_icon: true
- icon: 'mdi:arrow-left'
- size: 80%
- styles:
- grid:
- - grid-template-areas: '"i"'
- tap_action:
- action: navigate
- navigation_path: /lovelace/home
- ########################################################################################################
- # #
- # LOCALISATION #
- # #
- ########################################################################################################
- scene:
- size: 20px
- show_label: true
- label: |
- [[[ return (entity.attributes.value )]]]
- styles:
- card:
- - border-radius: 20px
- - box-shadow: var(--box-shadow)
- - padding: 10px 0px 8px 0px
- grid:
- - grid-template-areas: '"i" "n" "l"'
- name:
- - margin-top: 10px
- - justify-self: center
- - font-weight: bold
- - font-size: 14px
- label:
- - justify-self: center
- - align-self: start
- - font-weight: bolder
- - font-size: 12px
- - filter: opacity(40%)
- icon:
- - color: |
- [[[
- if (states['input_select.localisation_thomas'].state == entity.attributes.friendly_name){
- if (states['input_select.localisation_thomas'].state == 'Present')
- return 'rgba(var(--couleur-bleu),1)'
- else if (states['input_select.localisation_thomas'].state == 'Absent')
- return 'rgba(var(--couleur-vert),1)'
- else if (states['input_select.localisation_thomas'].state == 'Nuit')
- return 'rgba(var(--couleur-bleu),1)'
- else if (states['input_select.localisation_thomas'].state == 'Travail')
- return 'rgba(var(--couleur-vert),1)'
- else if (states['input_select.localisation_thomas'].state == 'Miléna')
- return 'rgba(var(--couleur-vert),1)'
- else if (states['input_select.localisation_thomas'].state == 'Parents')
- return 'rgba(var(--couleur-vert),1)'
- }else{
- return 'rgba(var(--couleur-theme),0.2)'
- }
- ]]]
- img_cell:
- - background-color: |
- [[[
- if (states['input_select.localisation_thomas'].state == entity.attributes.friendly_name){
- if (states['input_select.localisation_thomas'].state == 'Present')
- return 'rgba(var(--couleur-bleu),0.2)'
- else if (states['input_select.localisation_thomas'].state == 'Absent')
- return 'rgba(var(--couleur-vert),0.2)'
- else if (states['input_select.localisation_thomas'].state == 'Nuit')
- return 'rgba(var(--couleur-bleu),0.2)'
- else if (states['input_select.localisation_thomas'].state == 'Travail')
- return 'rgba(var(--couleur-vert),0.2)'
- else if (states['input_select.localisation_thomas'].state == 'Miléna')
- return 'rgba(var(--couleur-vert),0.2)'
- else if (states['input_select.localisation_thomas'].state == 'Parents')
- return 'rgba(var(--couleur-vert),0.2)'
- }else{
- return 'rgba(var(--couleur-theme),0.05)'
- }
- ]]]
- - border-radius: 50%
- - place-self: center
- - width: 42px
- - height: 42px
- localisation:
- aspect_ratio: 4/5
- tap_action:
- action: more-info
- entity: input_select.localisation_thomas
- show_icon: true
- show_name: true
- show_state: false
- show_label: true
- label: |
- [[[ return (entity.attributes.value )]]]
- size: 20px
- styles:
- card:
- - border-radius: 20px
- - box-shadow: var(--box-shadow)
- grid:
- - grid-template-areas: '"i" "n" "l"'
- - grid-template-rows: 3fr 1fr 1fr
- - grid-template-columns: 1fr
- icon:
- - color: |
- [[[
- if (states['input_select.localisation_thomas'].state == entity.attributes.friendly_name){
- if (states['input_select.localisation_thomas'].state == 'Present')
- return 'rgba(var(--couleur-bleu),1)'
- else if (states['input_select.localisation_thomas'].state == 'Absent')
- return 'rgba(var(--couleur-vert),1)'
- else if (states['input_select.localisation_thomas'].state == 'Nuit')
- return 'rgba(var(--couleur-bleu),1)'
- else if (states['input_select.localisation_thomas'].state == 'Travail')
- return 'rgba(var(--couleur-vert),1)'
- else if (states['input_select.localisation_thomas'].state == 'Miléna')
- return 'rgba(var(--couleur-vert),1)'
- else if (states['input_select.localisation_thomas'].state == 'Parents')
- return 'rgba(var(--couleur-vert),1)'
- }else{
- return 'rgba(var(--couleur-theme),0.2)'
- }
- ]]]
- img_cell:
- - background-color: |
- [[[
- if (states['input_select.localisation_thomas'].state == entity.attributes.friendly_name){
- if (states['input_select.localisation_thomas'].state == 'Present')
- return 'rgba(var(--couleur-bleu),0.2)'
- else if (states['input_select.localisation_thomas'].state == 'Absent')
- return 'rgba(var(--couleur-vert),0.2)'
- else if (states['input_select.localisation_thomas'].state == 'Nuit')
- return 'rgba(var(--couleur-bleu),0.2)'
- else if (states['input_select.localisation_thomas'].state == 'Travail')
- return 'rgba(var(--couleur-vert),0.2)'
- else if (states['input_select.localisation_thomas'].state == 'Miléna')
- return 'rgba(var(--couleur-vert),0.2)'
- else if (states['input_select.localisation_thomas'].state == 'Parents')
- return 'rgba(var(--couleur-vert),0.2)'
- }else{
- return 'rgba(var(--couleur-theme),0.05)'
- }
- ]]]
- - border-radius: 50%
- - place-self: center
- - width: 42px
- - height: 42px
- name:
- - justify-self: center
- - padding: 0px 10px
- - font-weight: bold
- - font-size: 14px
- label:
- - justify-self: center
- - align-self: start
- - padding: 0px 10px
- - font-weight: bolder
- - font-size: 12px
- - filter: opacity(40%)
- ####################################################
- # #
- # VIDE #
- # #
- ####################################################
- vide:
- styles:
- card:
- - background-color: rgba(0,0,0,0)
- - box-shadow: none
- - height: 0px
- ########################################################################################################
- # #
- # TITRE #
- # #
- ########################################################################################################
- titre:
- tap_action:
- action: none
- show_icon: false
- show_label: true
- show_name: true
- styles:
- card:
- - background-color: rgba(0,0,0,0)
- - box-shadow: none
- - height: auto
- - width: auto
- - margin-top: 12px
- - margin-left: 24px
- - margin-bottom: 0px
- grid:
- - grid-template-areas: '"n" "l"'
- - grid-template-columns: 1fr
- - grid-template-rows: min-content min-content
- name:
- - justify-self: start
- - font-weight: bold
- - font-size: '1.5rem'
- label:
- - justify-self: start
- - font-weight: bold
- - font-size: '1rem'
- - opacity: '0.4'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement