Bonjour,
Je suis débutant avec HA et j’aurais besoin d’un peu d’aide.
je souhaitre créer une carte pour actionner un volet roulant avec mushroom cover.
Je pilote le volet via un relay Shelly, qui ne donne aucun retour sur la position du volet donc j’ai aussi installé un capteur d’ouverture (Shelly aussi) qui donne le statut réel du volet (ouvert ou fermé)
Voilà ce que j’arrive à obtenir, c’est volontairement petit et minimaliste (comme le style Tile)
Ma carte cover mushroom affiche les boutons haut et bas , le nom et le statut.
Mais le statut est déduit de l’action sur les boutons , sans feed back, donc potentiellement faux.
Et bien sûr je voudrais que ce statut soit donné par le capteur de position, qui est le reflet de la réalité.
J’ai donc créé un sensor dans mon répertoire /homeassistant/Templates/templates.yaml, comme ceci
- sensor:
- name: etat_affichage_volets_roulants
unit_of_measurement: "w"
icon: mdi:lightbulb-off
state: "0"
attributes:
attr1: >
{% if is_state('binary_sensor.contactvoletroulantcuisine_window','on') %}Ouvert{%else%}Fermé{%endif%}
Je pense qu’un binay sensor aurait été plus adapté , mais je verrai plus tard , ce sensor fonctionne.
Voilà le code de la carte , probablement pas optimisé du tout car je suis un bleu …
type: custom:mushroom-cover-card
entity: cover.voletsroulants
name: Volets
layout: horizontal
fill_container: false
primary_info: name
secondary_info: state
show_position_control: false
show_buttons_control: true
icon: mdi:window-shutter
grid_options:
columns: 6
rows: 1
tap_action:
action: none
hold_action:
action: none
double_tap_action:
action: none
card_mod:
style:
mushroom-state-info$: |
.container {
align-items: center;
#flex-direction: row !important;
#align-items: baseline;
#gap: 2px;
}
mushroom-shape-icon$: |
.shape {
--shape-color: #orange !important;
}
mushroom-cover-buttons-control$:
mushroom-button:nth-child(1)$: |
.button {
height: 0px !important;
width: 10px !important;
margin-top: 15px !important;
margin-left: 15px !important;
--control-icon-size: 40px;
}
mushroom-button:nth-child(2)$: |
.button {
#height: 0px !important;
#width: 0px !important;
margin-top: 0px !important;
margin-left: 100px !important;
}
mushroom-button:nth-child(3)$: |
.button {
#height: 40px !important;
#width: 10px !important;
margin-top: 0px !important;
margin-left: 0px !important;
--control-icon-size: 40px;
}
.: >
ha-card {
background: #1C1C1C;
#--chip-background: black;
--primary-text-color: green;
--card-primary-color: cyan;
#--card-secondary-color: blue;
{% if is_state('cover.voletsroulants','open') %}
--card-secondary-color : var(--red-color);
{% else %}
--card-secondary-color : var(--green-color);
{% endif %}
}
ha-state-icon {
{% if is_state('binary_sensor.contactvoletroulantcuisine_window','on') %}
color: var(--red-color) ;
--card-mod-icon: mdi:window-shutter-open
{% else %}
color: var(--green-color);
--card-mod-icon: mdi:window-shutter
{% endif %}
}
Mais malgré mes recherches je sais pas comment faire pour qu’au lieu de l’état (information secondaire : state) , en rouge ici , il m’affiche l’attribut de mon sensor.
Je me perds avec les histoire de custom template , templating etc… et j’avoue un peu tout confondre, ça n’est pas simple.
Any help would be greatly appreciated
Merci d’avance.
Cyril
Ma configuration
System Information
version | core-2025.5.3 |
---|---|
installation_type | Home Assistant OS |
dev | false |
hassio | true |
docker | true |
user | root |
virtualenv | false |
python_version | 3.13.3 |
os_name | Linux |
os_version | 6.6.74-haos-raspi |
arch | aarch64 |
timezone | Europe/Paris |
config_dir | /config |
Home Assistant Community Store
GitHub API | ok |
---|---|
GitHub Content | ok |
GitHub Web | ok |
HACS Data | ok |
GitHub API Calls Remaining | 5000 |
Installed Version | 2.0.5 |
Stage | running |
Available Repositories | 2016 |
Downloaded Repositories | 6 |
Home Assistant Cloud
logged_in | false |
---|---|
can_reach_cert_server | ok |
can_reach_cloud_auth | ok |
can_reach_cloud | ok |
Home Assistant Supervisor
host_os | Home Assistant OS 15.2 |
---|---|
update_channel | stable |
supervisor_version | supervisor-2025.05.3 |
agent_version | 1.7.2 |
docker_version | 28.0.4 |
disk_total | 916.2 GB |
disk_used | 17.1 GB |
healthy | true |
supported | true |
host_connectivity | true |
supervisor_connectivity | true |
ntp_synchronized | true |
virtualization | |
board | rpi5-64 |
supervisor_api | ok |
version_api | ok |
installed_addons | Terminal & SSH (9.17.0), Mosquitto broker (6.5.1), Samba share (12.5.1), File editor (5.8.0), ZeroTier One (0.20.0), ESPHome Device Builder (2025.5.2), MQTT Explorer (browser-1.0.3), Linky (1.5.0), Zigbee2MQTT (2.4.0-1) |
Dashboards
dashboards | 8 |
---|---|
resources | 9 |
views | 7 |
mode | storage |
Network Configuration
adapters | lo (disabled), end0 (enabled, default, auto), hassio (disabled), docker0 (disabled), ztmosjn2co (disabled), veth89dc5eb (disabled), veth067471d (disabled), veth44878c1 (disabled), vethc2bd4de (disabled), vethf260d85 (disabled), veth17478e4 (disabled), veth15b4780 (disabled), vethd4440ad (disabled) |
---|---|
ipv4_addresses | lo (127.0.0.1/8), end0 (10.0.0.125/24), hassio (172.30.32.1/23), docker0 (172.30.232.1/23), ztmosjn2co (192.168.196.237/24), veth89dc5eb (), veth067471d (), veth44878c1 (), vethc2bd4de (), vethf260d85 (), veth17478e4 (), veth15b4780 (), vethd4440ad () |
ipv6_addresses | lo (::1/128), end0 (2a01:cb14:1268:2000:5b37:8ecc:810d:5c84/64, fe80::7c1d:5a94:a11e:8aa5/64), hassio (fe80::5465:54ff:fe64:4222/64), docker0 (fe80::b8f3:64ff:fe40:bdfc/64), ztmosjn2co (fe80::482:8fff:fe10:b0ae/64), veth89dc5eb (fe80::48bb:78ff:fe27:eb05/64), veth067471d (fe80::1448:9bff:fee3:d0d0/64), veth44878c1 (fe80::f8ed:9eff:fefd:50db/64), vethc2bd4de (fe80::fc28:dcff:fe88:32c3/64), vethf260d85 (fe80::7824:a4ff:fe94:f0d5/64), veth17478e4 (fe80::4bd:2bff:fe3f:ffc0/64), veth15b4780 (fe80::a40c:78ff:fe49:9e4b/64), vethd4440ad (fe80::f4ed:56ff:fe4b:9839/64) |
announce_addresses | 10.0.0.125, 2a01:cb14:1268:2000:5b37:8ecc:810d:5c84, fe80::7c1d:5a94:a11e:8aa5 |
Recorder
oldest_recorder_run | 21 mai 2025 à 17:21 |
---|---|
current_recorder_run | 5 juin 2025 à 09:53 |
estimated_db_size | 1157.54 MiB |
database_engine | sqlite |
database_version | 3.48.0 |
Sonoff
version | 3.8.2 (c4b6fda) |
---|---|
cloud_online | 0 / 1 |
local_online | 0 / 0 |