Howto modify data in DATA-PUSH HTTP?

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
DL1GFM
Posts: 2
Joined: Wednesday 20 December 2023 12:15
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Howto modify data in DATA-PUSH HTTP?

Post 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.
Attachments
problem.jpg
problem.jpg (85.89 KiB) Viewed 282 times
willemd
Posts: 661
Joined: Saturday 21 September 2019 17:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.1
Location: The Netherlands
Contact:

Re: Howto modify data in DATA-PUSH HTTP?

Post 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
DL1GFM
Posts: 2
Joined: Wednesday 20 December 2023 12:15
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Howto modify data in DATA-PUSH HTTP?

Post 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
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest