Pvoutput HA

good evening
I have HA working on a raspberry pi for about 15 days.
I have a shelly to measure my home consumption and my production, which is sending data to the grafana and works perfectly.
now i wanted to get HA to send the data that shelly reads in to the pv output but i’m not getting someone can help me?
what I did was this:

sensor:

  • platform: pvoutput
    system_id: xxxxxxxxxxxx
    api_key: xxxxxxxxxxxxxxxxxxxxxxxx
    scan_interval: 70
  • platform: template
    sensors:
    power_consumption:
    value_template: ‘{% if is_state_attr(“sensor.pvoutput”, “power_consumption”, “NaN”) %}0{% else %}{{ state_attr(“sensor.pvoutput”, “power_consumption”) }}{% endif %}’
    friendly_name: “shellyem-B14385 channel 1 Power”
    unit_of_measurement: ‘Watts’
    energy_consumption:
    value_template: ‘{{ “%0.1f”|format(state_attr(“sensor.pvoutput”, “energy_consumption”)|float/1000) }}’
    friendly_name: “shellyem-B14385_channel_1_Energy”
    unit_of_measurement: “kWh”
    power_generation:
    value_template: ‘{% if is_state_attr(“sensor.pvoutput”, “power_generation”, “NaN”) %}0{% else %}{{ state_attr(“sensor.pvoutput”, “power_generation”) }}{% endif %}’
    friendly_name: “shellyem-B14385 channel 2 Power”
    unit_of_measurement: “Watt”
    energy_generation:
    value_template: ‘{% if is_state_attr(“sensor.pvoutput”, “energy_generation”, “NaN”) %}0{% else %}{{ “%0.2f”|format(state_attr(“sensor.pvoutput”, “energy_generation”)|float/1000) }}{% endif %}’
    friendly_name: “shellyem-B14385 channel 2 Energy”
    unit_of_measurement: “kWh”

Not a pvoutput user but that configuration only get data from pvoutput not the other way.

Maybe this helps: