Alexa ModeController.mode Syntax

I read through the documentation but still confused by the syntax for supportedModes. The examples given:

supportedModes=“0=Cold:Cool,1=Warm,2=Hot”
supportedModes=“Normal=:Cottons,Whites”
supportedModes="Normal=Normal:Cottons,Whites=Whites

Does anyone have a simpler explanation as when to use = , and : ?

For a given mode, “=” sets the OH states (left side) to a list of friendly names (right side) which are delimited by “:”

The first example would be suited for a Number item while the other two for a String item. The second example you provided is just a contracted version of the third example. Basically, if the OH state is also used as one of the friendly names, it can be omitted. So Normal=:Cottons is just a contraction for Normal=Normal:Cottons. Similarly, an OH state by itself indicates that it should be used as friendly name, thus Whites is the contraction for Whites=Whites.

2 Likes

Hi Jeremy

I too find the meta data and names all confusing.

Can you provide an example where im using strings. The OH states are AUTO, HEAT, COLD but I’d like ‘COLD’ to be COOL when I issue the utterances. I can issue the command AUTO and HEAT just fine, but DRY and COLD do not work

String DaikinACUnit_Mode                    "Air Mode"         (Group_HabPanel_Dashboard) { channel="daikin:airbase_ac_unit:ducted_ac:mode", alexa="ThermostatController.thermostatMode" [HEAT="HEAT",COLD="COLD",AUTO="AUTO",DRY="DRY"] }


The same for Fan speed, which I believe I need modeController.mode, it seems it doesnt discover it presumably because my syntax with respect to the mappings must be wrong.


String DaikinACUnit_Fan                     "Fan Speed"        (Group_HabPanel_Dashboard) { channel="daikin:airbase_ac_unit:ducted_ac:airbasefanspeed", alexa="ModeController.mode" [supportedModes="AUTO=AUTO,LEVEL_1=LOW,LEVEL_2=MEDIUM,LEVEL_3=HIGH"]}

If you refer to the ThermostatController.thermostatMode documentation, it stipulates in the supported metadata parameters that modes are defined as <alexaState>=<ohState>.

Regarding the ModeController syntax, I don’t see any issues with it. Check your server logs. I would recommend though that you use an asset id when one of them matches the mode name you are modeling (e.g. supportedModes="AUTO=Auto,LEVEL_1=@Value.Low,LEVEL_2=@Value.Medium,LEVEL_3=@Value.High"]).

Thanks Jeremy ill give that a go!

When making changes to an item exposed to Alexa, it is better to delete the Device in the Alexa App and launch the discover again after the changes.
It might be a silly thing, but I ran into it and lost quite some time, thinking about wrong syntax in my code…

Usually a discovery request should be sufficient to update your Alexa devices. However, if you made a major endpoint structure change, you could delete the relevant device. That way you can see if your changes are picked up or not.

1 Like