Switched SNMP traffic sensors to 64bit counters and into modern confg format.

This commit is contained in:
2023-07-01 19:36:31 +02:00
parent 8b43bf239b
commit 6fdacdc6e9
2 changed files with 26 additions and 19 deletions

View File

@@ -19,7 +19,7 @@
{{ (total + solar - raumduft - keller - musik - bett - heimkino_sz - deko - schreibtisch - serverraum - heimkino_wz - spieleschrank) | round(1) }}
device_class: power
state_class: measurement
attributes:
attributes:
last_reset: '1970-01-01T00:00:00+00:00'
# Shelly 3EM cumulative sensors (incl. PV)
@@ -36,9 +36,9 @@
device_class: power
state_class: measurement
icon: mdi:transmission-tower-export
attributes:
attributes:
last_reset: '1970-01-01T00:00:00+00:00'
# Template sensor for values of power export (active_power < 0)
- name: power_export
unit_of_measurement: 'W'
@@ -51,7 +51,7 @@
device_class: power
state_class: measurement
icon: mdi:transmission-tower-import
attributes:
attributes:
last_reset: '1970-01-01T00:00:00+00:00'
# Template sensor for values of power consumption
@@ -60,12 +60,26 @@
state: >
{% if (states('sensor.power_export')|float(0)) > 0 and (states('sensor.balkonkraftwerk_power')|float(0) - states('sensor.power_export')|float(0)) < 0 %}
{% elif (states('sensor.power_export')|float(0)) > 0 and (states('sensor.balkonkraftwerk_power')|float(0) - states('sensor.power_export')|float(0)) > 0 %}
{{ ((states('sensor.balkonkraftwerk_power')|float(0)) - states('sensor.power_export')|float(0)) | round(1) }}
{{ ((states('sensor.balkonkraftwerk_power')|float(0)) - states('sensor.power_export')|float(0)) | round(1) }}
{% else %}
{{ (states('sensor.power_import')|float(0) + states('sensor.balkonkraftwerk_power')|float(0)) | round(1) }}
{% endif %}
device_class: power
state_class: measurement
icon: mdi:home-lightning-bolt
attributes:
attributes:
last_reset: '1970-01-01T00:00:00+00:00'
# Internet Speed template sensor
- name: internet_speed_in
state: >
{{ (( states('sensor.wan_in_derivative') | float * 8 / 1000000 ) | round(2)) }}
unit_of_measurement: 'Mbps'
attributes:
last_reset: '1970-01-01T00:00:00+00:00'
- name: internet_speed_out
state: >
{{ (( states('sensor.wan_out_derivative') | float * 8 / 1000000 ) | round(2)) }}
unit_of_measurement: 'Mbps'
attributes:
last_reset: '1970-01-01T00:00:00+00:00'