Hi,
I have the following in my configuration.yaml:
# trigger based sensors
- trigger:
- trigger: time_pattern
# einmal in der Nacht reicht
hours: "00"
minutes: "06"
binary_sensor:
- name: "Sommerzeit"
unique_id: "summer_time"
# Sommerzeit vom 25.3. bis 21.9.
state: "{{ (3,25) <= (now().month, now().day) <= (9,21) }}"
- trigger:
- trigger: time_pattern
# einmal in der Nacht reicht
hours: "00"
minutes: "07"
# Winterzeit = NICHT Sommerzeit
binary_sensor:
- name: "Winterzeit"
unique_id: "winter_time"
state: "{{ not is_state('input_boolean.sommerzeit','on') }}"
Which should test for Summertime (in my config between march 25 and sep 21) and set the sensor once a night at 00:06 and
set wintertime = NOT summertime
at 00:07. Today I saw, that summertime is correct, but wintertime is not. The whole winter, the wintertime booloean was correct. Where am I wrong with this small code snippet?
Hi @123
Many thanks. One question:
I really tested this very thoroughly when I “programmed” it in wintertime. I also set the “summertime dates” during test, so that I got true/false. But for shure “wintertime” was always “true”, but due to a different case.
How can I test this, when I try things in HA? If I understand it correct, before I could have basically tested for “NOT cheeskake on my desk”, and also get a “true” for wintertime.
@123
Boah, me stupid Should have not been so happy,m that summertime changes, but should have also watched more carefully that wintertime does not change.
argh
sorry.
Stupid question… why two sensors…if binary_sensor is not summertime (off/false) …isn’t it then not automatically wintertime ? Or do you live in a multiverse