Replies: 3 comments
-
I'm a bit confused if you actually know how Your script can just contain something like: #!/bin/bash
curl -u "admin:password" http://192.168.178.165/api/limit/config -d 'data={"serial":"1141xxxxxx", "limit_type":1, "limit_value":50}' The percent escapes in the JSON aren't necessary, also there are dots ( I tested my example and verified via the web interface, everything is working perfectly fine. Also |
Beta Was this translation helpful? Give feedback.
-
Thank you for the hint, it works now. |
Beta Was this translation helpful? Give feedback.
-
This discussion has been automatically locked since there has not been any recent activity after it was closed. Please open a new discussion for related concerns. |
Beta Was this translation helpful? Give feedback.
-
Hello,
i like to set set power of my hms-2000 but i get a syntax-error on the curl command as documented.
When i change all blanks to %20 the syntax-error is gone, but the power does not change (this can be a bug reported in issues). I use v23.12.19.
Script(every cmd one line):
#!/bin/bash
write pv-power schuppen in %
if [ -z ${DEBUG} ]
then
#curl --silent --output -u "admin:openDTU42" http://192.168.178.22/api/limit/config%20.-d%20.'data={"serial":"1164xxxxxxxx","limit_type":1,"limit_value":$1}'{"type":"success","message":"Settings%20.saved!"} >/dev/null
#curl -u "admin:openDTU42" http://192.168.178.22/api/limit/config%20.-d%20.'data={"serial":"1164xxxxxxxx","limit_type":1,"limit_value":$1}'{"type":"success","message":"Settings%20.saved!"} >/dev/null
curl -u "admin:openDTU42" http://192.168.178.22/api/limit/config .-d .'data={"serial":"1164xxxxxxxx","limit_type":1,"limit_value":$1}'{"type":"success","message":"Settings .saved!"} >/dev/null
fi
user@user-NUC7i5DNHE:~/pvmonitor$ bash -x ./pv-schuppen_write.sh 100
[1/3]: http://192.168.178.22/api/limit/config%20.-d%20.data="serial":"1164xxxxxxxx"type:success -->
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 384 100 384 0 0 11526 0 --:--:-- --:--:-- --:--:-- 11636
[2/3]: http://192.168.178.22/api/limit/config%20.-d%20.data="limit_type":1type:success -->
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 384 100 384 0 0 18741 0 --:--:-- --:--:-- --:--:-- 19200
[3/3]: http://192.168.178.22/api/limit/config%20.-d%20.data="limit_value":$1type:success -->
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 384 100 384 0 0 16273 0 --:--:-- --:--:-- --:--:-- 16695
[1/3]: http://192.168.178.22/api/limit/config%20.-d%20.data="serial":"1164xxxxxxxx"message:Settings%20.saved! -->
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 384 100 384 0 0 11122 0 --:--:-- --:--:-- --:--:-- 11294
[2/3]: http://192.168.178.22/api/limit/config%20.-d%20.data="limit_type":1message:Settings%20.saved! -->
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 384 100 384 0 0 17028 0 --:--:-- --:--:-- --:--:-- 17454
Cmd like documentation:
bash -x ./pv-schuppen_write.sh 100
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 384 100 384 0 0 7698 0 --:--:-- --:--:-- --:--:-- 7680
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0curl: (6) Could not resolve host: .-d
[1/3]: .data="serial":"1164xxxxxxxx"type:success -->
curl: (3) URL using bad/illegal format or missing URL
[2/3]: .data="limit_type":1type:success -->
curl: (3) URL using bad/illegal format or missing URL
[3/3]: .data="limit_value":$1type:success -->
curl: (3) URL using bad/illegal format or missing URL
[1/3]: .data="serial":"1164xxxxxxxx"message:Settings .saved! -->
curl: (3) URL using bad/illegal format or missing URL
[2/3]: .data="limit_type":1message:Settings .saved! -->
curl: (3) URL using bad/illegal format or missing URL
[3/3]: .data="limit_value":$1message:Settings .saved! -->
curl: (3) URL using bad/illegal format or missing URL
My SUN-2000 Inverter is broken (AC-shortage after 3 month of operation) after a grid outage. The chinese seller from aliexpress fooled me the hole time, and will not send a spare inverter. Now i will change to my HMS-2000 with opendtu to regulate the feeding power from my battery. My hole installation is controlled by a python program and all connected devices are controlled by bash-script. The reason is, i can change from SUN-2000 to HMS-2000 only with a change of the bash script for read/write Inverterb1 as example.
Beta Was this translation helpful? Give feedback.
All reactions