Updates Gate view in home-assistant
This commit is contained in:
parent
c284d29ea0
commit
8e640c0acf
@ -90,17 +90,27 @@ template:
|
|||||||
state: "{{ states('switch.sthome_ut1_alarm_zone_4') }}"
|
state: "{{ states('switch.sthome_ut1_alarm_zone_4') }}"
|
||||||
icon: *icon_alarm_light
|
icon: *icon_alarm_light
|
||||||
|
|
||||||
|
# physical lock sensor
|
||||||
|
# detects if toggle switch on gate-intecom is on or off
|
||||||
- unique_id: gate_lock_gui
|
- unique_id: gate_lock_gui
|
||||||
name: Gate Lock
|
name: Gate Lock
|
||||||
state: "{{ states('switch.sthome_ut4_relay_5') }}"
|
state: "{{ states('switch.sthome_ut4_relay_5') }}" # this must be changed to a sensor within ESPHome for sthome_ut4 in the future
|
||||||
icon: >
|
icon: &icon_lock >
|
||||||
{%- if this.state == 'on' -%}
|
{% if this.state == 'on' %}
|
||||||
mdi:lock-open
|
|
||||||
{%- elif this.state == 'off' -%}
|
|
||||||
mdi:lock
|
mdi:lock
|
||||||
{%- else -%}
|
{% elif this.state == 'off' %}
|
||||||
|
mdi:lock-open
|
||||||
|
{% else %}
|
||||||
mdi:lock-off
|
mdi:lock-off
|
||||||
{%- endif -%}
|
{% endif %}
|
||||||
|
|
||||||
|
# remote gate lock
|
||||||
|
# this will remote lock/unlock the gate
|
||||||
|
# the unlock will only be effective if the toggle switch has enabled it (gate is physically unlocked), i.e the relay's normally closed contacts are wired in series with the toggle switch
|
||||||
|
- unique_id: gate_remote_lock_gui
|
||||||
|
name: Gate Remote Lock
|
||||||
|
state: "{{ states('switch.sthome_ut4_relay_5') }}"
|
||||||
|
icon: *icon_lock
|
||||||
|
|
||||||
- unique_id: backyard_motion_gui
|
- unique_id: backyard_motion_gui
|
||||||
name: Backyard Motion Detect
|
name: Backyard Motion Detect
|
||||||
|
|||||||
@ -302,7 +302,7 @@
|
|||||||
{
|
{
|
||||||
"type": "custom:mushroom-entity-card",
|
"type": "custom:mushroom-entity-card",
|
||||||
"entity": "counter.nokia_c20_notification_counter",
|
"entity": "counter.nokia_c20_notification_counter",
|
||||||
"name": "Nokia C20",
|
"name": "C20",
|
||||||
"secondary_info": "state",
|
"secondary_info": "state",
|
||||||
"grid_options": {
|
"grid_options": {
|
||||||
"columns": 4,
|
"columns": 4,
|
||||||
@ -319,6 +319,16 @@
|
|||||||
"rows": 1
|
"rows": 1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "custom:mushroom-entity-card",
|
||||||
|
"name": "A04",
|
||||||
|
"secondary_info": "state",
|
||||||
|
"grid_options": {
|
||||||
|
"columns": 4,
|
||||||
|
"rows": 1
|
||||||
|
},
|
||||||
|
"entity": "counter.sm_a042f_notification_counter"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "custom:mushroom-entity-card",
|
"type": "custom:mushroom-entity-card",
|
||||||
"entity": "counter.sm_x115_notification_counter",
|
"entity": "counter.sm_x115_notification_counter",
|
||||||
@ -329,6 +339,16 @@
|
|||||||
"rows": 1
|
"rows": 1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "custom:mushroom-entity-card",
|
||||||
|
"name": "A24",
|
||||||
|
"secondary_info": "state",
|
||||||
|
"grid_options": {
|
||||||
|
"columns": 4,
|
||||||
|
"rows": 1
|
||||||
|
},
|
||||||
|
"entity": "counter.sm_a245f_notification_counter"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "custom:mushroom-entity-card",
|
"type": "custom:mushroom-entity-card",
|
||||||
"entity": "counter.driveway_person_alarm_counter",
|
"entity": "counter.driveway_person_alarm_counter",
|
||||||
@ -907,12 +927,27 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "custom:mushroom-lock-card",
|
"type": "custom:mushroom-template-card",
|
||||||
"name": "Open/Close gate",
|
"icon": "{{ state_attr(entity, 'icon') }}\n",
|
||||||
"entity": "switch.sthome_ut4_relay_6",
|
"icon_color": "{% if is_state(entity, 'on') %}\n green\n{% elif is_state(entity, 'off') %}\n orange\n{% else %}\n #4682B4\n{% endif %}",
|
||||||
|
"primary": "Remote Lock",
|
||||||
"tap_action": {
|
"tap_action": {
|
||||||
"action": "toggle"
|
"action": "toggle"
|
||||||
}
|
},
|
||||||
|
"entity": "switch.sthome_ut4_relay_5",
|
||||||
|
"secondary": "{{ states[entity].state }}",
|
||||||
|
"badge_icon": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "custom:mushroom-template-card",
|
||||||
|
"icon": "{{ state_attr(entity, 'icon') }}\n",
|
||||||
|
"icon_color": "{% if is_state(entity, 'on') %}\n red\n{% elif is_state(entity, 'off') %}\n green\n{% else %}\n #4682B4\n{% endif %}",
|
||||||
|
"primary": "Open/Close",
|
||||||
|
"tap_action": {
|
||||||
|
"action": "toggle"
|
||||||
|
},
|
||||||
|
"entity": "switch.sthome_ut4_relay_6",
|
||||||
|
"secondary": "{{ states[entity].state }}"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -927,16 +962,28 @@
|
|||||||
"badges": [
|
"badges": [
|
||||||
{
|
{
|
||||||
"type": "custom:mushroom-template-badge",
|
"type": "custom:mushroom-template-badge",
|
||||||
"content": "{{ 'Locked' if states(entity) == 'on' else 'Unlocked' }}",
|
"content": "{{ states(entity) }}",
|
||||||
"icon": "{% set state = states(entity) %}\n{% if state == 'on' %}\n mdi:gate\n{% elif state == 'off' %}\n mdi:gate-alert\n{% else %}\n mdi:gate-alert\n{% endif %}",
|
"icon": "{{ state_attr(entity, 'icon') }}",
|
||||||
"color": "{% set state = states(entity) %}\n{% if state == 'on' %}\n red\n{% elif state == 'off' %}\n green\n{% else %}\n orange\n{% endif %}",
|
"color": "{% set state = states(entity) %}\n{% if state == 'on' %}\n green\n{% elif state == 'off' %}\n orange\n{% else %}\n red\n{% endif %}",
|
||||||
"label": "Gate",
|
"label": "Gate lock",
|
||||||
"tap_action": {
|
"tap_action": {
|
||||||
"action": "more-info"
|
"action": "more-info"
|
||||||
},
|
},
|
||||||
"entity": "binary_sensor.gate_lock"
|
"entity": "binary_sensor.gate_lock"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "custom:mushroom-template-badge",
|
||||||
|
"content": "{{ states(entity) }}",
|
||||||
|
"color": "{% set state = states(entity) %}\n{% if state == 'on' %}\n green\n{% elif state == 'off' %}\n orange\n{% else %}\n red\n{% endif %}",
|
||||||
|
"label": "{{ states[entity].name }}",
|
||||||
|
"tap_action": {
|
||||||
|
"action": "more-info"
|
||||||
|
},
|
||||||
|
"entity": "binary_sensor.gate_remote_lock",
|
||||||
|
"icon": "{{ state_attr(entity, 'icon') }}"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"cards": []
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user