ok thank you for telling me, here is a copy of my last update.
sensor:
- platform: template
sensors:
sonoff_1001489baa_current:
friendly_name: "courant pump"
value_template: " {{ state_attr('switch.sonoff_1001489baa' , 'power') }} "
unit_of_measurement: " A "
sensors:
friendly_name: "power pump"
value_template: " {{ state_attr('switch.sonoff_1001489baa' , 'power') }} "
unit_of_measurement: " W "
sensors:
friendly_name: "voltage pump"
value_template: " {{ state_attr('switch.sonoff_1001489baa' , 'voltage') }} "
unit_of_measurement: " V "
and error I still get in editor
duplicated mapping key at line 35, column -168:
sensors:
^
and after testing config
Invalid config for [sensor.template]: expected dictionary for dictionary value @ data[‘sensors’][‘friendly_name’]. Got ‘voltage pump’ expected dictionary for dictionary value @ data[‘sensors’][‘unit_of_measurement’]. Got ’ V ’ expected dictionary for dictionary value @ data[‘sensors’][‘value_template’]. Got " {{ state_attr(‘switch.sonoff_1001489baa’ , ‘voltage’) }} ". (See ?, line ?).
PS: LINE 35 is the line that starts with the second command ‘sensor’ as per bellow