Goodwe to pvoutput problem

hi all,

i have a problem to send my goodwe inverter data to pvoutput.
this is my script:
shell_command: pvoutputcurl: 'curl -d "d={{now().strftime("%Y%m%d")}}" -d "t={{now().strftime("%H:%M")}}" -d "v1={{states.sensor.pv1_power | round(0, default=0)}}}" -d -H "X-Pvoutput-Apikey: 9.....9" -H "X-Pvoutput-SystemId: 1...4"'

But i get this error:

Error while executing automation automation.pv: ValueError: Template error: round got invalid input '<template TemplateState(<state sensor.pv1_power=291; state_class=measurement, unit_of_measurement=W, device_class=power, icon=mdi:solar-power, friendly_name=PV1 Power @ 2023-11-07T08:40:07.579439+01:00>)>' when rendering template '-d "d={{now().strftime("%Y%m%d")}}" -d "t={{now().strftime("%H:%M")}}" -d "v1={{states.sensor.pv1_power|round(0)}}" -d -H "X-Pvoutput-Apikey: 966bf747452474d910b26a32236e9dd0044f49e9" -H "X-Pvoutput-SystemId: 102044"' but no default was specified

what am i doing wrong?

anybody can help please



Extra } ?

I have tryed that already, same error message

Have you pasted it into dev tools to see if it works there ?

Also, can you format your post it’s hard to read

This is what format mine looks like:

pvoutputcurl: >
  curl  -d "d={{now().strftime("%Y%m%d")}}"
        -d "t={{now().strftime("%H:%M")}}"
        -d "v1={{states.sensor.pv1_power | round(0, default=0)}}}"
        -H "X-Pvoutput-Apikey: 9…9" -H 
        -H "X-Pvoutput-SystemId: 1…4"'

it is working now in dev tools but now i got an other message in the automation script:

Error while executing automation automation.pv: UndefinedError: ‘None’ has no attribute ‘state’

alias: PV
description: ""
- platform: time_pattern
minutes: /5
condition: []
- service: shell_command.pvoutputcurl
data: {}
mode: single

Please format your code, its hard to read

sorry, i have formatted it now

Have you tried running the shell_command in dev tools ?

This is my automation:

alias: Upload to PVOutput
  - platform: time_pattern
    minutes: /5
  - condition: sun
    before: sunset
    after: sunrise
  - service: shell_command.pvoutputcurl
mode: single

i finally have it working, thx!

Glad you have it sorted, can you mark it as solved ?