Keyboard Shortcuts
ctrl + shift + ? :
Show all keyboard shortcuts
ctrl + g :
Navigate to a group
ctrl + shift + f :
Find
ctrl + / :
Quick actions
esc to dismiss
Likes
Search
Controlling Alexa (Amazon) via JMRI
I would like to create some timed routines in JMRI that sends commands to Alexa to run various routines. For example, at start of session, I can start the fastclock, and then at appropriate times, it will trigger Alexa.
?
My plan to do this is using "Voice Monkey" as the translator. VM allows you to send a command via a web link, which then will trigger Alexa.
?
So what I need to do is get JMRI to run a weblink in the background (not open a web browser). I had asked this question a few years ago and apparently this was coming, but not available yet.
?
Is there a way within JMRI that at a certain time on the Fast Clock, I can send a trigger using a weblink () but that will not open a browser, it will just happen in the background?
?
Thanks
--
Heath @ Human[c]ity |
This is what ChatGPT suggested, I do not know if this is accurate or if it will work. It is supposedly Python, not Jython, so not sure if it would run within JMRI.
?
import java.net.HttpURLConnection
import java.net.URL def trigger_url(url):
? ? try: ? ? ? ? connection = java.net.URL(url).openConnection() ? ? ? ? connection.setRequestMethod("GET") ? ? ? ? connection.setDoOutput(False) ? ? ? ? connection.connect() ? ? ? ? response_code = connection.getResponseCode() ? ? ? ? connection.disconnect() ? ? ? ? return response_code ? ? except Exception as e: ? ? ? ? print("Error triggering URL:", e) ? ? ? ? return None # URL to be triggered in the background
url = "https://api-v2.voicemonkey.io/trigger(url) --
Heath @ Human[c]ity |
You need to add a closing “ to the last line.
That just defines a routine to do the communication. To invoke it trigger_url(url) will do the operation. But that URL (last line) doesn’t look right to me. Bob On Mar 16, 2025, at 12:14?PM, Human[c]ity Junction via groups.io <heath@...> wrote:— Bob Jacobsen rgj1927@... |
Heath,
?
I was setting up Alexa to operate my layout. Came to find out that you have to route everything to "her server". It was
configured where I could see everything........Next thing I know I get a bandwidth utilization "Ding!!!" "You have used 5 GB"
It was only a day or so. 5gb doing nothing........She went back in the box and that project was done......
?
Inobu |
开云体育Heath You are looking for the LogixNG action "Web request". Daniel
On 2025-03-16 17:10, Human[c]ity
Junction wrote:
|
On Mon, Mar 17, 2025 at 12:48 AM, danielb987 wrote:
?
This looks like exactly what I need.
?
To answer Inobu One, I am using a service called Voice Monkey, so they are managing the API, I am not setting up a direct connection. So yes, everytime I make a web request to the Voice Monkey server, that information will go to "her", but only what I send through Voice Monkey.? Voice Monkey is kinda like IFTTT or Zapier for Alexa.
?
Bob, I did truncate the web link to remove the token and the device ID, so you are correct that the URL is not complete. Hence why I missed the closing ". It seems like the LogixNG solution will be simpler for me, maybe, so I will try that first.
?
Thanks everyone!!
--
Heath @ Human[c]ity |
to navigate to use esc to dismiss