Open ultima-originem opened 9 years ago
Hey ot3, I've create a FLASK application for my Pi and I've been running it for a couple of weeks now. No issues whatsover. Didn't play with transitiontime yet, but other than that it works great from a Pi. Is yours connected via cable or wifi ? This might be part of the issue. Maybe try running it from a laptop or desktop and see if the errors persist.
@ot3 I'm not entirely sure the bridge was ignoring the last two of your requests. I would like to know what the initial state of your light is before you executed these commands.
The bridge will set brightness as low as possible when transitiontime
is provided and the state is currently off and the new state is on. So, when you specify {'on': True, 'bri': 20, 'transitiontime': 50}
you are telling the bridge to do three things:
Your bridge is now trying to adjust the brightness from 1 to 20 over 5 seconds, a very subtle effect.
The second command comes in while the first command is still executing. The bridge has two choices to make, ignore the request or abandon the previous request. But, you are telling the bridge to adjust from whatever the current brightness is (somewhere between 1 and 20) to 200 over a duration of 10 seconds. The bridge abandon's the previous request and starts to increase the brightness to 200. The speed depends on the initial brightness, but it will still be very slow.
The third command now is telling the bridge to turn off the light and take 20 seconds to do it. The bridge abandons the previous request in progress and transitions the brightness from wherever it is between 1 and 200 back to 1, then off.
You may want to try a more obvious approach to testing the transitiontime
, your commands as listed may be too subtle to notice.
You may also want to enable logging
and make sure that phue is actually posting your request to the bridge.
Thanks for your suggestion. I haven't gotten back to the code since I posted my question so will have to re-familiarize myself again but your suggestion makes sense.
I'm trying to use phue from a Raspberry Pi but can't get my script to work as designed. I've stripped my program to execute just a few lines [after providing credentials, etc.] to illustrate the problem:
The effect on the lamp is described in the comments. Output on the screen is as follows:
A significant part of the code is ignored or at least has no visible effect on the lamp. To be absolutely certain that the bridge doesn't get too many commands in a short time, I've used a 1 second delay between issuing commands.
I've tried many different combinations of commands to single out the problem of which the code shown is the simplest. Is it my flawed understanding of phue or something else? Any help will be appreciated.