Device value

Hi, is there anyone here who can help me?
I'm trying to understand and get the google dot TTY to tell me what color a light is. (or just understand how the device thing works)
For example, when I change the color of the lamp, it should say.

Office ceiling lamp is +value. This doesn't work

Variablename: LampColor
Type string: "devices.Office Ceiling Lamp.color"
Action: Speak on Hallway GoogleDot(volume: 50): '"${LampColor}"'

Best to screenshot and show your rule. I've just set it up on mine and can confirm this works:

The trigger is Custom Attribute > Lounge Ambient RGB > 'colorName' attribute changing.
The actions are to set local variable > string > device attribute, then pick the device and select the 'colorName' attribute in the drop down selection. I put the 2 second wait there so that if the actions trigger at the same time, that wait ensures that the variable will have updated before it's announced (1 second would do)

Hope that helps.

1 Like


Yes, this is how the rule looks now. How do I get it to work Want Google Dot to say. The lamp is blue, gray or whatever color it is.

I don't understand your rule unfortunately but it doesn't look right. I think maybe you're setting this up wrong. I think you want one rule for the button to turn the lamp on and set the colour, then another as I've shown to set the variable on colour change and announce as I've shown and detailed.

Read my description beneath my rule example as your color is showing null and your variable value looks gobbledygook. Forget $(LampColor), Rule Machine lets you set the string to match the attribute value directly using the dropdown as I explained.

One other thing, if you're setting a random colour, I assume the colour will have to display its colour name somewhere in the device attributes. So whatever the name of the attribute is where you can see the colour (colorName in my example) is the attribute you'll need to pick to write to the variable. If there's no colour named anywhere and just numerical values, it's not going to work and will just be null.