Newbie question - have Alexa report state of contact sensor

Hi,

Newbie question I'm afraid. Is it possible to have Alexa tell me if a door is still open when I ask her to turn lights off? For example, I say "Alexa, goodnight and she turns the lights of but if the shed door sensor is "open", she will tell me.

Shed door contact sensor is a zigbee sensor in Hubitat which Alexa is aware of but the Alexa app doesn't seem to have IF in its Routines.

Thanks

Can you ask Alexa if the shed door is open?

One approach is to have an auto-off virtual switch set by Alexa in your Goodnight routine when you want to know if the door is open. Have the virtual switch trigger a Hubitat Rule that looks at the state of the shed door, then have Echo Speaks announce that the shed door is open, if so. Thatā€™s what I do to get Alexa to tell me where our cats are. All the If logic happens in three Hubitat rules.

Each cat has a microchip that is sensed by the Hubitat (user contributed) Sure Pet cat door integration, to provide a presence sensor for the cats. Alexa, when asked, triggers one of three Rules (where are the cats, where is Thor, where is Loki), that cause Echo Speaks to reply with an appropriate response.

If you want the rules and greater details, just ask.

1 Like

Thank you, make sense. I've seen stuff about virtual switches and couldn't work out what they could be used for but I get it now. Now I just have to work out how to add Echo Speaks!

Hi,

Yes I can and she tells me. However the idea is that I would like to be notified if "several" conditions are met as part of a "goodnight" routine.

Itā€™s not the simplest integration to setup, but there are some recent threads to help walk through the potentially tricky part (spinning up an Alexa cookie refresh server, which is external to Hubitat). And thereā€™s always more help available if you decide to try and are getting stuck.

Use Jeff Pageā€™s excellent guide on setting up a local cookie server rather than using Heroku. I have mine running on a Raspberry Pi, works great, straightforward setup from Jeffā€™s guide, no Docker.

3 Likes

Do all of your logic in Rule Machine (or WebCoRE), just have Alexa do speech recognition and fire an appropriate trigger.

Again, if you want to see details of how itā€™s done, just ask.

1 Like

I wonder if its that common to NOT want to use docker that I should just take the various tips from all over and make a guide for non-docker installs as part of my second post?

Honestly I hated docker before. Overall there are no good guides which actually explain anything and the instructions provided from people who create packages are usually trash. BUT, by simply finding out about Portainer, and then the Stacks / Compose files, it has made working with docker much easier.

I just setup a self hosted server dashboard this week and looked at the instructions for manual setup, it needed SQL, PHP, a bunch of libraries, etc... all sorts of stuff. OR, I could just copy and paste a yaml config file into Portainer, adjust a few settings and click Deploy. They actually had a good premade compose file, so it made it even easier. I opted for Docker.

2 Likes

Not as simple as not using Docker if the cookie server is all thatā€™s on the Raspberry Pi. Some may have the cookie server running on a local file server or spare computer. In a case like that, using Docker might be understandable. But, for a simple small-memory spare Raspberry Pi, the learning curve of Docker, Portainer, etc., seemed more than was necessary to do this simple, targeted application and nothing more.

How many posts have we seen of people struggling to get ports configured, IPs etc, with Docker? Not everyone has your skill set and experience, Jeff.

I just setup a self hosted server dashboard this week and looked at the instructions for manual setup, it needed SQL, PHP, a bunch of libraries, etc... all sorts of stuff.

With total lack of understanding, I was able to execute a couple of shell commands from your guide and setup a local non-Docker cookie server on a spare Raspberry Pi without any trouble.

1 Like

I get the trigger / actions part. It seems like getting Hubitat to get Alexa to speak is a technical nightmare. Thanks everyone for the advice. Iā€™m very impressed with the speed and level of response here.

Not really. It can also be done without Echo Speaks and an Amazon cookie server, simply by using the built-in Amazon Echo Skill. Here is an example rule that does it that way, without Echo Speaks:

The Cat Poop flag is an auto-off virtual device that triggers Alexa to say that a cat pooped.

2 Likes

There may be a much, much easier solution... Since you can verbally ask Alexa if the Shed Door is open, you may be able to perform that same question inside of an Alexa Routine.

So, you would create an Alexa Routine for "Goodnight". So, when you say "Alexa, Goodnight", you could have that Alexa Routine run a "Custom" Action that is to ask Alexa "Is the Shed Door closed?". She will then respond with "Shed door is closed" or "Shed door is open"

This is way simpler than setting up Echo Speaks (but not as full featured.)

I just created an Alexa Routine and it works great!

2 Likes

It definitely sounds like you do not need an Echo speaks/RPi to do this. However, at $5 a month, I pay for the heroku account versus purchasing a new RPi and housing. YMMV