Page 1 of 1

Howto modify data in DATA-PUSH HTTP?

Posted: Wednesday 20 December 2023 13:11
by DL1GFM
Hello

I want to send some data from an power sensor to a website using Data-Push-HTTP.
On tne commandline it works with wget --post-data '{"watt":120}' https :// webseite . de
How I tried it you can see in the attached pic.

But it does not work.

* Is there a way to debug the way domoticz creates the URL, to see if it is correct?
* the second problem is, the Value %v is a number like 123 . 12, but the website only accept 123
* Is there a way to manipulate the data before sending them?

In the Log i only can see:
HttpLink: sending global variable Watt with value: -256 . 00
HttpLink: response Unexpected error occurred.

Thanks for help.

Sorry about the blanks, but it seems not to be allowed to send urls und numer with dots.

Re: Howto modify data in DATA-PUSH HTTP?

Posted: Wednesday 20 December 2023 18:10
by willemd
I assume you use dzVents.

* Is there a way to debug the way domoticz creates the URL, to see if it is correct?
You can send the url to the logfile and inspect it
domoticz.log("this is the url:"..yourUrl,domoticz.LOG_INFO)


* the second problem is, the Value %v is a number like 123 . 12, but the website only accept 123
you can round it to zero decimals
domoticz.utils.round(yourValue,0)


* Is there a way to manipulate the data before sending them?
yes, with dzVents you can do a lot

Re: Howto modify data in DATA-PUSH HTTP?

Posted: Wednesday 20 December 2023 19:40
by DL1GFM
Hello,

thanks for your respond. I am not very familiar with dzvents.
How do I get my dzvents posted here in the forum to show what I want to do?
I allways get an error that it is not allowed to post urls an other commands like domoticz (dot) openURL

I need to read the data of my power meter an strip the ending .00, then put this in postData = {"text" : powerdata} of domoticz . openURL

Markus