Hue Web Request Help


#1

1) Give a description of the problem
Am trying to send a web request to my hue bridge to turn on/off groups of lights. I used this method with tasker. This also gives very smooth fade transitions as apposed to the jumpy ones I get through webcore

2) What is the expected behavior?
Lights will react to web request

3) What is happening/not happening?
Nothing. Web request does not appear to be getting through.

4) Post a Green Snapshot of the pistonimage

5) Attach any logs (From ST IDE and by turning logging level to Full)
(
1/26/2018, 7:10:49 PM +156ms
+0ms â•”Received event [Home].time = 1516993850915 with a delay of -1760ms
+63ms â•‘RunTime Analysis CS > 17ms > PS > 28ms > PE > 19ms > CE
+65ms â•‘Runtime (36882 bytes) successfully initialized in 28ms (v0.2.102.20180116) (64ms)
+66ms â•‘â•”Execution stage started
+67ms â•‘â•šExecution stage complete. (1ms)
+68ms â•šEvent processed successfully (68ms)
1/26/2018, 7:10:31 PM +425ms
+1ms â•”Received event [Home].wc_async_reply = httpRequest with a delay of 0ms
+71ms â•‘RunTime Analysis CS > 23ms > PS > 27ms > PE > 21ms > CE
+73ms â•‘Runtime (36886 bytes) successfully initialized in 27ms (v0.2.102.20180116) (72ms)
+74ms â•‘â•”Execution stage started
+83ms ║║Cancelling statement #4’s schedules…
+84ms â•‘â•šExecution stage complete. (10ms)
+85ms â•šEvent processed successfully (85ms)
1/26/2018, 7:10:30 PM +812ms
+0ms â•”Received event [Home].test = 1516993830809 with a delay of 3ms
+57ms â•‘RunTime Analysis CS > 19ms > PS > 23ms > PE > 15ms > CE
+60ms â•‘Runtime (36878 bytes) successfully initialized in 23ms (v0.2.102.20180116) (58ms)
+60ms â•‘â•”Execution stage started
+67ms ║║Cancelling statement #1’s schedules…
+78ms â•‘â•‘Executed virtual command setVariable (6ms)
+95ms â•‘â•‘Sending internal web request to: 192.168.1.111/api/49moS5VGuPw4MLB2p2i-QbrjHuv7t9SO5OcQnE10/groups/3/action
+98ms â•‘â•‘Executed virtual command httpRequest (14ms)
+101ms â•‘â•‘Requesting a wake up for Fri, Jan 26 2018 @ 7:10:50 PM GMT (in 20.0s)
+130ms â•‘â•šExecution stage complete. (70ms)
+149ms â•‘Setting up scheduled job for Fri, Jan 26 2018 @ 7:10:50 PM GMT (in 19.955s)
+160ms â•šEvent processed successfully (160ms))

REMOVE BELOW AFTER READING
If a solution is found for your question then please mark the post as the solution.


Fade Hue, Saturation, and Level at the same time?
#2

I had a piston I was playing around with since June that I never got to work, maybe it’s time to revisit it. @ipaterson had some suggestions on crafting json requests in the forum so maybe time to try it again.


#3

webCoRE will encode the request for you, just make a boolean variable named on and pass that variable as the request data. There is currently no way to provide a custom request body (as attempted with Local) but your example will work fine with variables for each of the keys in the object that you need to send.


#4

Thanks so much for the input on this. @ipaterson Eventually worked out what you were suggesting I try. See new image below with additional data included in the “body”. This is now working as expected resulting in smooth fades across groups of lights. Hopefully this will prove useful to others who are experiencing jumpy fades with Hue. Thanks again


#5

Hi, I’m trying to get this stood up on my system and I’m not understanding who’s making the request. When you make a request to https://webcore.co how does it get to Philips via their API?


#6

The real url is just being anonymized for privacy. It’s usually the actual local IP address of your hue hub.


#7

Thanks so much for the clarification, got it all sorted out. However I’m curious how your are sending xy values for color?


#8

Been searching for the better part of an hour. Was wondering if you ever got this resolved as it now perplexes me.


#9

I also came across this and looking to implement it but I’m a little confused. What properties can I pass in the command? “transitiontime” seems self explanatory but what is “50”? Is that milliseconds? seconds? minutes? What is “bri”? Brightness? What is the range of values here? I guess not 1-100% if “240” can be used. What about color? How do I tell it which lights?

It would be helpful to everyone if there was some better documentation on this.


#10

You probably need to check out the hue API for that.


#11

The Philips Hue API documentation is very well put together and available online. I think you need to register for a developers account (no big deal).

On the xy issue, I went with putting all the settings in a string variable and passed it back as application/json data