Is Alexa able to reply the state of a KNX Dimmer? ON/OFF, Brightness

Hi folks,

the target is: Voice control my KNX environment.
The question for now is, is Alexa able to reply the state of a KNX Dimmer?
I guess yes, but I’ve no idea how to configure or tag the item (point).

What is currently working is, voice control a light and ask for the state:
Item: TEST_Licht
Semantic class = Equipment_Lightbulb
Metadata: Amazon Alexa → Light.PowerState,Light.ToggleState
When I ask Alexa: Wie ist der Status von TEST_Licht? (How is the state of TEST_Licht?)
Alexa replies: Der Schaltzustand von TEST_Licht ist aus. (The switching state of TEST_Licht is off.)

What is almost working, voice control a dimmer but what is absolutely not working is, ask for the state:
Group Item: Bürolicht
Semantic class = Equipment_Lightbulb
hasPoint = Buerolicht_Dimmer
Point Item: Bürolicht
Semantic class = Point_Control
Metadata: Amazon Alexa → Light.PowerState,Light.RangeValue
When I say Alexa: Stelle Bürolicht auf 36%! (Put Buerolicht to 36%!)
Alexa replies: Okay. (Okay.) → Works!
When I ask Alexa: Wie ist der Status von Bürolicht? (How is the state of Buerolicht?)
Alexa replies: Bürolicht unterstützt das nicht. (Buerolicht does not support that.)
When I ask Alexa: Wie hell ist Bürolicht? (How bright is Buerolicht?)
Alexa replies: Ich weiß nicht was schiefgelaufen ist. (I don’t know what went wrong.)
When I ask Alexa: Dimme Bürolicht? (Dim Buerolicht?)
Alexa replies: Dieser Befehl funktioniert für Bürolicht nicht. (This command does not work for Buerolicht.)

I am so thankful for every tip you can provide!
Did I miss anything in the docs, is there already a thread which I have overlooked, is it so simply and I’m confused? :slight_smile:

When asking for help, you should at least be providing the basic information required for any answer such as the OH version you run.
The Alexa skill was recently reworked and may require you to change your metadata.

Thx for the hint! Sorry for that.

openHAB Version 3.2.0
Release Build
on a Raspi 4 with openhabian installed

I just started with openHAB 3 from scratch. I do not have experience with prior versions.
For configuration I simply used the UI, no textual files.

Can you please share your detailed Alexa metadata configuration including parameters?

Sure, thank you for your reply. The Metadata is more or less default, except the Dim=(-20).
Auto-update Metadata:

value: "false"
config: {}

Alexa Metadata:

value: Light.PowerState,Light.RangeValue
config:
  actionMappings:
    - Dim=(-20)
    - Raise=(+20)
  presets:
    - 1=@Value.Low:Lowest
    - 100=@Value.High:Highest
  stateMappings:
    - Off=0
    - On=1:100
  retrievable: true
  supportedCommands:
    - INCREASE=@Value.Up
    - DECREASE=@Value.Down
  inverted: false
  nonControllable: false

First, please only use the documented syntax. Dim is not a valid semantic id.

Secondly, using semantic extensions for this use-case isn’t the best approach since RangeValue already supports increase/decrease utterances.

Thirdly, I noticed that you configured the supportedCommands parameter. Does your Dimmer item supports INCREASE/DECREASE commands on the OH side? If not, then there is no need to configure that parameter.

Finally, as with any generic capabilities, you need to configure the capability name in your own language if you can’t use any predefined asset ids.

value: Light.PowerState,Light.RangeValue
config:
  capabilityNames:
    - Brightness
  supportedRange: "0:100:10"
  presets:
    - 1=@Value.Low:Lowest
    - 100=@Value.High:Highest
  retrievable: true

Alexa, turn on <device>
Alexa, set <device> brightness to 50%
Alexa, set <device> brightness to high
Alexa, increase <device> brightness (defaults to supported range precision)
Alexa, decrease <device> brightness by 20%
Alexa, what’s the <device> brightness?

Thank you sooo much! You :index_pointing_at_the_viewer: are great! :+1:
:hugs:
You directly delivered the solution.

Yes understand, Dim is totally wrong.

Yes, okay, somehow I can follow, :thinking: but here I need to study a bit more…
I was looking at this place in the docs and also into the Alexa Skill API, but this is not clear to me, maybe I’m confused due to the similar names or mixture of: BrightnessController, RangeController and PowerController, I do not know when to use what?

Simply, YOU ARE RIGHT, no need to configure. :wink:

Easy :smiley: , now Alexa speaks my language (“Helligkeit”).

Will mark your post as “solution”, again thank you so much!
But maybe you do have an answer to, or even an example where I can learn from, regarding the generic capabilities?
Because for let’s say, Rollershutter or Blind, I think it is equal to your solution above, just have to exchange Brightness with Position. :upside_down_face:
But what about a Group Item for all Lights and Dimmer? To perform a central OFF on all lights in the house:

value: Light.PowerState,Light.ToggleState
config:
  OFF: ???
  ON: ???
  actionMappings:
    - ???
  stateMappings:
    - ???

Members Base Type: Switch
Aggregation Function: One ON then ON else OFF

How to make Alexa telling the state of this single item “All lights in the house”? ON or OFF

Thank you! :pray:

State derived groups are considered as the item type they are based from at the skill level. In your case, that item will be considered as a Switch. So you would configure and control as such.

Thank you Jeremy,
but after 5 hours reading through the docs: State derived groups will be considered as single endpoints based on their defined group type.
And remembering your post: Best way to publish Groups to Alexa?
I’m really sorry, but I have to ask again.

I tried with

value: Switch.PowerState,Switch.ToggleState
config:
  OFF: Off (what to put here???)
  ON: On
  capabilityNames:
    - Status

The Alexa command to switch the lights ON and OFF work, but if I ask Alexa, “what is the Status of Lichter im Haus?”,
or Alexa “are Lichter im Haus on?”
I always get: " Lichter im Haus does not support that "
:sob:

If you don’t know what to put in here, there is a good chance that these parameters aren’t used in this case :wink: The PowerState documentation explicitly indicates that these parameters are only supported by Number/String items. The point of these parameters is to define which command to use when a given item type doesn’t support ON/OFF command natively on the OH side.

As a matter a fact, are you use MainUI to configure your Alexa metadata configuration? If so, you shouldn’t have these parameters available on that item if you are using the integration.

As far as requesting the state, it is working fine for me in the English language. You need to use the exact device name as you defined it.

Alexa, what is the status of <device>?
Alexa, what is <device> status?
Alexa, is <device> status on?
Alexa, is <device> on?

Hi, :slight_smile:

Yes I’m using the MainUI. And have a look to the picture, it even tells: “Required”
but this is due to the ToggleState.

And simply using Switch or with Switch.PowerState on its own I also tried before, same reply:
“<device’> does not support that”, I also tried in English language.

You discovered a bug that would need to be patched with the ToggleState integration in MainUI. Basically, that capability was not really meant for what you are trying to use it for.

The PowerState capability doesn’t support requesting for current state by voice. That’s a limitation from the Alexa side. Isn’t it the reason why you are trying to add ToggleState to the mix?

Yes sure, was just a confirmation to myself that I am not completely wrong. :crazy_face:


Now let’s come to the very import point of your reply:

Now I’m really curious, please please tell me, how would you implement it?
:face_holding_back_tears: :question:

That capability is meant to control an on/off setting (other than power) of a complex device, such as the guest Wi-Fi setting of a router for example.

The way you are implementing that capability is more a hack to go around the limitation of the PowerState capability driven by the Alexa side. I am not saying it will not work but more that it is considered unsupported realm with the expectation it may not fully work as intended.

As far as the implementation, I would just stick with PowerState only and not have the ability to request its current state by voice. That’s how I have my environment setup :smile: Keep in mind that you still have the ability to get the current state through the Alexa app.

1 Like

:thinking: Hmm, this makes me rethink the whole concept of my intended way to use Alexa.
Is it the same with google & Co. ?

Sure sure, but then why you need that little ball you talk to… :calling:

Okay, by the way, had a little try and error session today. Now Alexa reports the Status of “Lichter im Haus”. This was possible when I removed (deleted) the metadata: autoupdate

it was set to:

value: "false"
config: {}

I somehow did this when I was probably mentally absent. :face_with_hand_over_mouth:

Don’t know why it has some effect on the Alexa metadata, but after removal it was working.

There is nothing wrong in being creative and trying to stretch the original intent of a given capability. However, you need to understand that the Alexa integration for the related device, may be affected. The same applies to the MainUI integration where getting outside of the original intent may cause some unexpected behavior.

Indeed, if your item has autoupdate=false, the skill will consider that item state not retrievable. I assumed that you had purposely set the retrievable=true metadata parameter which would override that behavior.

Anyway, I would also suggest adding metadata parameter nonControllable=true since you won’t be using the ToggleState capability to control that device.

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