openhab / openhab-alexa Goto Github PK
View Code? Open in Web Editor NEWopenHAB skill for Amazon Alexa
License: Eclipse Public License 2.0
openHAB skill for Amazon Alexa
License: Eclipse Public License 2.0
GE (Jasco) 12718 PlugIn Smart Dimmer is fully functional in OH2, but is not detected by the Alexa discover device scan. Alexa can find my Smartthings devices, but not my OH2 devices.
http://www.cd-jackson.com/index.php/zwave/zwave-device-database/zwave-device-list/devices
Please let me know where I might find more info/logs to share regarding this issue.
Hi,
to me it looks like noone works here actively anymore on answering issues or merging PRs. There are a lot of open PRs related to v3 and the last change on the v3 branch was 7 months ago.
I saw that multiple people did changes and worked on the v3 branch, and as this seems to be the central point where it all comes together, it would be nice, if other people could take over or at least are allowed to merge PRs in here so we can get all the latest changes and do not have to collect them from multiple git repos.
The earliest PR for example is from may 2018, there were some replies back in october but after that its still dead.
If this is not maintained anymore i would propose to open a new repository where all people that were active here could work on the code so we at least have a base code where we can work on to push the v3 implementation of this skill.
Hi,
I have just configured and deployed openhab-alexa, but looking at the Alexa.Discovery Interface at https://developer.amazon.com/docs/device-apis/alexa-discovery.html to me it seems openhab-alexa is not compatible with the current API.
I started modifying the code to produce correct headers, but before going any further, I just wanted to make sure if it is not something I am doing wrong. The response openhab-alexa sends, looks completely different from what's expected.
The below is the log of an example of my test set up with a few switches. If you compare it to what is described at the link (above), it's very different.
2018-11-22T17:23:42.085Z 5b83c3e1-ee7b-11e8-9c89-7d6e78457270 Discovery:
{
"directive": {
"header": {
"messageId": "f3d6067b-aa63-464e-b8ca-2a8123aee1b6",
"name": "Discover",
"namespace": "Alexa.Discovery",
"payloadVersion": "3"
},
"payload": {
"discoveredAppliances": [
{
"actions": [
"turnOn",
"turnOff"
],
"applianceTypes": [
"LIGHT"
],
"applianceId": "Sonoff_Basic",
"manufacturerName": "openHAB",
"modelName": "Lighting",
"version": "2",
"friendlyName": "Sonoff Basic",
"friendlyDescription": "Switch Sonoff_Basic Lighting via openHAB",
"isReachable": true,
"additionalApplianceDetails": {
"itemType": "Switch",
"itemTag": "Lighting",
"openhabVersion": "2"
}
},
{
"actions": [
"turnOn",
"turnOff"
],
"applianceTypes": [
"LIGHT"
],
"applianceId": "ben_bedroom_light",
"manufacturerName": "openHAB",
"modelName": "Lighting",
"version": "2",
"friendlyName": "Ben Bedroom Light",
"friendlyDescription": "Switch ben_bedroom_light Lighting via openHAB",
"isReachable": true,
"additionalApplianceDetails": {
"itemType": "Switch",
"itemTag": "Lighting",
"openhabVersion": "2"
}
},
{
"actions": [
"turnOn",
"turnOff"
],
"applianceTypes": [
"SWITCH"
],
"applianceId": "ben_bedroom_fan",
"manufacturerName": "openHAB",
"modelName": "Switchable",
"version": "2",
"friendlyName": "Ben Bedroom Fan",
"friendlyDescription": "Switch ben_bedroom_fan Switchable via openHAB",
"isReachable": true,
"additionalApplianceDetails": {
"itemType": "Switch",
"itemTag": "Switchable",
"openhabVersion": "2"
}
}
]
}
}
}
Thanks,
Miki.
Hi,
If I ask alexa for a temperatur, I got the answer "23.5 Grad" (Which sounds '25er 5 Grad'), but it should be in German "23,5 Grad". So I think there is a problem with the decimal separator which should in german ',' instead of '.'
Is this a bug in the alexa software or is there a possibility in the skill to handle this?
Anyway, your skill is very useful! Thanks!
Kind regards,
Michael
Currently the skill only points to the "myopenhab.org" solution (afaik). But the openhab-cloud solution also offers the oppertunity to host it yourself. Therefore the skill should provide the possibility to enter the URL of a self hosted openhab-cloud solution. "myopenhab.org" could be the default value for this field.
@jsetton , @fmeies Right now the V3 skill was built with the idea of tags, as of 2.3 this will change to the Metadata on items, although v2 tags will still be supported (as you both already know, just stating the obvious) . Right now we have a metadata function in the code that converts metadata to tags, but I wonder if this is the right approach? Now that I have more eyes on this, I would not mind some feedback about how we are translating items and properties to the internal map that we store on Alexa. Its rather complicated, which bothers me, but I don't know if there's a better approach.
I'm using the V3-version of the skill (with aws lambda and nginx-tunnel to my openhab instance).
Everything is working fine, but as soon as a add an item without an { alexa=... }
tag, the device can not be discovered.
Works (device can be discovered):
Group gFernseher "Fernseher" (gWohnzimmer) { alexa="Endpoint.TV" }
Switch Wohnzimmer_Fernseher_AnAus "AnAus" <switch> (gFernseher) { alexa="PowerController.powerState" }
Does not work (device can't be discovered):
Group gFernseher "Fernseher" (gWohnzimmer) { alexa="Endpoint.TV" }
Switch Wohnzimmer_Fernseher_AnAus "AnAus" <switch> (gFernseher) { alexa="PowerController.powerState" }
Switch Wohnzimmer_Fernseher_Stero_Strom <switch> (gFernseher)
Is this a wanted behavior? Is there something like alexa=Ignore
?
For now I'm just creating two groups: one with alexa only items and one with all.
Is it possible to have explained how the communcation goes after the command is initiated by voice to Alexa?
How i see it, it's from Alexa device -> Skill -> AWS Lambda -> OpenHab2.
How does the Lambda service communicate with OpenHab2 in this way, if port 443 is not forwarded to the server hosting OpenHab2?
The only way i see that possible would be by Alexa Device -> Skill -> AWS Lambda -> Alexa device -> OpenHab2, since this wouldn't require any portforwarding if the alexa could send the instructions to OpenHAB, since it's on the same network.
Hi,
I've a alexa for each room, so I don't want need to say "alexa switch livingroom lights on". It should be enough to say "alexa, switch on the light", as she knows what room she is placed in.
Do you have any plans to implement such a feature?
Onother point is, that there could be a default light (kind of device) for each room, which means, when I have some light in my livingroom, alexa should know which light is the default.
This means, when I have three lights in my livingroom, I'ld like to default one of my lights, which is switched, when I just say "alexa, switch light on".
At the moment I need to say "alexa, switch the TV light in the livingroom on" and could be shorten to "alexa, switch light on".
Do you think it's possible and worth to think about?
Thanks for your efforts,
Michael
Hi, I have one question: What advantages does an Alexa skill have against the openHAB Hue Emulation? Using Hue Emulation makes it possible to use HomeKit-Tags too. Thank you for your advise.
Changes to Smart Home Skill API Reference - April 7, 2017
New directives added to control the color and tunable white light settings of devices
SetColorRequest
SetColorConfirmation
SetColorTemperatureRequest
SetColorTemperatureConfirmation
IncrementColorTemperatureRequest
IncrementColorTemperatureConfirmation
DecrementColorTemperatureRequest
DecrementColorTemperatureConfirmation
New value added to NotSupportedInCurrentModeError.currentDeviceMode to support lighting changes.
At the moment the skill is not available in Canada. Any chance to get it to work? Should be an easy fix.
The smart home api has added the ability to query the current temp and desired temp
Hi all,
when do you think will the OpenHAB skill be In Italy?
Hi All
Im unable to discover the devices. Using the private instance of OpenHab Cloud. Any thoughts?
2018-10-17T07:37:52.458Z 8df75a26-d1df-11e8-9816-534a5dfaf4ac Input:
{
"header": {
"namespace": "Alexa.ConnectedHome.Discovery",
"name": "DiscoverAppliancesRequest",
"payloadVersion": "2",
"messageId": "5930161b-3945-4352-a5af-937f851e9727"
},
"payload": {
"accessToken": "XXXXXXXXXXXXXXJ4xMgW_onniG1-mVWFtPfEQQOcZ0kU1DlkDCDeFG7wevMW0ovYo7-64N_1i9ZMxGflJzyrL_QQ1P9RWINQJWrysHnh98kWDkTbLR5e6uEApLN3SiW00h5lUdJyvAL7n8wRjjLFem76EBDbmkiI7aZwHnvlv87ybiWSANXzyXFN5BVq9r23eqKVroEEU5xWZyWLm7VL2_0jysclgj6yV-WchqN_YNVYQWNlYQW-IAIsVocNXwtkDt7kspiFxKkzRyhp5pOSYF5Lq5DN3ndGpk2cePFLZNld68ZnroVRESEcEx2DqJIytar1227DaB5yptcK35LR6QducAiwqUA47bDnc2lepOEzeog_crr9v5_rH_aEWjKOJV8AUWY1FLT9_teaR7AEPcOt5vqWUwPbQ8U0vHUb-spheOEAWfJRGvJklLFz5niulgINRc0ywSTeikuKX5Ckl9954z5j5dVfDEOUNHNEHwGD0DjGOuxduGeGQgEUaMCn_kgeK4Ujortdx6oISt2Q0yHgVHquK0PafU2OGK8phZhZ5NwdJ39-csLBrKuTo"
}
}
07:37:53
2018-10-17T07:37:53.411Z 8df75a26-d1df-11e8-9816-534a5dfaf4ac discoverDevices failed: Error response 401
2018-10-17T07:37:53.411Z 8df75a26-d1df-11e8-9816-534a5dfaf4ac discoverDevices failed: Error response 401
Who can be contacted to add support for OpenHab Alexa skill to support English(India)? It's unlisted on Alexa skill store as English India is not yet supported.
Changes to Smart Home Skill API Reference - February 28, 2017
New directives added for querying for for lock status and setting lock status.
GetLockStateRequest
GetLockStateResponse
SetLockStateRequest
SetLockStateConfirmation
New error messages specific to lock error conditions.
UnableToGetValueError
UnableToSetValueError
When will the OpenHAB skill be In Australia?
When setting command of e.g. "set numberitem to 4", the skill responds with numberitem=3.
There is the same issue with the hue emulation. The (hue emulation)-issue has been described here as well.
Even though there is a workaround by just adding 1 to the value with a rule, problem with this issue is that there is no chance to distinguish between value "1" and "OFF" since both lead to a response of "0".
HI!
I'd love to try this, but I'm having trouble going through the installation instructions.Could you please elaborate a little?
For example, first step is:
run npm install to install the nodejs dependencies
"npm install WHAT"?
Sorry, but this "mode" thing is pretty new to me...
Thanks!
I created an openHAB item with the tag "CurrentTemperature" without using a group with the tag "Thermostat". This item was dicovered by Alexa as type "Other". When put into a group with tag "Thermostat" it was discovered as type "Thermostat". I think the item outside a group should be discovered as type "Temperature_Sensor".
Please update skill to use item name if the label is missing.
https://community.openhab.org/t/cant-connect-google-to-myopenhab-cloud/46406/6
Hello everybody,
is there already a plan or the possibility to use the new Alexa Voice Service Notifications with openHAB:
https://developer.amazon.com/public/solutions/alexa/alexa-voice-service/reference/notifications-overview
Similar to the push notifications of myopenHAB (sendNotification(“[email protected]”, “Hello world!”))
For example, so Alexa can welcome me when my door is opened etc.
Best regards
Fabian
I noticed, that Smart Home Skills could provide scenes.
This might be useful, so that we don't have to use switches for scenes.
"Alexa, Switch scene... on"
Hi, when do you think will the skill be available in Spain?
thx!
It seems that amazon just activated support for contact and motion sensors that can be used in routines. The primary purpose is to let iot devices trigger rules but i think it should also be possible to let openhab send arbitrary status updates to alexa, which in turn can be used to trigger routines.
Essentially this means that two-way communication would be possible without the echo-binding which uses an inofficial api and therefore has some authentication issues (at least when using 2FA).
Alexa, is my door closed? etc.
@digitaldan - I have been working to add asynchronous response support so we can send deferred response for device such as locks to report the accurate state once the action is complete.
Part of this integration is the need to send asynchronous responses to the Alexa Event Gateway which requires the use of an authentication token not related to the one provided in the directive endpoint scope. That token is actually retrievable through the Alexa.Authorization directive sent to the skill when the "Send Alexa Events" skill permission is enabled and a user enables the skill on his account.
When handling the Authorization directives and getting the OAuth2 tokens from LWA API, we are expected to store these keys for each user, so they can be used later on along with having to refresh them when necessary. So this is the part, I am looking for some feedback. How do we want to store this information? My first intuition was to just use a DymamoDB table to do so. Another option, if we want to just rely on each user openHAB instance, we could store that information in the cloud connector service config through the REST API.
Hi there,
I installed everything and added 2 Homekit tags to my openhab installation, but alexa does not find any devices. What is going wrong. Can i somewhere look in some logfiles to check out whats going wrong?
please help.
The current implementation only supports items with tags which are not available in OH1. I would suggest the following additional configuration for making items visible to the skill: dedicated groups. Groups are available in OH1 and OH2, so this solution should be independent of the server version.
A preconfigured group could be 'gAlexa' or simply 'Alexa'. When this group is configured in config.js, it can also be changed as desired. We can even allow a configuration of multiple groups so that all items in all groups are collected.
Furthermore, the configured groups could also reflect the supported device types of smarthome skills. Examples:
module.exports = {
//userpass: '[email protected]:Password1',
host: 'my.openhab.org',
port: 443,
path: '/rest/items/',
generalGroups: ['Alexa'], // item type determines capabilities, e.g. percent for dimmers
switchGroups: ['AlexaLights', 'AlexaSockets'], // allows on/off messages
temperatureGroups: ['AlexaThermostats'], // allows temperature messages
percentageGroups: ['AlexaDimmers', 'AlexaRollershutters'] // allows percentage messages
};
What do you think? I already tested switches with OH1 and it seems to work pretty well.
As part of this implementation, the code should be refactored to eliminate duplicate code (oh1.js and oh2.js are almost identical).
Dear team,
Greetings!
Since I am configuring this Alexa skill with my own Google cloud instance which I have created with below link.
https://github.com/openhab/openhab-cloud/tree/master
I have done the testing using google assistance with my google openhab cloud server ,
but when I am configuring with alexa , facing below issue.
1-for Oauth2 configuration, when i using "login with Amazon" .But after successful account linking , when I am hitting "discover device" it saying as "discover device failed".
Looking out for help.
Thanks in Advance!
Hi,
Alexa does not discover any devices in my opehab 2 installation.
I tagged my items, and they are working with Homekit.
https://myopenhab.org/rest/items returns this: https://gist.github.com/hco/53a7e44939d7d08fdcc1b9f28efeedfc
Could maybe something with the thermostat be the reason? It's not working perfectly with homekit either.
I am from germany and am using Alexa in german.
if i use the lable ["Switchable"] or [“Lighting”] all devices are identified as TYP- "Switch" in the Alexa App
but this Typ is very importnat for using Group commands like "lights on"
I'd prefer not to have a questionably secure cloud service in between the alexa service and my home openhab installation. I sort of trust amazon opsec, not so much that of myopenhab.org. I do have my openhab server available via https and username/password auth on a port on my home firewall for use by the openhab iPhone app. I'd prefer to hook up alexa directly to that.
Number values like temperature provided by thing channels are directly passed to TTS service of Amazon Alexa engine ignoring item configurations like [%.1f %unit%]. Depending on the precision with which the value was passed number values with high precision could end in an output like “The temperature in the children’s room is twenty-three-point-eight-nine-nine-nine-nine-six-one-eight-five-three-zero-two-seven-three-four-three-seven-five degree”. Of course you can try to manipulate number values as desired but especially when dealing with Quantitype values this ends in a nasty task for OH users to manipulate values in rules, please see also my explanation here: Openhab issue #4054: [Netatmo] Temperature values with many digits after decimal point.
Therefore I suggest to apply the formatting pattern which allows users to get exactly the precision they desire. As @wborn explained here, not all item states are expected to have the same precision. E.g. for Energy (kWh) it's sometimes more desirable to have a higher precision.
does it support multi user. Where is the code to get user authentication details and pass it to the server?
Hello,
I' m started to port the alex skill to V3. It's currently more just for fun to see how Alexa and AWS works. But maybe it is useful. I will add the fork to github next days.
The following causes node-lambda deploy to fail. remove the quotes and it works.
EXCLUDE_GLOBS="event.json"
I have verified that Alexa openHAB skill works fine for Japanese.
Please add Japanese language (region) to the official skill’s supported language (region) list.
I did the below to verify the skill in Japanese environment.
I cloned the skill, and run it under my AWS account. I set the language of the skill to Japanese and put openhab item label in Japanese (utf-8). I added the skill and searched devices on alexa portal. I said "Alexa, turn on floor lamp" in Japanese. The lamp was lit.
July 13, 2017
Operation | Capability Interface |
---|---|
Turn things on and off | Alexa.PowerController |
Change the channel on a device | Alexa.ChannelController |
Change the input of a playback device | Alexa.InputController |
Control the playback of device; fast forward, rewind and pause | Alexa.PlaybackController |
Change the volume in incremental steps | Alexa.StepSpeaker |
Change the volume to anywhere on a continuous range | Alexa.Speaker |
Indicate an error has occurred for an entertainment device | Alexa.ErrorResponse |
Hello,
I found an issue a few weeks ago. Once you install openhab cloud connector and connect Alexa. Alexa will not see devices unless you have an item with a label in quotes. Please update help document to specifically state that the label is requried and not optional as sited in the items file documentation. I am happy if you like to fork the document and make the changes, then you can pull them back in if you like.
If you would like to see my post @ https://community.openhab.org/t/cant-connect-google-to-myopenhab-cloud/46406/6
I am asking the cloud connector people to issue a warning when an Alexa application connection shows up.
I also proposed to the google skill people and maybe this would work for the alexa skill to use the name of the item if a label does not exists.
Changes to Smart Home Skill API Reference - April 7, 2017
New directives added to control the color and tunable white light settings of devices
SetColorTemperatureRequest
SetColorTemperatureConfirmation
IncrementColorTemperatureRequest
IncrementColorTemperatureConfirmation
DecrementColorTemperatureRequest
DecrementColorTemperatureConfirmation
I've setup the V3 branch to use with my locally installed openhab 2.4 which is available to the outside via a reverse proxy with basic auth.
Setup was smooth, but the app does not discover any devices.
Looking at cloudwatch I see that the lambda function always times out:
START RequestId: 5bc03f16-0493-11e9-82b6-79f589f8e736 Version: $LATEST
2018-12-20T20:10:56.073Z 5bc03f16-0493-11e9-82b6-79f589f8e736 Input:
{
"directive": {
"header": {
"namespace": "Alexa.Discovery",
"name": "Discover",
"payloadVersion": "3",
"messageId": "aba919a0-31cf-46fe-ad6c-9cabeb48dc71"
},
"payload": {
"scope": {
"type": "BearerToken",
"token": "--TOKEN--"
}
}
}
}
END RequestId: 5bc03f16-0493-11e9-82b6-79f589f8e736
REPORT RequestId: 5bc03f16-0493-11e9-82b6-79f589f8e736 Duration: 15015.24 ms Billed Duration: 15000 ms Memory Size: 512 MB Max Memory Used: 23 MB
2018-12-20T20:11:11.076Z 5bc03f16-0493-11e9-82b6-79f589f8e736 Task timed out after 15.02 seconds
If I can provide more information for torubleshooting just let me know.
I configured some lights and fiddled around with groups. Out of a sudden, all of my devices were shown as "offline". So I discarded them all in my Alexa app, removed all my groups (as it was before) and restarted a device discovery. Still, no devices are found.
When I look in the logs of the skill, I see that the devices are correctly queried and discovered, however they don't show up in the skill.
I tried it with Homekit
There is a similar issue here (#39), and there it is recommended to reinstall Openhab. Do I REALLY have to do this or is there another way?
EDIT: I somewhere had an error in my configuration, or there was a constellation that Alexa doesn't like. Since the configuration was bad anyway, I started from scratch (without reinstalling, just deleted all my configuration files, and started with a simple .items file containing just one item) and it works again.
Hi.
I'm having trouble to discover sensors. Can you see whats wrong in the response from OpenHAB when i run "Discover Devices" from Alexa?
{ "link": "https://MYHOST/rest/items/tellstick_sensor_79aa59da_4433381_temperature", "state": "-3.8", "stateDescription": { "pattern": "%f °C", "readOnly": true, "options": [] }, "type": "Number", "name": "tellstick_sensor_79aa59da_4433381_temperature", "label": "Outside Temperature", "category": "Temperature", "tags": [ "CurrentTemperature" ], "groupNames": [] }
Due to the hotness these days, i opened the roller shutters last night to let the house cool down.
I was asking myself if it is possible to spontaneously ask Alexa to "close the roller shutters in 5 hours", so that the house can cool down but the sun won't wake me early when it comes out.
Of course this would be interesting for many other things as well. E.g. "Switch of the lights in 30 Minutes". Although it makes sense to use rules if you use it periodically, but there are many dynamic and spontaneous cases where it would make sense.
I am unsure whether this should better be handled by alexa (which means amazons needs to implement it) or would it be better to use some kind of timed command queue in openhab itself. Is it even possible with the current API? What do you think?
Alexa says in german in temp request only the value without decimal places.
Could the issue be the parseint function, instead of using parsefloat?
var value = parseInt(items.targetTemperature.state);
Hey,
I was really impressed to see that we have a alexa skill.
Thanks for your work here.
While playing around I tried to include a rollershutter:
Rollershutter Shutter_MaBo_AZ "Rolladen Arbeitszimmer" (MaBo_AZ, Shutters) ["Switchable"] {channel="..."}
I also tried to use only "Arbeitszimmer" (without "Rolladen" in front) as Itemname.
Same result.
Am I doing something wrong?
Thanks for replying.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.