Feature request: Add ability to Dim with Alexa & Google
-
@russ, I don't want to seem pushy but any progress with this?
Since the dim commands are sent I believe 1-100 you could say things like, "Alexa set computer volume 80%", "Alexa, set blinds to 50%"
I use to use the dim option for a number of things beside lights with HA-Bridge. I never played with the color option much but think it sent 1-256 values.
These would allow activating anything that needed to use a variable of 1 - 256 without having to create a separate Trigger for each value required. -
@tuicemen, I'm looking forward to working on this, but currently all my time is going toward preparing to move the servers to AWS. It's a long story by my current host is going to get expensive soon, so it's prompting me to move.
-
@russ Not a problem, my hosting cost were also to go up. I did look else were but for the amount it was getting used I figured it best just to pack it up.
-
@tuicemen , I had a productive day.
I added brightness and color to the Alexa Smart Home devices. Please test it when you get a chance.
The color comes through as the a number representing the "hue". What do you think, should I translate that to standard colors like red, blue, green, purple etc? I'm thinking I probably should. That's likely what people would expect.
EDIT: Nevermind - I went ahead and replaced the number for the common colors with the color name:
if(color == 240) { color = "blue"; } if(color == 348) { color = "pink"; } if(color == 60) { color = "yellow"; } if(color == 120) { color = "green"; } if(color == 39) { color = "orange"; } if(color == 277) { color = "purple"; } if(color == 300) { color = "violet"; } if(color == 180) { color = "aqua"; }
You might notice red and brown are missing. That's because for some reason Alexa sends 0 for red, brown, black, and white, so I figured I'd just leave the 0.
EDIT2: I figured out how to distinguish black, white, red, and brown using brightness and saturation values, so now you can say, "Alexa, turn notepad brown", and it will run notepad with brown as the parameter (assuming you enabled parameters).
-
@russ I gave the dim addition a test run but believe Alexa needs to know if the device is a light or switch.
I get the responce "Table Lamp doesn't support that"
With google I get "Sorry I didn't understand"
I don't have any color lights to test but believe the same would be required for it. Looking back at some other softwares they all had a type field in the json file. In this field was required light, switch or sensor and I believe you could have all listed. After I wake up a bit more I'll look at some old json configuration files. Maybe just changing the json file on my end will allow the dim. -
@Russ I did some more testing. The commands.json file needs to be updated for lights that you wish to dim the deviceType: field needs to be added after the voice: field. (maybe location doesn't matter)
Once the "deviceType":"light", is added and Alexa is asked to discover devices my Lights do indeed dim!
As I stated I don't use color lights here. I may have a few at the cottage but it will be a while before I get there to look. -
@tuicemen , I should have mentioned you need Alexa to rediscover your commands to make new devices with the new brightness and color properties. One way is to change the command in the commands.json file (or GUI Editor) so it gets deleted and recreated. Another way is to delete all of your devices and rediscover them using the buttons at the bottom of your Smart Home device list at https://Alexa.amazon.com.
-
@russ I just tested with Google and I can't get lights to dim with it. So maybe something different needs to be done for it.
The edit to the commands.json file definitely needs to be there for Alexa maybe Google is looking for something else (different wording) in that file? Maybe you just haven't looked into Google yet! -
For Anyone else wishing to have diming this is what works for me .
I had to remove each dimable light from Alexa then do a rediscover. -
-
This is actually wrong ^. "deviceType":"light" is not a thing.
If adding that made it work, it's because when you change a command, TRIGGERcmd deletes and re-creates the Alexa smart home device. That needed to happen for the Alexa device associated with your command to have the new brightness feature.
Sorry I didn't tell you that sooner. Any newly created commands will have the new brightness and color features. Old commands just need to be changed so they get re-created. Or you can delete and re-discover them at https://alexa.amazon.com.
Also btw, only Alexa supports brightness and color so far. I'll look into Google Assistant soon.
EDIT 3/21/22: The "TRIGGERcmd Smart Home" action on Google Assistant supports color and brightness now too.
-