New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[hueemulation] Fixes to prevent Alexa errors when using voice commands and the app (#6690) #6909
Conversation
Signed-off-by: Mike Major <mike_j_major@hotmail.com>
Travis tests have failedHey @MikeJMajor, 2nd BuildExpand here
|
Signed-off-by: Mike Major <mike_j_major@hotmail.com>
Travis tests have failedHey @MikeJMajor, 2nd BuildExpand here
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like that we have introduced another state cache here. The original idea of OH was that Addons do not keep any state. It fixes the Alexa behaviour though. I approve.
@davidgraeff is this waiting on a second reviewer or can it be merged? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are waiting for a second approval but I and most likely the other @openhab/add-ons-maintainers are also not happy with the introduction of state here.
The issue is due to the conversion from hue state to OH state and back again, e.g. Alexa sends a brightness of 128 which is converted to an OH brightness of 50. However, 50 converts back to 127 and Alexa is expecting to see the brightness change to 128.
Can't we just fix the conversion such that it is able to translate consistently? It seems like it should be possible to do so.
1 -> 0
128 -> 50
256 -> 100
I would very much prefer to resolve it like this instead of adding cache which could cause new problems.,
Probably not had enough coffee yet, but I'm struggling to see how the conversion can be fixed. Given that there are more Hue values than OH values there must be certain OH values that map to more than one Hue value. So given an OH value how do you know which of the multiple Hue values to pick if you have no context as to what was originally sent in? |
But does Alexa send every possible value? If Alexa can indeed send any value between 1 and 255 it will be hard to map it to an integer value between 0-100 and not have any mismatches. |
Sure that could be possible for something like brightness, if not a little tiresome asking Alexa 100 times 😁 There's also the same problem with hue and saturation. Again you could exercise all the colour options on the Alexa app, but I'm not sure that's the full set and would break as soon as a new colour was introduced. |
@kaikreuzer and other @openhab/add-ons-maintainers wdyt? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a issue due to loss of resolution due to the openHAB conversion. I have no other direct solution so if this works than I guess that should be ok.
...g.openhab.io.hueemulation/src/main/java/org/openhab/io/hueemulation/internal/StateUtils.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Mike Major <mike_j_major@hotmail.com>
Travis tests have failedHey @MikeJMajor, 2nd BuildExpand here
|
@Hilbrand I've included your review comments, do you have any further comments? |
@openhab/add-ons-maintainers does anyone have any further comments or can this be merged? |
@MikeJMajor I merged it, thanks for the ping. |
…s and the app (openhab#6690) (openhab#6909) * Correct state to prevent Alexa reporting device errors. * Minimum hue brightness should be 1 not 0. * Updated with review comments and return CT value in status Signed-off-by: Mike Major <mike_j_major@hotmail.com>
…s and the app (openhab#6690) (openhab#6909) * Correct state to prevent Alexa reporting device errors. * Minimum hue brightness should be 1 not 0. * Updated with review comments and return CT value in status Signed-off-by: Mike Major <mike_j_major@hotmail.com>
…s and the app (openhab#6690) (openhab#6909) * Correct state to prevent Alexa reporting device errors. * Minimum hue brightness should be 1 not 0. * Updated with review comments and return CT value in status Signed-off-by: Mike Major <mike_j_major@hotmail.com> Signed-off-by: leluna <hengrui.jiang@googlemail.com>
…s and the app (openhab#6690) (openhab#6909) * Correct state to prevent Alexa reporting device errors. * Minimum hue brightness should be 1 not 0. * Updated with review comments and return CT value in status Signed-off-by: Mike Major <mike_j_major@hotmail.com> Signed-off-by: Hans-Reiner Hoffmann <hans-reiner.hoffmann@gmx.de>
…s and the app (openhab#6690) (openhab#6909) * Correct state to prevent Alexa reporting device errors. * Minimum hue brightness should be 1 not 0. * Updated with review comments and return CT value in status Signed-off-by: Mike Major <mike_j_major@hotmail.com>
Hi there and thank you for the prev. fix. Unfortunately for me I use ROLLERSHUTTER items instead of DIMMER items and I still encounter the issue, but only when I want to send my rollershutters downwards.
Once these items where added as devices in the Alexa App I started to test voice commands:
This is a rough translation from the German response of Alexa and the voice commands. Is there anything that I could do about it? |
You could try to add some additional information to your item definition: https://www.openhab.org/docs/ecosystem/alexa/#semantic-extensions Maybe this helps |
Hi, actually I can't. I didn't leave anything out. I just noticed you referred me to the "Amazon Alexa Smart Home Skill" page but I am using hueemulation: https://www.openhab.org/addons/integrations/hueemulation/ Thanks |
Can you add an example from your events.log which shows what happens to your proxy items when those commands are sent from Alexa. |
…s and the app (openhab#6690) (openhab#6909) * Correct state to prevent Alexa reporting device errors. * Minimum hue brightness should be 1 not 0. * Updated with review comments and return CT value in status Signed-off-by: Mike Major <mike_j_major@hotmail.com>
@MikeJMajor I've reopened #6690 and put and example of mine there. |
…s and the app (openhab#6690) (openhab#6909) * Correct state to prevent Alexa reporting device errors. * Minimum hue brightness should be 1 not 0. * Updated with review comments and return CT value in status Signed-off-by: Mike Major <mike_j_major@hotmail.com>
…s and the app (openhab#6690) (openhab#6909) * Correct state to prevent Alexa reporting device errors. * Minimum hue brightness should be 1 not 0. * Updated with review comments and return CT value in status Signed-off-by: Mike Major <mike_j_major@hotmail.com>
…s and the app (openhab#6690) (openhab#6909) * Correct state to prevent Alexa reporting device errors. * Minimum hue brightness should be 1 not 0. * Updated with review comments and return CT value in status Signed-off-by: Mike Major <mike_j_major@hotmail.com>
…s and the app (openhab#6690) (openhab#6909) * Correct state to prevent Alexa reporting device errors. * Minimum hue brightness should be 1 not 0. * Updated with review comments and return CT value in status Signed-off-by: Mike Major <mike_j_major@hotmail.com>
…s and the app (openhab#6690) (openhab#6909) * Correct state to prevent Alexa reporting device errors. * Minimum hue brightness should be 1 not 0. * Updated with review comments and return CT value in status Signed-off-by: Mike Major <mike_j_major@hotmail.com>
…s and the app (openhab#6690) (openhab#6909) * Correct state to prevent Alexa reporting device errors. * Minimum hue brightness should be 1 not 0. * Updated with review comments and return CT value in status Signed-off-by: Mike Major <mike_j_major@hotmail.com> Signed-off-by: Daan Meijer <daan@studioseptember.nl>
…s and the app (openhab#6690) (openhab#6909) * Correct state to prevent Alexa reporting device errors. * Minimum hue brightness should be 1 not 0. * Updated with review comments and return CT value in status Signed-off-by: Mike Major <mike_j_major@hotmail.com>
Fixes #6690 #5897
When Alexa changes the state of a bulb it seems to immediately request the state of the bulb and after three requests will report an error with the device if the state does not match what it expects.
The issue is due to the conversion from hue state to OH state and back again, e.g. Alexa sends a brightness of 128 which is converted to an OH brightness of 50. However, 50 converts back to 127 and Alexa is expecting to see the brightness change to 128.
This change caches the last hue state change so that the same values can be reflected back for the status of the bulb.
Also the minimum hue brightness as stated in the API should be 1 not 0. Changing this has fixed the issue with all off bulbs being reported in the Alexa app with "Device does not support requested value"
Tested with Alexa voice commands and also Alex app. Also tested with Logitech Harmony remote. Checked bulbs which are off but now reporting brightness of 1 are considered off in both Alexa and Harmony app/remote.
Signed-off-by: Mike Major mike_j_major@hotmail.com