2021-09-11 23:34:31 +02:00
# Time sensor (for use in templates and TTS)
- platform : time_date
display_options :
- 'time'
2022-02-20 16:45:59 +01:00
- 'date'
2021-08-26 12:22:39 +02:00
# Database size sensor
- platform : sql
db_url : !secret ha_recorder_dburl
queries :
- name : "Home Assistant Datenbankgröße"
query : 'SELECT table_schema "database", Round(Sum(data_length + index_length) / 1048576, 2) "value" FROM information_schema.tables WHERE table_schema="homeassistant" GROUP BY table_schema;'
column : 'value'
unit_of_measurement : MB
2022-12-17 21:41:13 +01:00
2021-09-06 15:55:43 +02:00
# SNMP (Juniper) router traffic sensor
- platform : snmp
name : snmp_wan_in
host : !secret router_ip
community : !secret router_community
baseoid : .1.3.6.1.2.1.2.2.1.10.511
- platform : snmp
name : snmp_wan_out
host : !secret router_ip
community : !secret router_community
baseoid : .1.3.6.1.2.1.2.2.1.16.511
2022-12-17 21:41:13 +01:00
- platform : derivative
source : sensor.snmp_wan_in
unit_time : s
unit : B
name : wan_in_derivative
- platform : derivative
source : sensor.snmp_wan_out
unit_time : s
unit : B
name : wan_out_derivative
2021-09-06 15:55:43 +02:00
- platform : template
sensors :
2022-02-20 16:45:59 +01:00
internet_speed_in :
friendly_name : 'Internet Speed IN'
2022-12-17 21:41:13 +01:00
value_template : "{{ (( states('sensor.wan_in_derivative') | float * 8 / 1000000 ) | round(2)) }}"
2022-02-20 16:45:59 +01:00
unit_of_measurement : 'Mbps'
internet_speed_out :
friendly_name : 'Internet Speed OUT'
2022-12-17 21:41:13 +01:00
value_template : "{{ (( states('sensor.wan_out_derivative') | float * 8 / 1000000 ) | round(2)) }}"
2022-02-20 16:45:59 +01:00
unit_of_measurement : 'Mbps'
2021-09-06 15:55:43 +02:00
- platform : statistics
name : 'WAN Traffic In'
2022-02-22 23:19:28 +01:00
state_characteristic : mean
2021-09-06 15:55:43 +02:00
entity_id : sensor.internet_speed_in
2022-11-03 10:39:35 +01:00
sampling_size : 10
2021-09-06 15:55:43 +02:00
- platform : statistics
name : 'WAN Traffic Out'
2022-02-22 23:19:28 +01:00
state_characteristic : mean
2021-09-06 15:55:43 +02:00
entity_id : sensor.internet_speed_out
2022-11-03 10:39:35 +01:00
sampling_size : 10
2022-02-20 16:45:59 +01:00
- platform : template
sensors :
sun_rising_template :
friendly_name : "Sun Rising Template"
value_template : "{{ as_timestamp(states.sun.sun.attributes.next_rising) | timestamp_custom ('%H:%M') }}"
2022-02-22 23:19:28 +01:00
2022-02-20 16:45:59 +01:00
- platform : template
sensors :
sun_setting_template :
friendly_name : "Sun Setting Template"
value_template : "{{ as_timestamp(states.sun.sun.attributes.next_setting) | timestamp_custom ('%H:%M') }}"
2022-12-17 21:41:13 +01:00
2023-06-25 22:41:46 +02:00
# Sensor for Riemann sum of energy import (W -> Wh)
- platform : integration
source : sensor.power_import
name : energy_import_sum
unit_prefix : k
round : 2
method : left
# Sensor for Riemann sum of energy export (W -> Wh)
- platform : integration
source : sensor.power_export
name : energy_export_sum
unit_prefix : k
round : 2
method : left
# Sensor for Riemann sum of energy consumption (W -> Wh)
- platform : integration
source : sensor.power_consumption
name : energy_consumption_sum
unit_prefix : k
round : 2
method : left