various tidyups
This commit is contained in:
@@ -1,19 +1,25 @@
|
||||
sensor:
|
||||
- platform: template
|
||||
sensors:
|
||||
sensor_internet_downtraffic:
|
||||
friendly_name: "Internet Download Traffic"
|
||||
template:
|
||||
- sensor:
|
||||
- name: "Internet Download Traffic"
|
||||
unique_id: internet_downtraffic
|
||||
unit_of_measurement: "kB/s"
|
||||
value_template: "{{ state_attr('binary_sensor.edgeos_interface_pppoe0', 'KBytes/ps (Received)') }}"
|
||||
- platform: template
|
||||
sensors:
|
||||
sensor_internet_uptraffic:
|
||||
friendly_name: "Internet Upload Traffic"
|
||||
state_class: measurement
|
||||
state: >
|
||||
{{ state_attr('binary_sensor.edgeos_interface_pppoe0', 'KBytes/ps (Received)') | float(0) }}
|
||||
|
||||
- name: "Internet Upload Traffic"
|
||||
unique_id: internet_uptraffic
|
||||
unit_of_measurement: "kB/s"
|
||||
value_template: "{{ state_attr('binary_sensor.edgeos_interface_pppoe0', 'KBytes/ps (Sent)') }}"
|
||||
- platform: template
|
||||
sensors:
|
||||
sensor_internet_totaltraffic:
|
||||
friendly_name: "Internet Total Traffic"
|
||||
state_class: measurement
|
||||
state: >
|
||||
{{ state_attr('binary_sensor.edgeos_interface_pppoe0', 'KBytes/ps (Sent)') | float(0) }}
|
||||
|
||||
- name: "Internet Total Traffic"
|
||||
unique_id: internet_totaltraffic
|
||||
unit_of_measurement: "kB/s"
|
||||
value_template: "{{ state_attr('binary_sensor.edgeos_interface_pppoe0', 'KBytes/ps (Received)') |float + state_attr('binary_sensor.edgeos_interface_pppoe0', 'KBytes/ps (Sent)') | float }}"
|
||||
state_class: measurement
|
||||
state: >
|
||||
{{
|
||||
(state_attr('binary_sensor.edgeos_interface_pppoe0', 'KBytes/ps (Received)') | float(0))
|
||||
+ (state_attr('binary_sensor.edgeos_interface_pppoe0', 'KBytes/ps (Sent)') | float(0))
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user