Issue with platform: integration

How can I use ‘platform: integration’ in the new template structure?
My configuration.yaml has

template:

  • sensor: !include sensors.yaml

And the sensors I have in there all work.
Wanting to add an additional sensor, which in the ‘old’ notation looks like:

sensor:
platform: integration
source: sensor.sonoff_swv_flow
name: Water Consumption increasing
method: left
round: 2

However, if I add that to the sensors.yaml file I get “required key ‘state’ not provided Invalid config for ‘template’ at sensors.yaml”.

Firstly: https://community.home-assistant.io/t/how-to-help-us-help-you-or-how-to-ask-a-good-question/114371#oneone-format-it-properly-16

Secondly, the integral sensor platform goes under the sensor: integration, not under the template: integration (not even under template/sensor).

So here is where it goes:

# configuration.yaml
sensor:
  - platform: integration

Not here:

# configuration.yaml
template:
  - sensor:
      - platform: integration

Please see the first line of the example in the documentation:

Additionally doing this will get very confusing:

As almost all people use include for sensors.yaml here:

# configuration.yaml
sensor: !include sensors.yaml

Thanks @tom_l , done it using the ‘modern’ notation and that seems to work.
So configuration.yaml now has:
sensor: !include sensors.yaml
template: !include templates.yaml

The integration has been added to sensors.yaml under it’s own section:
-platform: integration
source: sensor.sonoff_swv_flow
name: Water Consumption increasing
method: left
round: 2

No errors in checking the config or restarting HA