Upload data from dutch smartmeter using DSMR binding to pvoutput

In openhab 3.3.0 I use the DSMR binding for reading my smart meter and the items values are visible in the UI.
Now I want to upload some item values to pvoutput using API, see https://pvoutput.org/help/api_specification.html?highlight=api
I already created a simple bash script with can send data to my pvoutput account:

RESULT=$(curl -d “d=20111201” -d “t=10:00” -d “v1=1000” -d “v2=150” -H “X-Pvoutput-Apikey: Your-API-Key” -H “X-Pvoutput-SystemId: Your-System-Id” https://pvoutput.org/service/r2/addstatus.jsp)
echo “$RESULT”

so far, everything works.
But now I have to replace the fixed values v1=1000 and v2=150 with my item values.
I studied a lot of examples, read the documents about exec binding, rules, actions etc. but I still don’t know how to handle this.
The item values witch I read using the binding are given with a unit (f.i. the actual power is 0.478 kW).
To insert the items as variables in the curl command the items must be numbers.
I think I need a rule to trigger if my item received an update and then use ‘executeCommandLine’ to execute my bash script. But how do I pass my item values (numbers) into the bash script?
Who can get me on the right track to fix this?

A little update

My rule is:
rule “dsmr”
Item Elektriciteitsmeter_HuidigeElektriciteitverbruik received update
val power = (((Elektriciteitsmeter_HuidigeElektriciteitverbruik.state as Number).doubleValue*1000)as Number).intValue
executeCommandLine(Duration.ofSeconds(30), “/etc/openhab/scripts/pvoutput.sh”, power)

and my script:
dt=$(date +%Y%m%d)
tm=$(TZ=‘Europe/Amsterdam’ date +%H:%M)
RESULT=$(curl -d “d=$dt” -d “t=$tm” -d “v1=1000” -d “v4=$1” -H “X-Pvoutput-Apikey: my_API_key” -H “X-Pvoutput-SystemId: my_system_ID” https://pvoutput.org/service/r2/addstatus.jsp)

The logfile shows:
2022-10-17 20:43:10.093 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID ‘dsmr-1’ failed: An error occurred during the script execution: array element type mismatch in dsmr

I Think something goes wrong with the parameter $1 which should have the value “power”.
When I replace $1 f.e. by the number 150 the scrip runs as expected…
Who can help?

my rule: executeCommandLine(Duration.ofSeconds(30), “/etc/openhab/scripts/pvoutput.sh”, power)
should be:
executeCommandLine(Duration.ofSeconds(30), “/etc/openhab/scripts/pvoutput.sh”, power.toString)
Now it works!!