# Internet source for Spotswitch condition states
sensor:
  - platform: rest
    resource: https://spotswitch.net/api/?key=123456-not.registed.example.only@kampmation.eu
    name: spotswitch_states
    scan_interval: 31536000
    json_attributes:
      - States
        Prices

# define the prices as bonus
  - platform: template
    sensors:
      hourprice:
        unique_id: spothourprice
        unit_of_measurement: Eur/kWh
        device_class: energy
        value_template: >
          {{ states.sensor.spotswitch_states.attributes.Prices.electricity }}
      avgprice:
        unique_id: spotavgprice
        unit_of_measurement: Eur/kWh
        device_class: energy
        value_template: >
          {{ states.sensor.spotswitch_states.attributes.Prices.average }}
      gasprice:
        unique_id: spotgasprice
        unit_of_measurement: Eur/m3
        device_class: energy
        value_template: >
          {{ states.sensor.spotswitch_states.attributes.Prices.gas }}
