Https post or get script function

Want a simple "app" where i can call up a function to deliver:
post/send "parameter" = "value" in the form of a data to a https recipient, ie;
<send "device=abc, parameter=temperature, value=10>

processed/encoded as "www.website.com?dev=abc&temp=10&autochecksumcalculated=xyz"

rather than write a script per occasion, can i call up a function and pass on the variables to do the donkey work?

What is the format to address a device value?
For example, i want to set a variable to that of the temperature-value of one of my devices in order to then send that value as a http post

Do i need an additional app to "collect" the value and assign it to a user-variable?

Are you wanting to set the attributes from something external to the HE hub, or within the hub?

If external, then I would suggest installing the Maker API built-in app, adding your device to the list of devices in that app and calling the "Send Device Command URL" from your external app / service, passing in a parameter for the value, e.g. the setTemperature command. See here for more details.

If internal, i.e. you want to set the temperature of a device from within the HE hub, then you can use Rule Machine to call a custom command of setTemperature, passing in the temperature value. I can offer some more details if this is what you are after.

thanks for the response.
I actually want to report intervals to an external system/database.
So attain the temperature of device X and send that value to a HTTP get/post.

While we're at it, will the HE do HTTPS post/get ?

Alongside requests for information, the Maker API App can also send POST messages to external systems, but (I believe) only when devices state changes, i.e. attribute values change. You can configure the URL for the POST message in the Maker API App configuration screen.

If you need something beyond this we will need to put some more thought into this, or at least I will,...

i got that bit, thanks- i can send info when something changes, ie "switch x has changed state" so send mess "x=on/off"
But i want to send the value of a parameter/variable, ie, every 30mins send "x=variable" where x value is that of the current temperature/level/etc.

i can create "local variables" but i need to copy a device-variable to it prior to sending.
This can be done in set variable value but not every attribute of each device is available.

I am sure it is possible and i will eventually get it through trial and error and mucking about but cant yet find any documentation on it. Any help greatly appreciated

No one know then? Or not possible?
I'm making some progress getting some parameter values sent to the database.
One this i have discovered that it is unwise to label your devices with spaces in their names.
Wish i had known that sooner and saved a great deal of time.

any further advances that may save me more time, please?

Take a look at the InfluxDB Logger community application. It essentially is an App that sends updates to InfluxDB when either a value changes, or at a periodic interval. Thus, the framework of what youā€™re asking for is already created for you to use as an example for writing your own custom Groovy App.

Yes, I believe both http and https are supported by Hubitatā€™s underlying API.

Perhaps post some screenshots of what you have so far, e.g. any Rule Machine rules or however you have achieved what you have so far. That may help people visualise what you are trying to do and where you may need to make changes.

Sorry for not responding earlier. One tip, and I can't see for sure if you did this or not, but if you click the big green "Reply" button at the bottom of a topic, next to the Flag button, that is seen as you replying to the original post on a topic, in this case your own post, and I wouldn't get a notification on this normally, unless I have chosen to get notifications for this topic. If you click the Reply button at the end of my individual post with the little green tick, that is seen as you responding to my post specifically, and I would get a notification of this. Sorry if this does not apply in your case... Just see people doing it from time to time and feel it makes a better experience if people know these things and that people aren't ignoring them.

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.