Redid wan traffic collection and replaced the old clumsy way. Added usage_meters.

This commit is contained in:
2022-12-17 21:41:13 +01:00
parent 1d7ce83972
commit bc6964ce5f
5 changed files with 17 additions and 50 deletions

View File

@@ -343,30 +343,6 @@
- schlafzimmer
- wohnzimmer
mode: single
- id: snmp_monitor_traffic_in
alias: Monitor Traffic In
trigger:
platform: state
entity_id: sensor.snmp_wan_in
action:
- service: input_number.set_value
data_template:
entity_id: input_number.internet_traffic_delta_in
value: '{{ ((trigger.to_state.state | int - trigger.from_state.state | int)
* 8 ) / ( as_timestamp(trigger.to_state.last_updated) - as_timestamp(trigger.from_state.last_updated)
) }}'
- id: snmp_monitor_traffic_out
alias: Monitor Traffic Out
trigger:
platform: state
entity_id: sensor.snmp_wan_out
action:
- service: input_number.set_value
data_template:
entity_id: input_number.internet_traffic_delta_out
value: '{{ ((trigger.to_state.state | int - trigger.from_state.state | int)
* 8 ) / ( as_timestamp(trigger.to_state.last_updated) - as_timestamp(trigger.from_state.last_updated)
) }}'
- id: '1632477389492'
alias: Licht beim Heimkommen einschalten
description: Nur während Dunkelphase