Skip to content

Commit

Permalink
feat: add sensor for checking if there was rain in the last 24 hours.
Browse files Browse the repository at this point in the history
  • Loading branch information
TribuneX committed May 15, 2024
1 parent 9b0c184 commit 9d0b6a3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,4 @@ input_select: !include includes/input_select.yaml
cover: !include includes/cover.yaml
alarm_control_panel: !include includes/alarm_control_panel.yaml
mqtt: !include includes/mqtt.yaml
template: !include includes/template.yaml
9 changes: 9 additions & 0 deletions includes/sensors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,12 @@
- platform: time_date
display_options:
- 'date_time'

- platform: statistics
name: "Rain last day"
entity_id: sensor.rain_last_hour
state_characteristic: total
max_age:
hours: 24
sampling_size: 24
precision: 0
9 changes: 9 additions & 0 deletions includes/template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
- trigger:
- platform: time_pattern
minutes: "0" # every hour
sensor:
- name: "Rain last hour"
state: "{{ states('sensor.openweathermap_rain') }}"
unit_of_measurement: "ml"
attributes:
updated_at: "{{ now() }}"

0 comments on commit 9d0b6a3

Please sign in to comment.