Current Day

hello,

problem with this codes. first works, 2nd and 3rd not

  - platform: template
    sensors:
      current_weekday:
        value_template: "{{ ['Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag','Sonntag'][now().weekday()] }}"

  - platform: template
    sensors:
      current_month:
        value_template: "{{ ['Januar','Februar','Maerz','April','Mai','Juni','July','August','September','Oktober','November','Dezember'][now().month()-1] }}"   

  - platform: template
    sensors:
      current_day:
        value_template: "{{ now().day() }}"

Hello

Try [now().month-1]. It should work
Suggestion: test your formula in Developper Tools> template
Regards

1 Like

To get the current month and day, use this:

now().month
now().day

Not this:

now().month()
now().day()
1 Like