I'm creating an action group where various lights flash when a condidtion is triggered. I would like to have the lights return to the state they were in prior to the trigger. How can I accomplish this?
Thanks in advance for any help.
if indigo.variables[123356].getbool():
indigo.devices[123456].turnOn()
else:
indigo.devices[123456].turnOff()
if indigo.variables[123356].getvalue(bool):
indigo.device.turnOn(123456)
else:
indigo.device.turnOff(123456)
Error failed to execute script because script could not be compiled
if indigo.variables[TARDIS Lamp].getvalue(bool):
indigo.device.turnOn(TARDIS Lamp)
else:
indigo.device.turnOff(TARDIS Lamp)
If indigo.variables["TARDIS Lamp"].getvalue(bool):
Hue Lights Error Error in plugin execution runConcurrentThread:
Traceback (most recent call last):
File "plugin.py", line 660, in runConcurrentThread
File "plugin.py", line 2106, in getBulbStatus
<type 'exceptions.StandardError'>: ServerCommunicationError -- timeout waiting for response
Hue Lights Error plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
if indigo.variables["TARDIS Lamp"].getvalue(bool):
indigo.device.turnOn("TARDIS Lamp")
else:
indigo.device.turnOff("TARDIS Lamp")
- Code: Select all
Hue Lights Error Error in plugin execution runConcurrentThread:
Traceback (most recent call last):
File "plugin.py", line 660, in runConcurrentThread
File "plugin.py", line 2106, in getBulbStatus
<type 'exceptions.StandardError'>: ServerCommunicationError -- timeout waiting for response
Hue Lights Error plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
nsheldon wrote:The Hue Lights error you're seeing...
- Code: Select all
Hue Lights Error Error in plugin execution runConcurrentThread:
Traceback (most recent call last):
File "plugin.py", line 660, in runConcurrentThread
File "plugin.py", line 2106, in getBulbStatus
<type 'exceptions.StandardError'>: ServerCommunicationError -- timeout waiting for response
Hue Lights Error plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
has nothing to do with your script (though, as Jay pointed out, the script won't work in t's current state). The error above indicates that the Hue Lights plugin is unable to reach your Hue hub. Make sure that you have the correct IP address in the Hue Lights plugin configuration window (Plugins menu -> Hue Lights -> Configure). If the IP address does not exactly match the IP address of your Hue hub, the plugin cannot communicate with the hub. It's a good idea to configure your router to always give the Hue hub the same IP address so the IP address doesn't change every time you restart the hub or the router (thus causing the plugin to loose the connection until the new IP is configured in the Configuration window). The way to do this varies from router to router, but it's sometimes called an IP address reservation. Alternatively (and possibly more easily), configure the Hue hub to not use DHCP and set the IP address manually. This can be done in the Hue app on your iOS device.
Once the plugin is communicating with the Hub, you don't need to do any scripting to make a Hue light flash. You've already got the right idea by using the "Long Alert" action. The "Long Alert" action will cause the Hue bulb or other Hue controlled light to blink about 1 time per second for about 15 seconds before automatically returning to the previous state. The "Short Alert" blinks the light just once before returning it to the previous state. You don't need scripts to activate either Long Alert or Short Alert actions.
Script Error embedded script: 'key name 998140627 not found in database'
Script Error Exception Traceback (most recent call shown last):
embedded script, line 1, at top level
KeyError: 'key name 998140627 not found in database'
if indigo.variables[indigo.devices[998140627] # "TARDIS Lamp"].getvalue(bool):
indigo.device.turnOn(indigo.devices[998140627] # "TARDIS Lamp")
else:
indigo.device.turnOff(indigo.devices[998140627] # "TARDIS Lamp")
Users browsing this forum: No registered users and 1 guest