Is it possible to have Alexa respond with a Hubitat Device Value?

Triggers from HE to Alexa are now very simple for users in countries that support the Alexa Skill.

Use this code from @cwwilson08 together with an Alexa Routine. On HE, you create a rule that turns on this virtual switch as the action. In the Alexa routine, this virtual device is recognized as a motion sensor. So you set the routine to speak a custom phrase when motion is detected.

metadata {
	definition (name: "Virtual motion with Switch", namespace: "cw", author: "cwwilson08") {
		capability "Sensor"
		capability "Motion Sensor"
        capability "Switch"
	}   
}

def on() {
    sendEvent(name: "motion", value: "active")
    sendEvent(name: "switch", value: "on")
    runIn(12, off)
}

def off() {
    sendEvent(name: "motion", value: "inactive")
    sendEvent(name: "switch", value: "off")
}

def installed() {
}

Temperature is more difficult. If the device is not supported by the Alexa Skill, then getting temp at every increment isn't going to be feasible. However, as @Ryan780 suggested, you can certainly get specific levels reported by triggering virtual switches. I do a similar thing for the status of my washer and dryer (i.e. which is running, or both running, or neither running). There's a slight delay in getting the status, so I added the response "Checking, hang on" so the inquirer doesn't ask again before the status can be returned.

@SmartHomePrimer,

Thanks for the response but I guess I'm dense today. I think my issue is I don't know what "Alexa Routing" is. I have the Alexa skill running on my hub and I use it to have Alexa turn some lights on and off via voice commands.

I looked at the Alexa skill and it only offers to add actions to its list.
I looked through a Rule4 action list and if I select speak or send message then skip send message the only device it would allow "speak" with is my Dome Siren.

So I'm missing a step.

Alexa Routines

Here's an example. I have named the HE virtual devices in a way I can easily recognize them when building Alexa.

Thanks again,

I think my issue is that I am not using the phone app. And I don't know how to "build Alexa" on the web interface.

If I knew where to start I can probably get through it.

John

Ah, yes. Routines can only be built/edited from the mobile app for some reason.

Bingo!

Thanks so much.

I'll ask if the capability is coming to the Web app, if not I'll look into the phone app.

John

1 Like

If you have an echo show you can setup a virtual dimmer switch and use rule manager to set the dimmer to pool temperature. Make sure before you add it to the alexa skill that you set the virtual dimmer to on or off in the device handler. Now on the Echo show just ask to turn it on and it will show the "Pool Temperature" on the screen. It will not speak it but you will get a visual.

2 Likes

Nice!

Do you run Homebridge? All the temp sensors on HE will report via HomeKit by way of Homebridge. If you add this Alexa Homebridge plugin, it sounds like you can then access temperatures from HomeKit.

[Edit] Looks like the developer is inviting the world to send their HomeKit data through his dedicated https secured server here in Canada. My Spidey senses tell me NO. I personally would just look at HomeKit for the temp/humidity.

Here's a Xiaomi Temp/Humidity sensor in my bathroom via Homebridge/HomeKit. And of course, you can just ask Siri too. If you have a newer iOS device, you don't even have to press a button, since it's always listening.

1 Like

This might not be the most elegant solution but works for what i have setup already. This will allow you to ask Alexa a question and get a response from the Alexa you questioned.

I have built many custom Alexa queries.. (aka Skills) using AWS lambda, that was pretty straightforward. "Alexa, what is the pool water temperature?"

Setup a database that is accessible by AWS.
MS SQL Server(my pref), MySQL, etc...lots to pick from.

Install and configure Node Red on a local machine/device on your network linked to HE, pull sensor/device data from Hubitat web sockets and push into the database. This runs 24/7.

Now setup a web server to supply AWS with data from the database.

Using AWS, Creata a lamda utterance "Alexa, what is the temperature of the pool?"
AWS queries the temperature data from your webserver/database and Alexa responds.. "Dont even think about swimming.. the water is only 67 degrees"

Configuration of all this is the most difficult part, once done this could be expanded to address all kinds of data from HE from Alexa.

2 Likes

Amen Ryan....lol

@Ryan780 I can understand it sounds difficult if you have never done it, but I already did all the difficult work to figure it out. If anyone is interested, I am always happy to help.

@matt.klueppel

I've looked at a node-RED youtube tutorial and it look pretty straight forward. My question is about the websocket connection to Hubitat. I've read the HE documentation and found it to be beyond by current understanding. Could you give me a short description on how the websocket connection to Node-RED would be implemented?

Thanks
John

@matt.klueppel this looks very cool. I'd be interested in additional details to get this up and running.

This thread was very comprehensive. If you need further assistance PM me, and we can chat.

1 Like

7 posts were split to a new topic: Is following technical instructions too hard for users?

Alexa definitely has the ability to receive temperatures from endpoints. In fact it has for well over a year if not almost 2.
It's all described in the Smart Home Skills api - https:// developer. amazon. com/docs/device-apis/alexa-temperaturesensor.html
It would be great if something like my SmartThings multi purpose sensors would send more than just contact open/closed to Alexa then I could voice query the temperature in any room where I have one installed.

Does Hubitat's Alexa App support the Alexa TemperatureSensor yet? If so, how do you query it on Alexa? Alexa responds to my temperature query that the sensor doesn't support it.

Not that I am aware of.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.