Home Automation gone bad!

Discuss Python scripts here.
Turribeach
Posts: 432
Joined: Fri Feb 06, 2015 4:25 pm
Location: London, UK

Home Automation gone bad!

Post by Turribeach »

Hi,

The other night a friend of my daughter came over to watch a movie. He is a 5 year old boy. As soon as he heard me switching lights on/off via Alexa with the Alexa Hue Bridge he started to tell Alexa to switch lights on and off and it wasn't funny anymore :? . So I am looking for a way to prevent this in the future. I have coded all my light triggers to use a conditional override variable so that I can disable light triggers individually per light or for all lights. I can then toggle these override variables or the "all lights override" variable in a control page to prevent light triggers from executing. But since the Alexa Hue Bridge toggles the device directly it's bypassing the override variables I created. I could create an Action Group for each light, where I could evaluate my light override variable, and then define a virtual device that I can link in the Alexa Hue Bridge plugin but this seems like a lot of work. I looked at disabling the Alexa Hue Bridge plugin but it not possible (see this thread since you can only restart() plugins. Any suggestions on how to temporarily disable the Alexa Hue Bridge plugin?

Thanks!
howartp
Posts: 4559
Joined: Thu Jan 09, 2014 4:43 pm
Location: West Yorkshire, UK

Re: Home Automation gone bad!

Post by howartp »

Plug Alexa into an Indigo-controlled plug socket?


Sent from my iPhone using Tapatalk Pro
autolog
Posts: 4000
Joined: Tue Sep 10, 2013 3:07 am
Location: West Sussex, UK [GMT aka UTC]
Contact:

Re: Home Automation gone bad!

Post by autolog »

Just disable the Alexa-Hue Bridge device (Comm Enabled column in main UI). :)

That will work, but coincidently, I spotted a bug in the code related to disabled devices :| so you might get an error thrown in the log which you can ignore.
I will release a fix for this in a day or so. :)
Turribeach
Posts: 432
Joined: Fri Feb 06, 2015 4:25 pm
Location: London, UK

Re: Home Automation gone bad!

Post by Turribeach »

Thanks autolog, that's exactly what I wanted. I created a new variable Alexa_Hue_Bridge_Enabled and used a script on a trigger for value change. I added the variable on a control page as on/off button and presto! I can disable the Alexa integration with the touch of a button. Below is the script in case it helps anyone else:

Code: Select all

mydev = indigo.devices[86329839] # "Alexa-Hue Bridge 1"
myvar = indigo.variables[756081712] # "Alexa_Hue_Bridge_Enabled"

if myvar.value == "true":
    indigo.device.enable(mydev, value = True)
else:
    indigo.device.enable(mydev, value = False)

PS: Tested few times and got no errors in the log.
Turribeach
Posts: 432
Joined: Fri Feb 06, 2015 4:25 pm
Location: London, UK

Re: Home Automation gone bad!

Post by Turribeach »

Actually I spoke too soon. When I disable the Alexa Hue Device it indeed prevents Alexa from interacting with devices but when I try to enable it again then Alexa still says the device it’s unresponsive. Is this the bug you will talking about? A plug-in reload seems to solve the problem.
User avatar
durosity
Posts: 4392
Joined: Thu May 10, 2012 3:21 pm
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: Home Automation gone bad!

Post by durosity »

There isn’t any voice learning function with Alexa is there? I was hoping amazon (and google) would add something like that after the Burger King debacle earlier in the year. That’d be the ultimate solution to stop unauthorised users hijacking your system!
Computer says no.
Shutter
Posts: 345
Joined: Fri Mar 07, 2014 7:11 am
Location: London, UK

Re: Home Automation gone bad!

Post by Shutter »

There's this, but not in the UK yet.
User avatar
Different Computers
Posts: 2609
Joined: Sat Jan 02, 2016 10:07 am
Location: East Coast
Contact:

Re: Home Automation gone bad!

Post by Different Computers »

Turribeach wrote:I created a new variable Alexa_Hue_Bridge_Enabled and used a script on a trigger for value change
For an "automatic" method of triggering this, just use a Fibaro Button, labeled "DO NOT TOUCH" and leave it out where kids can find it.
Sonoma on a Mac Mini M1 running Airfoil Pro, Bond Home, Camect, Roku Network Remote, Hue Lights, DomoPad, Adapters, Home Assistant Agent, HomeKitLinkSiri, EPS Smart Dimmer, Fantastic Weather, Nanoleaf, LED Simple Effects, Grafana. UnifiAP
autolog
Posts: 4000
Joined: Tue Sep 10, 2013 3:07 am
Location: West Sussex, UK [GMT aka UTC]
Contact:

Re: Home Automation gone bad!

Post by autolog »

Turribeach wrote:Actually I spoke too soon. When I disable the Alexa Hue Device it indeed prevents Alexa from interacting with devices but when I try to enable it again then Alexa still says the device it’s unresponsive. Is this the bug you will talking about? A plug-in reload seems to solve the problem.
It wasn't, so I will take a look at it and sort it out. :wink:

Thanks for the feedback. :)
howartp
Posts: 4559
Joined: Thu Jan 09, 2014 4:43 pm
Location: West Yorkshire, UK

Re: Home Automation gone bad!

Post by howartp »

Different Computers wrote:
Turribeach wrote:I created a new variable Alexa_Hue_Bridge_Enabled and used a script on a trigger for value change
For an "automatic" method of triggering this, just use a Fibaro Button, labeled "DO NOT TOUCH" and leave it out where kids can find it.
That’s the kind of thing I was expecting Durosity’s comment to be when I saw his notification pop up earlier.


Sent from my iPhone using Tapatalk Pro
Turribeach
Posts: 432
Joined: Fri Feb 06, 2015 4:25 pm
Location: London, UK

Re: Home Automation gone bad!

Post by Turribeach »

Shutter wrote:There's this, but not in the UK yet.
It sounds there are still far from what I want, which is to limit Alexa's skills by user profile but I think they will eventually get there. Multiple profiles is also useful, otherwise calendar, tasks, music, etc gets all mixed up. Clearly they are going to get to the point where they have so much context on who's talking that they can figure things out automatically.
User avatar
DaveL17
Posts: 6881
Joined: Tue Aug 20, 2013 11:02 am
Location: Chicago, IL, USA
Contact:

Re: Home Automation gone bad!

Post by DaveL17 »

Different Computers wrote:For an "automatic" method of triggering this, just use a Fibaro Button, labeled "DO NOT TOUCH" and leave it out where kids can find it.
In the spirit of full disclosure, this would work on me, too.


Sent from my iPhone using Tapatalk
I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]
User avatar
durosity
Posts: 4392
Joined: Thu May 10, 2012 3:21 pm
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: Home Automation gone bad!

Post by durosity »

howartp wrote: That’s the kind of thing I was expecting Durosity’s comment to be when I saw his notification pop up earlier.
I occasionally suggest sensible ideas ;)
Computer says no.
noel1983
Posts: 446
Joined: Fri Oct 17, 2014 1:35 pm

Re: Home Automation gone bad!

Post by noel1983 »

I’d take a much simpler approach. Put the child outside!


Sent from my iPhone using Tapatalk
Turribeach
Posts: 432
Joined: Fri Feb 06, 2015 4:25 pm
Location: London, UK

Re: Home Automation gone bad!

Post by Turribeach »

noel1983 wrote:I’d take a much simpler approach. Put the child outside!
Thanks Noel but I don’t think that Alexa is waterproof or likes being outside.
Post Reply

Return to “Python Scripting”