myStrom / Attribut

Hi all,

i have a myStrom Smart Plug. Based on the manual I have added the following text to my config and I can see the switch in the dashboard (Toogle On/Off):

myStrom

switch:

  • platform: mystrom
    host: 192.168.1.95
    name: Heizdecke

The switch has an attribut which has the name current_power_w and shows the current power consumption. I have tried to add the following text to my config to create a template but it do not works:

#template

  • platform: template
    switch:
    mystrom:
    value_template: ‘{{ heizdecke.attributes.current_power_w }}’
    unit_of_measurement: ‘W’

Can someone help me to show the attribut in the default view?

I have found the solution:

  • platform: template
    sensors:
    myStrom_watt:
    value_template: ‘{{ states.switch.myStrom.attributes[“current_power_w”] }}’
    unit_of_measurement: ‘W’