Returning Current Status of an Object

While watching Brian’s video on data triggers, he is setting up a mute button to get the current status of the mute toggle. If I wanted to apply this to a slider to get the current state of brightness for my lights in a device browser what would be the triggers? Is there a list somewhere that shows what attributes apply to what? for example is it true/false,on/off,muted/unmuted or in my case return a numerical value to set my slider to a current state. I hope this makes sense.


You don’t really need any triggers to get the current state of something. To display the current brightness just bind @Device.Level to a Label’s Text. So where he chose “.Mute”, you’ll choose “.Level”.

Yes, there is a list. The Capabilities page in the docs shows all of the possible Enum values for a given Attribute.

What you said Partially works. When I boot the simulator these are the numbers that show up but when I use the slider the numbers realign 1-100%.

So it is not reading the output initially. So how do I adjust the max Value it is currently at 0-100%. I also need it to not read the lights that are off I should be able to use a property or data trigger on @Device.Switch to remedy the lights that are off Correct

What type of controller are you using? You should never see anything above 100% so something is wrong.

It is a Tuya Light Bulb. When I click the slider it straightens itself out but even the light bulbs off are reading brightness levels that should not be

Are you using the Tuya Smart or Smart Life app? Can you share one of these bulbs with me so I can test it?

Sure I can send you the details in a message. Currently I am testing the one that lists DeskLight not Desk Light. I am using Tuya Smart sorry

At what level of brightness is DeskLight in the Tuya Smart app?

The JSON data for your light currently has an integer of 410 for the brightness. I thought the raw data for all Tuya lights was 0-255 so that’s why it’s behaving so strange. I’m not sure what 410 represents. I’m guessing maybe it’s 410 out of 1000, so is the light actually at 41% in the Tuya Smart app?

Sorry I was away but yes it is 41% and that makes sense when I setup a scene I found it frustrating and strange that the brightness goes to 1000. Forgot about that till you mentioned it

So i need to set the value to 1000 max I am assuming

No. This isn’t anything you can fix. The Home Remote is trying to do the scaling for you. But it’s assuming Tuya lights are 0-255. I’m not quite sure how I want to address this right now. I’ll revisit this tomorrow & let you know.

That is fine like I said it just doesn’t reflect the state on start. But once I click it it corrects so not a problem right now but I will leave it in your hands than. Are you free from my account now or do I need to wait for you some more. No rush

What happens when you change the range in the Home Remote? When you set the slider to 80% in Home Remote does the light actually go to 80%?

Again, the Home Remote should be sending a value no greater than 255. If your light is using a 0-1000 range then the brightest the Home Remote will ever set it to is about 25%.

You can go ahead & connect again. I’m probably done with it for the evening. I will probably look at again tomorrow though but I’ll let you know.

When I tested it at home it does seem to brighten and dim normally if I turn it all the way down it goes off and up seems to be normal brightness you would expect for a 60w equivilant bulb. But like i said once I touch the slider the numbers reflect properly. But I do remember the the scene creation that it is a 0-1000 range. By the way I sleep during the day so feel free to tool around all you want in there.

To help limit unnecessary polling, the app just forwards the sent value to the attribute on a successful request. That’s why it reflects properly after changing it. After 4 minutes when it sends a polling call to the cloud, it’ll jump back up again.

I see well I will check the controls in the morning and see how the light behaves and let you know. before I go to bed. Thanks for your help

I take that back. My statement about the 25% max was incorrect. The Home Remote actually sends values scaled between 0-100, so the same value as the slider. This API is a little goofy, the value you send isn’t always scaled the same as the status it reports back. I still don’t understand why your light is returning a value of 0-1000 & my light is returning a value of 0-255. I’m actually currently using the “Smart Life” app for my light. Tomorrow I’m gonna pair it with the “Tuya Smart” app & see how it behaves. Maybe “Tuya Smart” paired devices use different scaling.

I was using smart life to begin with but it did not want to always sync with google home. Someone posted to use Tuya Smart instead and it would work better. So far it has run alot bettter. Something else I noticed I have some white dimmable bulbs that dim in tuya and google but on every platform I have played with home assistant and this one they are registered as switches on their cloud and I am unable to change the brightness.

So I paired my light with the Tuya app & it is still reporting back a value scaled 0-255. In the next release I’m thinking about adding 2 conditions so things scale properly for you.

#1 - If I see the light returns a value greater than 255, I know it’s using a 0-1000 range.
#2 - All of your lights share the same icon URL. If I see an icon that matches this particular URL, then I know it’s of the 0-1000 range. (FYI, that URL is hidden from you but it’s something I see in the raw JSON)

I also found too, that when I set your DeskLight to 50%, in the Tuya app displays 450. When I set it to 60%, it display 560 in Tuya. When I set it to 90%, it displays 890 in Tuya. So just be aware that the set values won’t match exactly but they will be close.

Yeah, I see what you mean about the lights being reported as switches. I looked at the JSON and both “Back Door Light” & “Closet” are shown as switches in the JSON lacking brightness/level control.

Sounds Great! Thanks for taking the time to look into this. What is weird about those “switches” is they have brightness control on the Tuya app.But it does not matter I am going to change them soon probably. These are the Merkury Innovations ones I got from Walmart. That started my home automation adventure.