Problem configuring multiple REST sensors

Hello,
I am new to HA an I try to configure two rest sensors. If I use only one sensor as in the configuration below everything works fine:


#power fox integration Erdgeschoss
rest:
  - authentication: basic
    username: "myusername"
    password: "mypassword"
    scan_interval: 10
    resource: "https://backend.powerfox.energy/api/2.0/my/mydeviceid/current"
    sensor:
      - name: "powerfox_eg"
        value_template: "OK"
        json_attributes:
          - "Watt"
          - "A_Plus"
          - "A_Plus_HT"
          - "A_Plus_NT"
          - "A_Minus"
          - "Timestamp"
          
template:          
- sensor:
  - name: "powerfox_eg_aktuell"
    state: "{{ state_attr('sensor.powerfox_eg', 'Watt') }}"
    unit_of_measurement: "Wh"
    device_class: "power"
    state_class: "measurement" 
    unique_id: "1234567899876543211"

I want to configure another endpoint with the same structure. The only difference is that the device id in the endpoint. If i duplicate the configuration and change the names and unique ids both rest entities are visible, but only one of the sensors defined under “template:”
What might I be doing wrong or do I need a completely different structure for the configuration?

Thanks in advance,

Hinrich