Files
ha-weather-records/set_rain_month.yaml
T
2026-08-20 18:18:59 +01:00

52 lines
1.7 KiB
YAML

alias: Weather - Set Rain Month
description: ""
trigger:
- platform: time
at: "23:59:00"
condition:
- condition: or
conditions:
- condition: template
value_template: "{{ now().strftime('%m-%d') == '01-31' }}"
alias: January 31st
- condition: template
value_template: "{{ now().strftime('%m-%d') == '02-28' }}"
alias: February 28th
- condition: template
value_template: "{{ now().strftime('%m-%d') == '03-31' }}"
alias: March 31st
- condition: template
value_template: "{{ now().strftime('%m-%d') == '04-30' }}"
alias: April 30th
- condition: template
value_template: "{{ now().strftime('%m-%d') == '05-31' }}"
alias: May 31st
- condition: template
value_template: "{{ now().strftime('%m-%d') == '06-30' }}"
alias: June 30th
- condition: template
value_template: "{{ now().strftime('%m-%d') == '07-31' }}"
alias: July 31st
- condition: template
value_template: "{{ now().strftime('%m-%d') == '08-31' }}"
alias: August 31st
- condition: template
value_template: "{{ now().strftime('%m-%d') == '09-30' }}"
alias: September 30th
- condition: template
value_template: "{{ now().strftime('%m-%d') == '10-31' }}"
alias: October 31st
- condition: template
value_template: "{{ now().strftime('%m-%d') == '11-30' }}"
alias: November 30th
- condition: template
value_template: "{{ now().strftime('%m-%d') == '12-31' }}"
alias: December 31st
action:
- service: input_number.set_value
data:
value: "{{ states('sensor.<MONTHLY RAIN SENSOR>') }}"
target:
entity_id: input_number.last_month_rain
mode: single