ah ok - i remember now
So, setPercentage *should* work - Inc/Dec are for the future, when I get around to it. They require me to get current levels then increment/decrement from that.
clearly something strange going on.
Alexa will pass a percentage value - reading the domoticz API ref:
"Level should be a value between 1 (0%) and 16 (100%). Though in some cases you need to use the percentage, so if 1 to 16 doesn't work for you , then try 1 to 100 (without the percentage symbol)"
However, when I did that, it sets them to weird levels (again, it's only tested against a dummy dimmer).
I've done the conversion again, and it seems to work now (its just the Domoticz.api under node_modules/domoticz-api)
Just as a bug fix though, the blinds should be put back to the correct values in domapi.js (on = On, Off=Off - although they still don't work with Open/Close through Alexa, it is more logical that turn on closes the blinds and turn off opens them. Looking at the Lambda documentation, it seems that the functions should support a type of window blinds, but I'm really not sure how you would call them as Open/Close seems to be a bit tragic.
I built a bridge to B&O kit to do the similar thing to XBMC, but I find that if I'm controlling something that makes a noise - the Dot can't hear me! I tend only to use it to switch kit on and off.
I tried the dimmers and still has the same errors. I'm using lightwave protocols. Maybe that has something to do with it as Domoticz is reporting a completely different value as well - and the Lightwave switches are 1-way.
In your code though, the changeSwitchState procedure - the calc to get the right dimming number is commented out. Maybe I'm not understanding it well enough.
I've always used 1-32 with the JSON call and that works well enough with these dimmers.
It's controlled through the domoticz.js (the API wrapper i use):
if (params.type == 'dimmable')
{
url.addSearch("level", parseInt((parseInt(params.state) / 32) * 100));
//url.addSearch("level", params.state)
url.addSearch("switchcmd", 'Set Level');
url.addSearch("param", 'switchlight');
}
There was a typo (100 and 32 reversed). You also need to add 1 - I've created a pull request in the git. I can say that this is now working well when asking for a certain percentage.