So I've got the control page linking working....
indigo or indigodomo or indigocontrol://controlpage/controlpagename
What is it for the device tab, variable tab, can you go a layer deeper into a device folder?
https://username:password@username.indigodomo.net/controlpagename=_internal_devices_&uiName=Climate&asList=1&folderFilter=488543452&useJS=True
mundmc wrote:Can you post a screenshot of something that worked? This sounds really useful, and I literally just read the emoji discovery post.
mundmc wrote:That your wife actually uses any implementation other than yelling at Alexa is impressive
mundmc wrote:This is a really awesome implementation. Thank you for sharing it.
siclark wrote:Alexa doesn’t even listen to her when she asks for a timer.
siclark wrote:I took tiny baby steps. Created an action with a script to check one category; lights. Once I got that working, I could duplicate the action and substitute all the light devices for fan devices, etc. Eventually, stitch all the scripts together.My head hurts thinking about how you got this working.
theMessage = ""
isLightsOn = True
if indigo.devices[937130354].onState == True:
isLightsOn = True
theMessage = theMessage + "Bill's Office, "
if indigo.devices[65936415].onState == True:
isLightsOn = True
theMessage = theMessage + "Vikki's Office, "
if indigo.devices[1192336408].onState == True:
isLightsOn = True
theMessage = theMessage + "Garage, "
if indigo.devices[162659895].onState == True:
isLightsOn = True
theMessage = theMessage + "Living Room, "
if indigo.devices[1053474190].onState == True:
isLightsOn = True
theMessage = theMessage + "Dining Room, "
if indigo.devices[1006557169].onState == True:
isLightsOn = True
theMessage = theMessage + "Front Hallway, "
if indigo.devices[1486920762].onState == True:
isLightsOn = True
theMessage = theMessage + "Breakfast Table, "
if indigo.devices[55601007].onState == True:
isLightsOn = True
theMessage = theMessage + "Pantry, "
if indigo.devices[1051393994].onState == True:
isLightsOn = True
theMessage = theMessage + "Kitchen, "
if indigo.devices[675197519].onState == True:
isLightsOn = True
theMessage = theMessage + "Kid Rooms, "
if indigo.devices[134858586].onState == True:
isLightsOn = True
theMessage = theMessage + "Back Yard, "
if indigo.devices[993557412].onState == True:
isLightsOn = True
theMessage = theMessage + "Front Yard, "
else:
isLightsOn = False
if isLightsOn == False:
theMessage = "All Lights Are Off"
indigo.server.log(theMessage)
indigo.actionGroup.execute(948838716) # Closeout Script
if isLightsOn == True:
theMessage = "Lights are still on. Check " + theMessage
indigo.server.log(theMessage)
indigo.variable.updateValue(1862150451, theMessage) # send_alexa_variable
if indigo.devices[649246778].onState == False:
sMessage = sMessage + "front door lock, "
if indigo.devices[375771754].states['onOffState'] is True:
sMessage = sMessage + "Right Garage Door, "
whmoorejr wrote:I don't know enough about python to say which is correct, if that is the best way.... but its working so I try not to poke it.
if indigo.devices[993557412].onState == True:
isLightsOn = True
theMessage = theMessage + "Front Yard, "
else:
isLightsOn = False
if isLightsOn == False:
theMessage = "All Lights Are Off"
indigo.server.log(theMessage)
indigo.actionGroup.execute(948838716) # Closeout Script
else:
theMessage = "Lights are still on. Check " + theMessage
indigo.server.log(theMessage)
indigo.variable.updateValue(1862150451, theMessage) # send_alexa_variable
if isLightsOn:
theMessage = "Lights are still on. Check " + theMessage
indigo.server.log(theMessage)
indigo.variable.updateValue(1862150451, theMessage) # send_alexa_variable
else:
theMessage = "All Lights Are Off"
indigo.server.log(theMessage)
indigo.actionGroup.execute(948838716) # Closeout Script
jay (support) wrote:You have a little buglet: your script will only set isLightsOn to False when the last if condition is False:
lCheckMessage = ""
allLightsOff = False
if indigo.devices[937130354].onState is False \
and indigo.devices[1633673098].onState is False \
and indigo.devices[571187066].onState is False:
allLightsOff = True
if indigo.devices[937130354].onState is True:
lCheckMessage = lCheckMessage + "Bill's Office, "
if indigo.devices[571187066].onState is True:
lCheckMessage = lCheckMessage + "Bex's Room, "
if allLightsOff == True:
lCheckMessage = "Inside Lights Are Off."
emojiLights = emojiDash
if allLightsOff == False:
lCheckMessage = "Inside Lights Are On: " + lCheckMessage
emojiLights = emojiCouch
emojiDash = "➖"
emojiCouch = "🛋"
lCheckMessage = "Inside Lights Are On: "
# Start from the assumption that all lights are off until proven otherwise
allLightsOff = True
if indigo.devices[937130354].onState is True:
# Found one that's on, add to the message and set allLightsOff to False
lCheckMessage += "Bill's Office, "
allLightsOff = False
if indigo.devices[571187066].onState is True:
lCheckMessage += "Bex's Room, "
allLightsOff = False
#
# Repeat for each one
#
if allLightsOff:
# All lights are off, message appropriately
lCheckMessage = "Inside Lights Are Off."
emojiLights = emojiDash
else:
# At least one light is on, but you've been building the string of lights that are on, so no more to do
emojiLights = emojiCouch
jay (support) wrote:Here's my version:...
whmoorejr wrote:If you don't specify ==True or ==False, it only returnsTrue?
if allLightsOff:
# This code will execute if allLightsOff is True
else:
# This code will execute if it's False
if not allLightsOff:
# This code will execute if allLightsOff is False
else:
# This code will execute if it's True
Users browsing this forum: No registered users and 3 guests