Alexa Smart Home Skill V3 is now live!

Thanks heaps to everyone who worked on this update - it works great for me and the documentation is very good.
Question - I have a number of temperature sensors that I would like Alexa to be able to deal with (ie tell me the temperature on request).
I have added to tags as follows:

Number Livingroom_Temp "Living Room Temperature [%.1f°C]" <temperature> (gMapDBpersist,gSQLpersist_every10Min) { mqtt="<[broker:/broadlink/temperature:state:JS(broadlinkt.js)]",alexa="TemperatureSensor.temperature"}

I can see the living room temperature in the Alexa App - so she does know about it.
When I ask “Alexa, what is the living room temperature?” the response I get is “Living room fan does not support that”. What do I need to add to get the correct response? I have tried creating a living room group and adding the sensor to that group - no joy.

I had a similar issue when setting up my thermostat. You usually don’t want to have the function name in the label. So, you should label your temperature sensor “Living Room” instead. No need for groups. They are usually used to send commands to a set of similar devices.

Thanks heaps - that worked perfectly! :slight_smile:

for me I get the same as you but its an alexa voice syntax issue, try saying
what is the living room thermostat? and then it works.

[EDIT] Just read jeshab comment and I think I need to change the label on something, I will figure that out shortly :slight_smile:

Regards
Paul

I have used the disruption caused by the move to v3 followed almost at the same time as adding a Echo Show 5 to my stable of Echo devices as a good time to redo my current setup.

I have removed my thing file and instead created all the things using PaperUI, I halso added all the AmazonEchoControl channels using PaperUI too, this took along time and meant I had to redo my thermostats too as previously that was also configured using files. So I think most of Alexa stuff is now in Paper UI and not using files. Yay!

Ok so with that background to the current major revamp I have done to my OH system and alexa integration I will continue to ask my questions of this v3 skill.

Some time ago I tried to set up OH and Alexa to understand local room devices so if I say

  • Alexa, turn on the light, she turns on the lights in that room.
  • Alexa, Whats the temperature in here? and she advises the rooms name and the current temp,
  • Alexa, turn up the heat. The target temperature is increased by 1 degree in that room.

lastly I did try to add a Heater, Fan and Dehumidifer to each room and under v2 that of course did not work I have to give them a unique name and cannot refer to them as local device types :frowning:

I see in the documentation that there are now more device types defined, unfortunately Amazon have not included Heater, Fan or Dehumidifer, in fact the only extra one I can currently see some improvement with for me is that there is now a TV device type. (I will need to rename other stuff so that will work as I already have the livingroom TV called TV).

My question is have I interpreted the documentation correct and even with V3 API support I cannot have custom types such as Heater, Fan or Dehumidifier? My objective is simple to say Alexa, turn on heater and she will turn on the heater in that room.

Regards
Paul

Your interpretation is correct. The Alexa room awareness feature (aka Alexa-enabled groups) is derived from the majority of the current display categories. So, until Amazon adds new categories, there is no way to address these devices. You should vote on this improvement that covers your use case.

On a side note, you could use the Amazon Echo Control binding lastVoiceCommand channel and a proxy Alexa-linked activity item to mimic that feature from the OH side for unsupported categories.

Expanding from my previous fan example, here is how I set up room awareness for my fans in OH: (The Alexa activity device is just to allow a successful response back when issuing the voice command; it doesn’t control anything)

items

Group gAlexaVoiceCommand "Alexa Voice Command"
String BedroomEchoDotLastVoiceCommand "Last Voice Command" (gAlexaVoiceCommand) {channel="amazonechocontrol:echo:account:echodot_bedroom:lastVoiceCommand"}

Switch RoomAwarenessActivityFan "Fan" {alexa="Activity", autoupdate="false"}

rules

rule "Alexa Voice Command Updates"
when
  Member of gAlexaVoiceCommand received update
then
  val String Location = triggeringItem.name.split("Echo").get(0)
  val String FanPowerState = transform("REGEX", "turn (on|off) (?:the )?fan", triggeringItem.state.toString)

  if (FanPowerState !== null)
    sendCommand(Location + "FanPower", FanPowerState.toUpperCase)
end
1 Like

Vote submitted.
Very nice solution, I have around 80 commands on OH that I currently have setup using the AmazonEchoControl binding but I have each command exactly specified not like you have done which is way cooler using regex.

Off to play

I have the following setup

rule "Alexa local fan Updates"
when
	Member of EchoCmds received update
then
	logInfo("alexa-enabled-groups","Running local Fan state change")	
	val String sourceRoom = triggeringItem.name.split("_").get(0)
	val String FanPowerState = transform("REGEX", "turn (on|off) (?:the )?fan", triggeringItem.state.toString)

	if (FanPowerState !== null)
	try {sendCommand(sourceRoom + "_Fan", FanPowerState.toUpperCase)}
		catch(Throwable t) {sendCommand(sourceRoom+"_Echo_TTS","Something went wrong.")}
	logInfo("alexa-enabled-groups",sourceRoom+"_Fan changed to "+FanPowerState.toUpperCase)	
end

And this works great, one small issue is how do you get over her saying “A few things share the name fan, which one do you want?” I have so far always added a routine on the alexa app for every specific phrase I have used where all she does is say either checking for status requests or roger that for commands. How do you deal with it?
Regards
Paul

Good Morning, I have some problem to fully configure my daikin split.
That’s my item file:
clima.items

//Clima Salone
Group    gClima_Sala                    "Clima Sala"                                                            {alexa="Endpoint.Thermostat"}
Switch   Power_Clima_Sala               "Power"                                 <switch>        (gClima_Sala)   {channel="daikin:ac_unit:192_168_1_84:power", alexa="PowerController.powerState"}
Number   SetPoint_Clima_Sala            "Setpoint [%.0f °C]"                    <temperature>   (gClima_Sala)   {channel="daikin:ac_unit:192_168_1_84:settemp", alexa="ThermostatController.targetSetpoint"}
Number   IndoorTemp_Clima_Sala          "Temperatura Interna  [%.1f °C]"        <temperature>   (gClima_Sala)   {channel="daikin:ac_unit:192_168_1_84:indoortemp", alexa="TemperatureSensor.temperature"}
Number   OutdoorTemp_Clima_Sala         "Temperatura Esterna  [%.1f °C]"        <temperature>   (gClima_Sala)   {channel="daikin:ac_unit:192_168_1_84:outdoortemp"}
String   Mode_Clima_Sala                "Mode "                                 <climate>       (gClima_Sala)   {channel="daikin:ac_unit:192_168_1_84:mode", alexa="ThermostatController.thermostatMode"}
String   FanSpeed_Clima_Sala            "Fan"                                    <fan>          (gClima_Sala)   {channel="daikin:ac_unit:192_168_1_84:fanspeed"}

It work nice but I still cannot handle Fan and Mode.
I tried to add the tag according with the daikin documentation:

String  Mode_Clima_Sala         "Mode [%s]"     <climate>       (gClima_Sala)   {channel="daikin:ac_unit:192_168_1_84:mode", alexa="ThermostatController.thermostatMode" [HEAT=HEAT,COOL=COLD,AUTO=AUTO]}

but when I add the tags the group got an error and all item is unlinked

Create a routine: if Alexa receives commons “turn in the fan” then reply with “ok”. You’ll have to make one for off as well.

As @omatzyo mentioned, you could certainly use routines to cover the turn on/off requests.

However, in my initial response, I mentioned about the use of an Alexa activity device.

Switch RoomAwarenessActivityFan "Fan" {alexa="Activity", autoupdate="false"}

The main advantage of using activities or even scenes is that they are stateless from Alexa perspective, thus autoupdate="false. Another point is that it covers all the different variation you would request the command (e.g. “power on/off” or “switch on/off”) that you could incorporate in the command regex.

val String FanPowerState = transform("REGEX", "(?:power|switch|turn) (on|off) (?:the )?fan", triggeringItem.state.toString)

If going that route, make sure to name the device exactly how you would call it otherwise you will get the device name conflict message response.

1 Like

You need to make sure to quote the parameter setting string-typed values. You should have gotten a syntax error in your openhab logs.

String  Mode_Clima_Sala         "Mode [%s]"     <climate>       (gClima_Sala)   {channel="daikin:ac_unit:192_168_1_84:mode", alexa="ThermostatController.thermostatMode" [HEAT="HEAT",COOL="COLD",AUTO="AUTO"]}

Hopefully, you are connected to the US because this is a perfect usage of the ModeController interface. This is how it would look like.

//Clima Salone
Group    gClima_Sala                    "Clima Sala"                                                            {alexa="Endpoint.Thermostat"}
Switch   Power_Clima_Sala               "Power"                                 <switch>        (gClima_Sala)   {channel="daikin:ac_unit:192_168_1_84:power", alexa="PowerController.powerState"}
Number   SetPoint_Clima_Sala            "Setpoint [%.0f °C]"                    <temperature>   (gClima_Sala)   {channel="daikin:ac_unit:192_168_1_84:settemp", alexa="ThermostatController.targetSetpoint"}
Number   IndoorTemp_Clima_Sala          "Temperatura Interna  [%.1f °C]"        <temperature>   (gClima_Sala)   {channel="daikin:ac_unit:192_168_1_84:indoortemp", alexa="TemperatureSensor.temperature"}
Number   OutdoorTemp_Clima_Sala         "Temperatura Esterna  [%.1f °C]"        <temperature>   (gClima_Sala)   {channel="daikin:ac_unit:192_168_1_84:outdoortemp"}
String   Mode_Clima_Sala                "Mode "                                 <climate>       (gClima_Sala)   {channel="daikin:ac_unit:192_168_1_84:mode", alexa="ThermostatController.thermostatMode" [HEAT="HEAT",COOL="COLD",AUTO="AUTO"]}
String   FanSpeed_Clima_Sala            "Fan"                                   <fan>           (gClima_Sala)   {channel="daikin:ac_unit:192_168_1_84:fanspeed", alexa="ModeController.mode" [supportedModes="AUTO=@Setting.Auto,SILENCE=@Setting.Quiet,LEVEL_1=Level One:@Value.Low,LEVEL_2=Level Two,LEVEL_3=Level Three:@Value.Medium,LEVEL_4=Level Four,LEVEL_5=Level Five:@Value.High",friendlyNames="@Setting.FanSpeed,@DeviceName.Fan",ordered=true]}

And you can change the fan speed like this:
Alexa, set the fan speed on Clima Sala to level two
Alexa, set the fan on Clima Sala to high

If you don’t have access to that capability, then you will need to use a proxy item such as a dimmer not part of the group endpoint set as PercentageController and update your device fan speed levels based on the percentage level via a rule.

1 Like

Is this still not possible with v3? @digitaldan

The workaround via Alexa app is a pain with many blinds
:slight_smile:

Unfortunately we can’t add a capability that Amazon hasn’t provided yet in their Smart Home Skill API.

Make sure to vote for the blinds integration feature request on the Alexa user voice website

I was just starting to add voice control to my devices using the new v3 application and struggling a little bit with how to name all of my devices differently, but still make it simple enough to use.

This seems like a brilliant way to deal with identical devices controlled by different echo units. One question I have, would you be able to share the MAP file for the example? Do you need to list every potential command, or can that be put together like the REGEX in the rule?

Thanks,

Steve

I am not sure to fully understand your question. I am not using any mapping in my example. Everything is based of the triggering voice command item name for the location and regex matching of its state for the fan power state.

Keep in mind, this example provides a workaround for categories that aren’t supported by the Alexa-enabled groups feature as of yet. For the ones that are supported, you should be able to call the device category (e.g. turn on the lights or turn off the TV) as long as you linked your echo device to the relevant group.

Ahh, I see now. I did not understand the transform statement, but now I see it. I have just enough programming skills to do a few simple things and I could not figure out how that was working.

I have 2 rooms with entertainment systems and I was thinking that I would have trouble addressing the TV, cable box, or other devices without getting interference between the rooms even though I have an echo in each room and have the devices assigned to that room. I will continue working on my setup and see how it works. I still think this is a great idea on how to handle some of the voice commands. I was actually thinking since I have all of my devices connected to OpenHab, that I could use a single virtual player device to receive the commands from Alexa and a rule to interpret and send the command to the currently operating device, but it would be helpful if I could identify which Alexa device is sending the command so I would only need a single set of rules for both rooms. I was thinking that this looked like it would be able to make that happen.

Thanks for the reply.

Steve

Now I think about it. Using a mapping file in place of a complex regex to get the proper state may not be that bad of any idea and probably easier to maintain.

val String FanPowerState = transform("MAP", "alexa_cmds_fan.map", triggeringItem.state.toString)

if (FanPowerState != "")
    sendCommand(Location + "FanPower", FanPowerState)

alexa_cmds_fan.map

turn\ off\ the\ fan=OFF
turn\ on\ the\ fan=ON
...

I did not realise that routines could solve that issue, good to know.
Thanks
Paul

So I have had a little play with the ‘alexa=“activity”’ now you have explained it, that makes it very interesting as a viable alternative to using routines.

I did try adding switch as an alternative to turn and it did not like it, spat out this error in the log

Cannot convert 'SWITCH' to a command type which item 'BR4_Heater' accepts: [OnOffType, RefreshType]

Is this an Amazon limitation?
As normally I can use switch or turn to control on/off devices.

I have converted eight routines across to “activitys” and think it is better way to go, I have made a single rule that deals with multiple devices, rather than a separate rule each that I used to use with exact matching. There are still many cases where I am going to keep the routine approach for now, but I will be looking through my long list of routines to see which can be converted.

Regards

Paul