Jump to content
View in the app

A better way to browse. Learn more.

Universal Devices Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Switch triggering a state variable to activate alexa

Featured Replies

Hi All.

I've setup a physical insteon switch to trigger a state variable change.

I've then exposed that variable to alexa

Activating the switch successfully changes the state variable, and will sometimes run the alexa routine.

It's very inconsistent and I can't quite tell where the failure is.

Is this just a very slow configuration or should i be expecting a quick enough of a response such that switch is activated and light comes on?

Any suggestions?

Thanks

PB


I have had that problem as well.. usually it works itself out with 24-48 hours.

Currently all of mine are working well, but I do know when I set one up, it can be fluky for a while.

I have had problems on and off with Alexa routines triggering also.

This has happened a few times over the years. Alexa app shows the input points changing , the routines fully working when triggered manually but they just wouldn't trigger.

After complaining each time, and Amazon denying any problems, and advising to contact your app writer, it would suddenly start working again, once after about a month.

Make sure the variable comes back to an Off value after being "On".

The other thing to be aware when testing is that the variable's value can't change too quick. If for example it becomes on, then off then on again within just a few seconds, it will be seen as a single "On".

Think of a motion sensor. When it detects movement, it stays in a motion state detected state for a few seconds then comes back to no motion detected after a set timeout. This works the same way. You can change your variable to On then Off quickly, but you can't turn it on again too quickly as it will be considered the same motion (or the same contact).

  • Author

@bmercier Thanks for the insight.

I originally had it setup in this way, but the light continued to turn off seconds after turning on.

Maybe an issue with my program?

  • Author

@dbwarner5 Well i'll be. Without making any changes including leaving the variable in the changed state with each trigger, the routine has started working.

Thanks everyone for the great insights.

On 11/4/2025 at 10:53 AM, PB11 said:

@dbwarner5 Well i'll be. Without making any changes including leaving the variable in the changed state with each trigger, the routine has started working.

Thanks everyone for the great insights.

Weird right? But that has been my experience since the beginning. So I now just set up the way I know works, and then just chill about it for 24-48 hours and it usually works as expected.

I have had perfect success using a webhook setup and an Alexa plugin. I don't recall that it has ever failed. There is a skill for Alexa and then you create webhooks on here: https://trigger.esp8266-server.de/

You use a network resource to send the webhook.

image.png

EDIT: I just went to that website and, if I don't log in, the creator says it is broken, but it isn't, at least for me. I use it everyday and I even added more webhooks to it just a month or two ago. Not sure if it is possible to currently add it to your Alexa or not, but for me with it already there it works great and I am able to keep adding more. I have about 20 as is.

EDIT 2: It looks like Alexa still has the skill for you to add. You do have to use the primary amazon account and once you add your webhooks, you tell Alexa to discover devices and then the webhook shows up as a device that you can use to trigger whatever you want on an Alexa routine. At that point, you basically just send the url to the internet from a network resource or just put it into a web browser and usually in less than 1 second it is doing its thing.

Edited by apostolakisl

5 hours ago, apostolakisl said:

I have had perfect success using a webhook setup and an Alexa plugin. I don't recall that it has ever failed. There is a skill for Alexa and then you create webhooks on here: https://trigger.esp8266-server.de/

You use a network resource to send the webhook.

image.png

EDIT: I just went to that website and, if I don't log in, the creator says it is broken, but it isn't, at least for me. I use it everyday and I even added more webhooks to it just a month or two ago. Not sure if it is possible to currently add it to your Alexa or not, but for me with it already there it works great and I am able to keep adding more. I have about 20 as is.

EDIT 2: It looks like Alexa still has the skill for you to add. You do have to use the primary amazon account and once you add your webhooks, you tell Alexa to discover devices and then the webhook shows up as a device that you can use to trigger whatever you want on an Alexa routine. At that point, you basically just send the url to the internet from a network resource or just put it into a web browser and usually in less than 1 second it is doing its thing.

Nice!

KInd of odd the semaphore has to go to Germany and back. LOL Wow!

Here is the variable reset program I use to eliminate two of the three lines required to send routine triggers in my Alexa speakers.

It could be used for anything but the variable names are significant for my speech routines.

To use just set the appropriate variable to $cTrue (=1)


I didn't create it into multiple programs. Instead I put them all into one lump and it works just fine. Note: spare variabes spsaces left for future epansion. It happens.


Reset sSay variables - [ID 006F][Parent 0002][Run At Startup]
If     
        // [Run at Startup] enabled
 
        $sSay.motionOutsideDoor is not 0
     Or $sSay.occupancyTimerExpiring is not 0
     Or $sSay.securityViolated is not 0
     Or $sSay.welcomeHome is not 0
     Or $sSay.systemArming is not 0
     Or $sSay.systemDisarmed is not 0
     Or $sSay.goodBye is not 0
     Or $sSay.turnOnLights is not 0
     Or $sSay.systemArmed is not 0
     Or $sz_40 is not 0
     Or $sSay.blindLowBatt is not 0
     Or $sSay.blindJammed is not 0
     Or $sz_43 is not 0
     Or $sz_44 is not 0
     Or $sz_45 is not 0
     Or $sz_46 is not 0
     Or $sz_47 is not 0
     Or $sz_48 is not 0
 
Then
        Wait  10 seconds
        $sSay.motionOutsideDoor  = 0
        $sSay.occupancyTimerExpiring  = 0
        $sSay.securityViolated  = 0
        $sSay.welcomeHome  = 0
        $sSay.systemArming  = 0
        $sSay.systemDisarmed  = 0
        $sSay.goodBye  = 0
        $sSay.turnOnLights  = 0
        $sSay.systemArmed  = 0
        $sz_40  = 0
        $sSay.blindLowBatt  = 0
        $sSay.blindJammed  = 0
        $sz_43  = 0
        $sz_44  = 0
        $sz_45  = 0
        $sz_46  = 0
        $sz_47  = 0
        $sz_48  = 0
Else
   - No Actions - (To add one, press 'Action')
 

Edited by larryllix

On 11/6/2025 at 5:03 PM, larryllix said:

Nice!

KInd of odd the semaphore has to go to Germany and back. LOL Wow!

Funny that I push an Insteon button on a wall 10 feet from a ceiling fan and the fan turns on, but the signal first goes to Germany, then to an Amazon server (wherever that is), then to the fan company server (wherever that is), and then back to my house. And it works every time. How many thousands of miles do you suppose?

Edit. And if I used UD mobile logged in via portal, you would add a new first step where it goes to UD server and then back to my house ISY.

Edited by apostolakisl

On 11/9/2025 at 9:55 AM, apostolakisl said:

Funny that I push an Insteon button on a wall 10 feet from a ceiling fan and the fan turns on, but the signal first goes to Germany, then to an Amazon server (wherever that is), then to the fan company server (wherever that is), and then back to my house. And it works every time. How many thousands of miles do you suppose?

Edit. And if I used UD mobile logged in via portal, you would add a new first step where it goes to UD server and then back to my house ISY.

Do we have fibre optics under the Atlantic yet?
I would think most of the delays would be in the electronics / servers. Just Wow!

14 hours ago, larryllix said:

Do we have fibre optics under the Atlantic yet?
I would think most of the delays would be in the electronics / servers. Just Wow!

Yes, transatlantic fiber is how Germany is connected to the US. I agree, the bulk of the latency is almost certainly rooted in server response not distance. An interesting related fact is that the speed of light in fiber is slower than through a vacuum (or air). This can add a few milliseconds of latency for long haul transmissions when comparing terrestrial fiber to laser or rf. SpaceX is marketing using their satellites to laser relay satellite to satellite across the globe for extremely time sensitive transmissions. Most notably traders doing arbitrage between. say, New York and Hong Kong. Apparently they are willing to pay $millions per month for the service. Even though it has to go through maybe 10 or 15 hops and doesn't take a straight line, it still beats the terrestrial fiber.

9 hours ago, apostolakisl said:

Yes, transatlantic fiber is how Germany is connected to the US. I agree, the bulk of the latency is almost certainly rooted in server response not distance. An interesting related fact is that the speed of light in fiber is slower than through a vacuum (or air). This can add a few milliseconds of latency for long haul transmissions when comparing terrestrial fiber to laser or rf. SpaceX is marketing using their satellites to laser relay satellite to satellite across the globe for extremely time sensitive transmissions. Most notably traders doing arbitrage between. say, New York and Hong Kong. Apparently they are willing to pay $millions per month for the service. Even though it has to go through maybe 10 or 15 hops and doesn't take a straight line, it still beats the terrestrial fiber.

Our longest fibre transmission was about 35 km and needed boosting. Of course fibre optics may have advanced in the last 25 years but much longer distances were not very possible, expensive, and dangerous due to the high power needed for the length.

I wonder how they get transmission that far.

  • 1 month later...

I tried for the first time using a variable to trigger an Alexa Routine.

It doesn't work.

I set it up 3 days ago. The variable is set as a contact closure and is set to be "closed" at a value of 1. Alexa discovered the "contact" just fine and I was able to put it into a routine. But nothing happens. I set it to 1, nothing, I set it to 0, nothing. I have tried periodically going back and forth, leaving it in one state or the other for a while (hours) and nothing.

I have not updated to Alexa+

I don't know about this. Seems like everyone has issues with it. UD either needs to fix whatever the issue is or remove the feature. A flaky feature is far worse than no feature.

I also just tried adding a variable as a "motion sensor" with 2 as motion, still no triggering of a routine.

4 hours ago, apostolakisl said:

I also just tried adding a variable as a "motion sensor"

"Also"? Besides motion sensor, what other type did you try? IIRC, variable MUST be set as a sensor for this to trigger an Alexa routine. I think my variables are all imported to Alexa as motion sensors and they trigger routines quite well. I don't recall if it is critical, but I use values of 0 and 1. You might try this to see if it solves your problem.

1 hour ago, oberkc said:

"Also"? Besides motion sensor, what other type did you try? IIRC, variable MUST be set as a sensor for this to trigger an Alexa routine. I think my variables are all imported to Alexa as motion sensors and they trigger routines quite well. I don't recall if it is critical, but I use values of 0 and 1. You might try this to see if it solves your problem.

Contact closure as mentioned in opening post. And I used 0,1 for that. Contact closure was what @bmercier had suggested in a different thread. I believe the two are equivalent. The both don't work equally for me. I have also switched out the action taken between Alexa actions and Insteon (via isy) actions. Checking the Alexa activity history indicates the routine is not running when triggered by isy variables.

50 minutes ago, apostolakisl said:

Contact closure as mentioned in opening post. And I used 0,1 for that. Contact closure was what @bmercier had suggested in a different thread. I believe the two are equivalent. The both don't work equally for me. I have also switched out the action taken between Alexa actions and Insteon (via isy) actions. Checking the Alexa activity history indicates the routine is not running when triggered by isy variables.

You need to monitor the "device" in Alexa to see if that is triggering. The most common problem is with Alexa because it will see the trigger but the routine does not run in which case sometimes it starts working on it's own in a couple of days or people have contacted Amazon to get it resolved.

42 minutes ago, tazman said:

You need to monitor the "device" in Alexa to see if that is triggering. The most common problem is with Alexa because it will see the trigger but the routine does not run in which case sometimes it starts working on it's own in a couple of days or people have contacted Amazon to get it resolved.

I looked at both the variables I added to Alexa as a contact closure and motion sensor. Changing the value of the variables in ISY is not changing the state Alexa reports. Contact closure for example always reports "closed" in Alexa whether the value is 1or 0. And motion variable always says no motion detected. And both say "device unresponsive" in a banner across the top.

Screen shot

Screenshot_20251228_092748_Amazon Alexa.jpg

EDIT: Now it says "server unresponsive" in the banner.

Edited by apostolakisl

Then it definitely seems to be a problem between the portal and Amazon servers. If you have other devices working then maybe post a screen shot of your portal setup of the variable. Are you using a state variable? I never used an integer and don't know if they work.

1 hour ago, tazman said:

Then it definitely seems to be a problem between the portal and Amazon servers. If you have other devices working then maybe post a screen shot of your portal setup of the variable. Are you using a state variable? I never used an integer and don't know if they work.

Alexa and ISY are communicating fine for all of my voice commands to Alexa.

I can't imagine that my configuration in the portal is wrong. Not a whole lot to do wrong. I chose "2" as the detected value, but I also tried 1.

image.png

image.png

@apostolakisl I can imagine your frustration. I have motion sensors, scene and light as shown below. They all work as expected.

JH

image.png

Have you tried to to delete the variable and start over completely? Be sure you are also deleting in Alexa any old devices/variables when you do that. This may also be causing Alexa some confusion.

  • Author

Hi @apostolakisl

I wasn't able to get a motion sensor to work, though i have to say I wasn't all that patient when attempting to use it.

I was able to get the Contact sensor to work. My statevariable is setup with Init Value as 0 which also seems to set default to 0

In the UD Amazon Echo Device list, 1 which is closed is equal to "on" in my alexa app, and of course 0 (open) is off.

I messed around with mine for 2 days, and it wasn't until i left it for 24 hours that it seemed to respond reliably

I have since setup 2 other state variables for groups of alexa devices and they responded (or atleast i tested sooner) within just a few hours.

On the Alexa app side, though there is probably a more streamlined approach, i created an On (closed, value of 1) routine, and an off routine for each state variable.

Also, i did not need to return my variable value to off. I leave it in the activated state until the next switch activation.

Have you confirmed that your variables change when you activate your switch?

Edited by PB11

  • Author

Ppl have told me how share your programs to this forum other than cut and paste but i can't recall.

Can anyone enlighten me?

I tried to make this work months ago and never got the alexa spoken to work

There is a PG3X node server called "Virtual Button" that accomplished it for me

Create an account or sign in to comment

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.