Coder Social home page Coder Social logo

openhab-alexa's Introduction

openHAB Skill for Amazon Alexa

CI Crowdin

This is a nodejs / lambda application that connects the Alexa Smart Home API to a user's openHAB instance, either directly or through the openHAB Cloud service (preferred). The Smart Home API is not a general skill API, it allows the user to bypass using a application wake work and instead ask Alexa to perform a smart home action like "Alexa turn lights on"

General Deployment Instructions

Intended Audience

This document describes how to configure and deploy the skill for development or private hosting purposes and it targeted towards developers and not end users of the skill

Skill Usage

For end-user documentation and general usage, see the Usage page for examples and instructions on configuring items for Amazon Alexa within openHAB.

Requirements

Alexa Skills Kit CLI with Amazon AWS and Developer Accounts

You need an AWS account and an Amazon developer account to create an Alexa Skill.

In order to use the ASK CLI features to automatically deploy and manage your Lambda skill, ensure that you have AWS credentials set up with the appropriate permissions on the computer you are installing ASK CLI, as described in this documentation.

You will have to install the latest ASK CLI, and then configure it:

npm install -g ask-cli
ask configure

By default, the ASK CLI deploys the skill resources in the us-east-1 region. You will need to change your deploy region based on the skill language you are planning to use. You should refer to the table below, based on the smart home multi-languages development guidelines:

Skill Language Endpoint Region Deploy Region
English (CA), English (US), French (CA), Portuguese (BR),
Spanish (MX), Spanish (US)
North America us-east-1
English (UK), French (FR), German, Italian, Spanish (ES) Europe eu-west-1
English (IN), Hindi (IN) India eu-west-1
Arabic (SA) Middle East eu-west-1
English (AU), Japanese Far East us-west-2

To change your deploy region, update the awsRegion skill infrastructure user config parameter in ask-resources.json.

OAuth2 Provider

If you aren't using your own OAuth2 server (e.g. private openHAB Cloud Connector), it is highly recommended to use Login with Amazon. See this post to set it up for your private skill. Doing so allows other server level authentication methods to be used over the Alexa Smart Home skill requirements for OAuth2 authentication.

If using a private openHAB Cloud Connector, in order to setup the OAuth2 server, make sure it is accessible on port 443, and to create a client profile and scope for Alexa skills in the MongoDB database, by running the below commands with the mongo CLI tool. It is recommended to use an online random hex number generator to create a unique client secret.

use openhab
db.oauth2clients.insert({ name: "Alexa", description: "Alexa Voice Control", icon: "alexa.png", clientId: "alexa-skill", clientSecret: "<clientSecret>" })
db.oauth2scopes.insert({ name: "alexa", description: "Access to openHAB Cloud specific API for Amazon Alexa" })

And use the following settings during the skill account linking deployment step instead:

  • Authorization URL: https://openhab.myserver.com/oauth2/authorize
  • Access Token URL: https://openhab.myserver.com/oauth2/token
  • Client ID: alexa-skill
  • Scope: alexa

openHAB Server

The openHAB server you are trying to control with the skill needs to be accessible online as an AWS service endpoint. You can either use myopenHAB.org cloud service or point the skill directly to your server URL. If going with the latter, make sure to use a valid SSL certificate. It is highly recommended to use Let's Encrypt to validate your certificates.

To configure your server path and credentials, you will need to setup the CloudFormation parameters in ask-resources.json. Set your server root level path in the OpenHABBaseURL parameter if not using myopenHAB.org cloud service. The Lambda function can access your server using three different types of authentication: SSL client certificate, basic (user/password) or bearer (OAuth2 token). For certificate authentication, place the client certificate in lambda/ssl/client.pfx or set the OpenHABCertFile parameter with the certificate file relative path to the lambda directory, and optionally, set the OpenHABCertPassphrase parameter with the certificate passphrase. For basic authentication, set the OpenHABUsername and OpenHABPassword parameters, otherwise OAuth2 authentication will be used.

Deployment Steps

Create Smart Home Skill and Lambda Function

  1. Clone or download this repository:

    git clone https://github.com/openhab/openhab-alexa.git
  2. Deploy the skill and the lambda function in one step:

    ask deploy
  3. Setup the skill account linking:

    1. Create the skill account linking request file as accountLinking.json, adding your OAuth2 provider client credentials:

      {
        "accountLinkingRequest": {
          "skipOnEnablement": "false",
          "type": "AUTH_CODE",
          "authorizationUrl": "https://www.amazon.com/ap/oa",
          "accessTokenUrl": "https://api.amazon.com/auth/o2/token",
          "accessTokenScheme": "HTTP_BASIC",
          "clientId": "<clientId>",
          "clientSecret": "<clientSecret>",
          "scopes": [
            "profile"
          ]
        }
      }
    2. Update the skill account linking information, using the skill ID displayed in the deploy step:

      ask smapi update-account-linking-info -s <skillId> --account-linking-request file:accountLinking.json
  4. Enable the skill on your Alexa account:

    • In your Alexa app, go to More > Skills & Games page
    • Select the "openHAB" skill under Your Skills > Dev tab
    • Tap "Enable to Use" and go through the account linking process

Update Smart Home Skill and Lambda Function

  1. Update the repository to latest commit:

    git pull
  2. If updating from ASK CLI v1:

    1. Copy relevant settings from lambda/smarthome/config.js (ask-cli-v1) to ask-resources.json (ask-cli-v2). If configuring OpenHABBaseURL, beware that it should now point to your server root level and not the rest endpoint. Additionally, move your client certificate to lambda/ssl if using that authentication method.

    2. Create the ASK CLI states file as .ask/ask-states.json, adding the skill ID listed in your Alexa developer console. This will prevent duplicate skills from being created in your account.

      {
        "askcliStatesVersion": "2020-03-31",
        "profiles": {
          "default": {
            "skillId": "<skillId>"
          }
        }
      }
    3. Delete existing function and logs using the AWS CLI, or via your AWS Console to prevent conflicts with the CloudFormation stack deployment.

      aws lambda delete-function --function-name alexa-openhab
      aws logs delete-log-group --log-group-name /aws/lambda/alexa-openhab
    4. Remove old folder environment.

      rm -rf lambda/smarthome
  3. Deploy the skill and the lambda function in one step:

    ask deploy

openhab-alexa's People

Contributors

b4dt0bi avatar confectrician avatar dependabot[bot] avatar digitaldan avatar dutts avatar floriansw avatar fmeies avatar fourthwall avatar htreu avatar jsetton avatar kaikreuzer avatar leec77 avatar llamahunter avatar mboremski avatar openhab-bot avatar paphko avatar sihui62 avatar szilch avatar thomdietrich avatar wborn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openhab-alexa's Issues

Entertainment Control Messages

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

Support Color Lights

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.

Skill vs Hue Emulation

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.

Support connection to self-hosted openhab-cloud solution

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.

question for temperatur, decimal separator problem in german

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

[V3] Lambda timeouts

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.

Openhab-Alexa Japanese region support

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.

maintainer not working on this anymore?

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.

Support for new contact and motion sensor API

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 unable to discover devices using OH2 private cloud instance.. Error 401

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

multi user support

does it support multi user. Where is the code to get user authentication details and pass it to the server?

Rollershutter supported?

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:

  • in .item file
    Adding the Switchable tag like mentioned in the Readme.md
    Rollershutter Shutter_MaBo_AZ   "Rolladen Arbeitszimmer"   (MaBo_AZ, Shutters)   ["Switchable"]   {channel="..."}
  • searched for new Devices in Alexa-App
    The device "Rolladen Arbeitszimmer" is found.
    So far so good
  • asked Alexa to move it:
    "Alexa, mach die Rolladen im Arbeitszimmer hoch
    (for engl. readers "Alexa, lift the rollershutter in Arbeitszimmer")
  • Alexa says: "Ich habe Rolladen Arbeitszimmer nicht gefunden"
    (for engl. readers "I could not find Rollershutter Arbeitszimmer")

I also tried to use only "Arbeitszimmer" (without "Rolladen" in front) as Itemname.
Same result.

Am I doing something wrong?

Thanks for replying.

Is this supposed to still work?

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.

number items of e.g. TargetTemperature are wrong

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".

Is it possible to implement dynamically scheduled commands?

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?

Support Locks

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

Let Alexa know her location

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

Support for openhab 1.x

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).

Temperature with decimal

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);

Change Documentation to site that Item Label is required

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.

Asynchronous Deferred Response Support

@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.

Support Color Temperature

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

Trouble with sensors

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": [] }

Installation instructions

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!

Control precision of number values passed to Alexa TTS service

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.

FYI: I'm working on a V3 smart home skill

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.

all devices are identified as TYP- switch

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"

What route is the skill using from start to end?

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.

Item with tag "CurrentTemperature" is discovered as type "other"

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".

V3 Metadata and tags

@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.

unable to discover devices through the alexa App

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!

[V3] Can't discover device if one item in group has no alexa tag

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.

Out of nowhere, device discovery stopped working

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.

use home openhab, not myopenhab.org

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.

No Devices detected

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.