-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplates.yaml
30 lines (28 loc) · 1.08 KB
/
templates.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# OpenWebRX additional template sensors based on attributes
# All depend on Ping sensor 'binary_sensor.openwebrx' to check connection
# of the WebSDR.
# Time elapsed since last FT8 decode in minutes
# Derived from sensor mqtt sensor 'sensor.openwebrx_ft8'
- sensor:
- name: webrx-ft8-min_ago
device_class: duration
unit_of_measurement: "min"
state: >
{% set te = (( as_timestamp(now())
- state_attr( 'sensor.openwebrx_ft8', 'timestamp')/1000 )/ 60) | round(1) %}
{% if te is defined and te >= 0 %}{{ te }}{% else %}0{% endif %}
availability: "{{ is_state('binary_sensor.openwebrx','on') }}"
icon: mdi:clock
# Shows the connected SDRs and types
# derived from rest sensor 'sensor.openwebrx_version'
- sensor:
- name: sdr_connected
state: >
{{ state_attr( 'sensor.openwebrx_version', 'sdrs') | count }}
availability: "{{ is_state('binary_sensor.openwebrx','on') }}"
icon: mdi:signal-variant
attributes:
sdr: >
[{% for j in state_attr( 'sensor.openwebrx_version', 'sdrs') %}
'{{ j.name }}',
{% endfor %}]