Skip to content

Commit

Permalink
fixup! fixup! Add last seen sensor to zwave node list
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris-V committed Aug 12, 2024
1 parent bb07b8b commit dc77fdb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion custom_templates/dashboards/zwave.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
{% set ns = namespace(rows = []) %}
{%- for entity in expand(group_entity_id) %}
{%- if (states | length == 0 or entity.state in states) and not entity.state in states_not %}
{%- set last_seen_sensor = entity.entity_id | replace('_node_status', '_last_seen') %}
{%- set ns.rows = ns.rows + [{
'type': 'custom:template-entity-row',
'entity': entity.entity_id,
'name': entity.name | title | replace(': Node Status', ''),
'secondary': '{{ states(\'' + entity.entity_id | replace('_node_status', '_last_seen') +'\') | as_datetime | time_since(2) }}',
'state': '{{ state_translated(config.entity) }}',
'secondary': '{% if has_value(\'' + last_seen_sensor + '\') %}{{ states(\'' + last_seen_sensor +'\') | as_datetime | time_since(2) }}{% endif %}',
'active': 'not has_value(\'' + last_seen_sensor + '\')'
}] %}
{%- endif %}
{%- endfor %}
Expand Down

0 comments on commit dc77fdb

Please sign in to comment.