Moved sunrise/set calculation to HA via template sensor. Get rid of that (non-working) dirty workaround.

This commit is contained in:
2022-02-20 16:45:59 +01:00
parent 9aa7d9e693
commit 6d740d7383
2 changed files with 38 additions and 55 deletions

View File

@@ -2,6 +2,7 @@
- platform: time_date
display_options:
- 'time'
- 'date'
# Raspberry Pi CPU temp
- platform: command_line
name: "CPU Temp"
@@ -37,17 +38,17 @@
- platform: template
sensors:
internet_speed_in:
friendly_name: 'Internet Speed IN'
value_template: '{{ ((states.input_number.internet_traffic_delta_in.state | float ) / 1000000 ) | round(2) }}'
unit_of_measurement: 'Mbps'
internet_speed_in:
friendly_name: 'Internet Speed IN'
value_template: '{{ ((states.input_number.internet_traffic_delta_in.state | float ) / 1000000 ) | round(2) }}'
unit_of_measurement: 'Mbps'
- platform: template
sensors:
internet_speed_out:
friendly_name: 'Internet Speed OUT'
value_template: '{{ ((states.input_number.internet_traffic_delta_out.state | float ) / 1000000 ) | round(2) }}'
unit_of_measurement: 'Mbps'
internet_speed_out:
friendly_name: 'Internet Speed OUT'
value_template: '{{ ((states.input_number.internet_traffic_delta_out.state | float ) / 1000000 ) | round(2) }}'
unit_of_measurement: 'Mbps'
- platform: statistics
name: 'WAN Traffic In'
@@ -56,3 +57,15 @@
- platform: statistics
name: 'WAN Traffic Out'
entity_id: sensor.internet_speed_out
- 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') }}"
- 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') }}"