This is my working config:
scrape:
- resource: https://www.sunnyportal.com/Templates/PublicPage.aspx?page=5b628919-c02f-4956-a734-c4976f31e917#
sensor:
- name: "pv_einheit"
select: "#ctl00_ContentPlaceHolder1_PublicPagePlaceholder1_PageUserControl_ctl00_PublicPageLoadFixPage_energyYieldWidget_energyYieldUnit"
- name: "pv_wert"
value_template: '{% if is_state("sensor.pv_einheit", "Wh") %}{{ value | float / 1000 }}{% else %}{{ value | float }}{% endif %}'
select: "#ctl00_ContentPlaceHolder1_PublicPagePlaceholder1_PageUserControl_ctl00_PublicPageLoadFixPage_energyYieldWidget_energyYieldValue"
- name: "pv_periode"
select: "#ctl00_ContentPlaceHolder1_PublicPagePlaceholder1_PageUserControl_ctl00_PublicPageLoadFixPage_energyYieldWidget_energyYieldPeriodTitle"
- name: "SMA2"
value_template: '{%- if is_state("sensor.pv_periode", "Today") and (states.sensor.pv_wert.state | float) < 150 -%}{{ states.sensor.pv_wert.state | round(1) }}{% else %}0{% endif %}'
select: "#ctl00_ContentPlaceHolder1_UserControlShowDashboard1_energyYieldWidget_energyYieldValue"
unit_of_measurement: kWh