Integration with Alexa

610 views
Skip to first unread message

Matt Sargent

unread,
Dec 15, 2016, 11:24:21 AM12/15/16
to weewx-user
Hi all,

I am writing an Alexa skill that would be able to interface to Weewx. Pretty simple for the current data and such, but I am hoping to add the ability to query past weather conditions. Has anyone developed an API of any sort that allows you to query data from the weather station? 

Matt

Andrew Milner

unread,
Dec 15, 2016, 11:47:15 AM12/15/16
to weewx-user
Most stations have only limited historical data storage, and weewx moves all the historical data from the ststion to the archive for long term storage.  The drivers within weewx all 'query' the stations to obtain the data which is processed by weewx.

The past data is held in either SQLite or MySQL database - so any standard sql select statements will retrieve the data from the archive or daily summary tables.  In the case of MySQL (don't know about SQLite) you just need to enable remote access to the database.  No interface to weewx is required to retrieve the historical data via queries. 

I suspect I have misunderstood exactly what you are trying to do and hoping to achieve!!  Sounds as though you need a simple(ish) interface program running which will effectively build and issue sql select statements on the database and return the result set.

Thomas Keffer

unread,
Dec 15, 2016, 4:08:18 PM12/15/16
to weewx-user
Not sure what you mean by "API." As Andrew suggests, you can always query the database directly, using SQL statements.

But, if you're looking for something more like a RESTful API, then no, there's nothing like that that I'm aware of. Wouldn't be too hard to put together.

-tk

--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

vince

unread,
Dec 15, 2016, 5:36:50 PM12/15/16
to weewx-user
On Thursday, December 15, 2016 at 8:24:21 AM UTC-8, Matt Sargent wrote:
I am writing an Alexa skill that would be able to interface to Weewx. Pretty simple for the current data and such, but I am hoping to add the ability to query past weather conditions. Has anyone developed an API of any sort that allows you to query data from the weather station? 



oooohhhh - just ordered an Echo Dot a couple hours ago, I'd be interested in this for sure.   Don't know how much I can do before it arrives Jan-3rd but email me if you want to share code etc. 

Bill

unread,
Dec 28, 2016, 12:16:29 AM12/28/16
to weewx...@googlegroups.com
Well I just got an Echo and I like it and am keen on getting my weather data.

I did some poking about on the dev site and it looks like the easiest thing
would be to grab the RSS feed which is already being generated. This has the
advantage the data is formatted and the units supplied, and no SQL is needed.

I looks like there are other news readers that work this way and there is an
example that would be a nice starting point. I think it might work with the
existing RSS so you might not even need to touch Weewx:

https://github.com/alexa/skill-sample-nodejs-feed

An alternative would be to do a Flash Feed, which is how the other 'news'
works. This looks like it might need a new XML structure built, but you
could use the existing RSS as a sample, here is the doc:

https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/understanding-the-flash-briefing-skill-api

From what I can tell the normal weather weather you get is a Flash Feed, but I
don't think Weather Bug is. I see there is a Skill for the Netamo station
that might give you some ideas too, but I haven't looked at this.

Great project idea, let us know how it goes (because I want it).

Bill

Rob Cranfill

unread,
Dec 28, 2016, 3:14:38 PM12/28/16
to weewx-user
FWIW, I haven't quite "closed the loop" in my own Davis->weewx->HomeAssistant->Alexa setup, but I was thinking about just trying to get Alexa to access my WeatherUnderground data, which of course comes from my station. So I guess that would then be Davis->weewx->WeatherUnderground->Alexa. And WU certainly has the past data - not sure about their API.

 /rob

On Thursday, December 15, 2016 at 8:24:21 AM UTC-8, Matt Sargent wrote:

Steve Dulmes

unread,
Jan 6, 2017, 6:55:33 PM1/6/17
to weewx-user
Has anyone had any success with the Amazon Echo with weewx data. I would like to be able to ask Alexa for the temperature, wind chill, how much rain we had today, etc. Would this be done with IFTTT?
Thanks.

vince

unread,
Jan 9, 2017, 11:31:35 AM1/9/17
to weewx-user
On Friday, January 6, 2017 at 3:55:33 PM UTC-8, Steve Dulmes wrote:
Has anyone had any success with the Amazon Echo with weewx data. I would like to be able to ask Alexa for the temperature, wind chill, how much rain we had today, etc. Would this be done with IFTTT?


ok, I had greater than zero success using the Flash Briefing skill walkthrough at https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/steps-to-create-a-flash-briefing-skill#add-one-or-more-flash-briefing-feeds and got Alexa to read my rss.xml file that the standard skin creates.
  • followed the instructions in the link above to create the skill, pointing at the Internet-accessible URL for the rss.xml file my weewx system generates
  • had to create a 512x512 image to upload for it to proceed (ugh).  I took the weewx icon from weewx.com and scaled it up using an online image modifier I found via google
  • enabled the new skill in my developer portal at amazon
  • got in 'settings' in the alexa app on the phone and disabled all my news flash feeds, enabled just my new weewx one
  • got in skills in the alexa app on the phone and ensured my new weewx one was enabled
  • tried "alexa flash briefing" and it read my rss.xml file contents to me including currents, min/max data, etc....there's a long list in rss.xml by default
So it's doable with some tweaking in about 10 minutes of learning using the link above.

Now what I'm sure everybody (including me) wants is more of a custom interaction skill, not a flash briefing skill, along the lines of "alexa wee weather please" and have it give you the home weather.  I have to think that's doable.  The one thing I can't figure out is how we could have a generic skill that did that kind of model, where everybody would put in their own URL to read, because I 'think' we would all need a custom skill of our own with our unique url to read somehow.

But it is pretty cool getting alexa to read my weewx current conditions to me :-)



Steve Dulmes

unread,
Jan 9, 2017, 8:15:29 PM1/9/17
to weewx-user
Very cool. This is what I'd like to do too. Thanks.

vince

unread,
Jan 9, 2017, 8:30:04 PM1/9/17
to weewx-user
On Monday, January 9, 2017 at 5:15:29 PM UTC-8, Steve Dulmes wrote:
Very cool. This is what I'd like to do too. Thanks.

Well at a minimum, you'll need to have a developer key at amazon associated with the profile your Echo uses, so you can set all that stuff up now and fiddle with it to get your feet wet.  Teach it how to answer with something to a question you cook up.  Teach it how to do a RSS Flash read ala the link I posted.   It takes a little time to understand the moving parts.

Tim Hart

unread,
Jan 20, 2019, 6:47:12 AM1/20/19
to weewx-user
Hi Vince - do you need ssl enabled on your weewx webserver?  I get a 'Error fetching the requested URL' error message when attempting to add my public url (http://normanclanger.dyndns-home.com:8081/html/weewx/RSS/weewx_rss.xml) to a Flash skill.

thanks

Tim

ALPHA SG

unread,
Dec 21, 2024, 5:49:40 AM12/21/24
to weewx-user
Hi,
I followed the procedure on the site, but I cannot activate the skill in the state because I have this message that appears.
" There was an error parsing the feed. Please ensure that the feed is valid JSON or RSS."
It's a new weewx 5, the xml is well generated.
 I try to modify it according to the instructions but nothing works.
if you have any ideas?  
thx.
Reply all
Reply to author
Forward
0 new messages