Created
March 11, 2023 22:41
-
-
Save alexdelprete/a8d6ad98ae2c934f12606becd4b01b61 to your computer and use it in GitHub Desktop.
Nuki Hub Mushroom Card
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type: custom:stack-in-card | |
cards: | |
- type: custom:mushroom-template-card | |
layout: horizontal | |
primary: > | |
{% set lock_name = state_attr('lock.portoncino','friendly_name') %} {% set | |
trigger = states('sensor.portoncino_trigger') %} {% if | |
is_state('lock.portoncino','unlocked') and | |
is_state('binary_sensor.portoncino_door_sensor','off') %} | |
{{ lock_name }}: closed & unlocked by {{ trigger }} | |
{% elif is_state('lock.portoncino','locked') and | |
is_state('binary_sensor.portoncino_door_sensor','off') %} | |
{{ lock_name }}: closed & locked by {{ trigger }} | |
{% elif is_state('lock.portoncino','unlocked') and | |
is_state('binary_sensor.portoncino_door_sensor','on') %} | |
{{ lock_name }}: open & unlocked by {{ trigger }} | |
{% else %} | |
{{ lock_name }}: state unknown! | |
{% endif %} | |
secondary: > | |
{% set battery_level = states('sensor.portoncino_battery_level') | int | | |
round(0) %} {% set bt_rssi_level = | |
states('sensor.portoncino_bluetooth_signal_strength') | int | round(0) %} | |
{% set wifi_rssi_level = states('sensor.portoncino_wifi_signal_strength') | |
| int | round(0) %} {% set uptime = states('sensor.portoncino_uptime') | | |
int %} Battery: {{ battery_level ~ '%' }} | BT: {{ bt_rssi_level ~ 'dBm' | |
}} | WiFi: {{ wifi_rssi_level ~ 'dBm' }} | Uptime: {{ uptime ~ 'm' if | |
(uptime|int) < 60 else ((uptime|int)/60)|round(1) ~ 'h' }} | |
icon: > | |
{% if is_state('lock.portoncino','unlocked') and | |
is_state('binary_sensor.portoncino_door_sensor','off') %} | |
mdi:door-closed | |
{% elif is_state('lock.portoncino','locked') and | |
is_state('binary_sensor.portoncino_door_sensor','off') %} | |
mdi:door-closed-lock | |
{% elif is_state('lock.portoncino','unlocked') and | |
is_state('binary_sensor.portoncino_door_sensor','on') %} | |
mdi:door-open | |
{% endif%} | |
icon_color: > | |
{% if is_state('lock.portoncino','locked') and | |
is_state('binary_sensor.portoncino_door_sensor','off') %} | |
green | |
{% elif is_state('lock.portoncino','unlocked') and | |
is_state('binary_sensor.portoncino_door_sensor','off') %} | |
yellow | |
{% elif is_state('lock.portoncino','unlocked') and | |
is_state('binary_sensor.portoncino_door_sensor','on') %} %} | |
red | |
{% endif%} | |
badge_icon: > | |
{% set battery_level = states('sensor.portoncino_battery_level') | int | | |
round(0) %} {% if battery_level < 80 %} | |
mdi:battery-{{ battery_level }} | |
{% elif battery_level < 60 %} | |
mdi:battery-alert-variant-outline | |
{% else %} {% endif %} | |
badge_color: > | |
{% set battery_level = states('sensor.portoncino_battery_level') | int | | |
round(0) %} {% if battery_level < 80 %} | |
orange | |
{% elif battery_level < 60 %} | |
red | |
{% else %} | |
green | |
{% endif %} | |
tap_action: | |
action: none | |
card_mod: | |
style: | | |
ha-card { | |
background: none; | |
box-shadow: none; | |
} | |
- type: custom:mushroom-lock-card | |
entity: lock.portoncino | |
name: Laundry Room Door | |
primary_info: none | |
secondary_info: none | |
icon_type: none | |
layout: vertical | |
card_mod: | |
style: | | |
ha-card { | |
background: none; | |
box-shadow: none; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Don't worry my friend, it's nothing special. If you need anything, you know how to contact me. I'm also on Discord (alexdelprete#5566) and Telegram (@alexdelprete). :)