Help with a dummy switch based of the winter / summer months


ich try to make a dummy switch which has a template, based on the month, for example ,

November → March ===> Winter
March —> November ===> Summer

can me someone help?

i want to use it for my radiator control.

thank you all

You dont want a switch you want a binary sensor. A switch is smething you can control, this entity you want will be controlled by the date.

November and March appear in both your date ranges. I am going to assume you mean the beginning of November to the end of February (4 months) and the beginning of March to the end of October ( 8 months).

  - binary_sensor:
      - name: Summer Months
        state: "{{ 2 < now().month < 11 }}"

Or if you really want a sensor that says ‘summer’ or ‘winter’ rather than the binary on/off:

  - sensor:
      - name: Heating Season
        state: "{{ 'Summer' if 2 < now().month < 11 else 'Winter' }}"

I have no real-life example but…
You could create a sensor with a value template…
Extract the month from the date/now and then do an
{% if month in (‘Jan’,‘Feb’…etc. %}

The EPIC Time Conversion and Manipulation Thread! - Configuration - Home Assistant Community (


Perhaps this integration will help.


Great…soo many things I still do not know from HA :slight_smile:

That’s fine, except they asked for a custom season range, not the official astronomical or meteorological seasons.