OpenSprinkler Forums OpenSprinkler Unified Firmware Amazon Echo Alexa Skill for Open Sprinkler Reply To: Amazon Echo Alexa Skill for Open Sprinkler

#46825

William
Participant

Regarding a daily preview in my Alexa skill, Got It! The links you sent me were a big help. I know a lot more about binary operators in python than I did 4 hours ago.

There are some limitations to my work. Alexa answers “The sprinklers will <not> run today.” If weather adjustment is TRUE, she adds “Weather adjustment may inhibit them, however.” If there is more than one program, all are tested, however, if there is more than one board the program will terminate cleanly with a status error.

Since I am not using odd/even, I will leave that code for another day. Once I am sure this much works right, I will add that test. Adding odd/even testing will be a bit involved since my code structure is not all it should be.

Thanks again. Now my wife can tell if it is safe to go out in the yard to feed the cat.

If any one needs this Python code, I can post it with my info redacted.

** Edit **

Should others follow in my footsteps, here is an odd problem. If you host your Skill on Amazon’s Lambda site you may run into a time zone problem. The Lamda site apparently runs on UTC, so the datetime.datime() python function will return times and days UTC, not local time. If you test your code on your desktop it may run fine, but the same code uploaded to Lamda gets the date or day of week wrong! Naturally, this could effect things other than Open Sprinkler. I have not noticed this peculiarity documented anywhere. The solution is to use the pytz library to make datetime.datetime() time zone aware. None of this is a problem if you live in Greenwich England!

One other thing. You can not name your skill OpenSprinkler, either with or without the space between open and sprinkler. Open is a ‘reserved’ word.