This is the forum archive of Homey. For more information about Homey, visit the Official Homey website.
The Homey Community has been moved to https://community.athom.com.
This forum is now read-only for archive purposes.
The Homey Community has been moved to https://community.athom.com.
This forum is now read-only for archive purposes.
Official
Comments
What this actually does is requesting the power state of my TV. For clarification I added a screenshot from SoapUI with on the left the request and on the right the response.
However your example does clear up some questions on how to use the node HTTP options. I also need to talk to a specific port and if I understand it correctly I only need to add the parameter "port":1925.
First parameter: {"protocol": "http:", "hostname": "192.168.128.35", "port": 1925, "path":"/5/notifychange", "method": "post", "json": {"notification":{"powerstate":{"powerstate":""}}}}
Second parameter: $[json][powerstate][powerstate]
The first parameter executes a post to http://192.168.128.35:1925/5/notifychange with body {"notification":{"powerstate":{"powerstate":""}}}
The second parameter reads the value in powerstate > powerstate from the returned json result.
Is there a way I can debug the steps?
Other option is to use my Realtime Homey Logger:
If you paste the realtime log lines of the HTTP app with this tool I can help you debugging.
URL: http://api.wunderground.com/api/<<key>>/conditions/forecast/lang:NL/q/pws:IGRONING72.json
JSON: $.[forecast][txt_forecast][forecastday][2][fcttext_metric]
Result that should be saved: "Zich in de middag ontwikkelende regen. Maximaal 19C. Wind uit het ZW van 15 tot 30 km/u. Kans op regen 90%. Regenval ongeveer ~ 6 mm. Lokaal zware regenbuien mogelijk."
But it starts a connection to the api for every variable it is getting.
I tried to limit the amount of pulls with the option:
"headers": {"Connection": "keep-alive"}
But it still keeps reopening the connection.
Or it is giving me an "Cannot read property 'indexOf' of undefined" error, which i can't figure out what is wrong.
codes i tried:
Or is it just not possible what i'm trying to achieve?
Since it re-triggers the request with every [THEN] Card
Or is there a way to keep using the entire JSON page with just one request and set several variables with that?
So the question is, is it possible to pull multiple JSON's out of one request and punt them in multiple Better Logical variables?
Don't Know the answer but it would be great when it became possible.
@ErikVanDongen, is it possible to have numerical better logic variables as an option, as I need to trigger some of my flows on the variable numerical value...
Guys,
I was wondering if someone could help me. I'm trying to pull some basic data from my Bloomsky API.
The instructions are:
Use HTTP header "Authorization: your_api_key" and initiate a GET request at https://api.bloomsky.com/api/skydata/?unit=intl
The result is some nice JSON. I'd like to pull the table Data - Temperature / Humidity / UVIndex into variables (See screenshot). Can someone help me achieve this? I'd really appreciate it!
Do you have documentation of this device / api? I must create a dummy service first for testing the card and determine how to support this feature somewhat generic. Will you be available for testing this (using github downloads and CLI installation on your Homey)?
Because flow cards have no knowledge of each other keep-alive mechanisms would be very hard to accomplish.
after that its the same as getting it from a url
I was thinking a little bit like this,
Variable Full JSON = where you get the variable with the full json
JSONpath = well.. the json path to the value
Variable Value = the singel value gotten from the full json
But yeah, it is a string, so it will be needed to "parse" it.
But i don't know if that is supported in the node.js version homey is using
Maybe the BetterLogic developer want to adopt this function in his app?
http://192.168.10.1:34000/Light/Capability/SwitchPower.json
{"state":"true"} for On, {"state":"false"} for Off
Someone having tipps how to make it?
Tnx
You can try leave the quotes around "true" and "false".
I find out all this with the Web Interface of the Striim device and investigating. Using the Post App in Chrome is working, but not from Homey.
I will try tonight without quotes
Tnx
Now even starting and playing music presets is working perfect: http://192.168.10.1:34000/Player/PlayPreset.json and then {"id":1} for the first preset and so on.
Thank you
At the moment this is not possible. Can you post a feature request via an issue on my github? https://github.com/irritanterik/homey-http-request-actions/issues
I wil refactor some code in the app later this year, will look to your request then.
Nevermind, found the 'solution' : https://github.com/irritanterik/homey-http-request-actions/issues/9
https://my.zipato.com/zipato-web/remoting/attribute/set?serial=myserial&apiKey=mykey&state=1
URL: https://my.zipato.com/zipato-web/remoting/attribute/set?
then: {"serial":"myserial", "apiKey":"mykey", "state":"1"}
or
URL: https://my.zipato.com/zipato-web/remoting/attribute/set?serial=myserial&apiKey=mykey&
then: {"state":"1"}
Not sure if is working.