Rest Sensor not working for smartmeter

Hi there,
I’m new to home assistant and during implementation of my first rest sensor I ran into the following problem:

My smartmeter returns following json data:

[
...
{"Monat":"10","Waehrung":"EUR","Kwh180":360.2891,"Kwh181":0,"Kwh182":0,"Kwh280":0,"Kwh281":0,"Kwh282":0,"Betrag1XX":90.82888211,"Betrag2XX":0},{"Monat":"11","Waehrung":"EUR","Kwh180":344.6198,"Kwh181":0,"Kwh182":0,"Kwh280":0,"Kwh281":0,"Kwh282":0,"Betrag1XX":86.87865158,"Betrag2XX":0},{"Monat":"12","Waehrung":"EUR","Kwh180":212.637,"Kwh181":0,"Kwh182":0,"Kwh280":0,"Kwh281":0,"Kwh282":0,"Betrag1XX":53.6057877,"Betrag2XX":0}]

My sensor looks like this:

sensor:
  - platform: rest
    name: 'ehz01_year'
    scan_interval: 30
    resource_template: 'http://10.10.10.10/pages/getinformation.php?auswertung_jahr&jahr={{ now().strftime("%Y") }}&meterindex=1'
    value_template: '{{ 'OK' }}'
    #json_attributes_path: '$[(selectattr("Monat","eq",now().strftime("%m")))]'
    #json_attributes_path: '$[months[now().month-1].strftime("%m")]'
    #json_attributes_path: '$[now().strftime("%m")]'
    json_attributes_path: '$[{{ (now().month - 1) }}]'
    json_attributes:
      - Kwh180
      - Betrag1XX
  - platform: template
    sensors:
      ehz01_monthconsumption:
        value_template: '{{ states.sensor.ehz01_year.attributes["Kwh180"] | round (2) | float }}'
        device_class: energy
        unit_of_measurement: 'kWh'
        unique_id: 'sensor.ehz01_monthconsumption'
      ehz01_monthcost:
        value_template: '{{ states.sensor.ehz01_year.attributes["Betrag1XX"] | round (2) | float }}'
        unit_of_measurement: '€'
        unique_id: 'sensor.ehz01_monthcost'

I’d like to use json_attributes_path to find the line of the current month in the json array (month -1), but the syntax seems not to be correct. After changing it to json_attributes_path: '$[11]' data where retrieved successfully.

What am I doing wrong?

Thank you for your help!

Oliver