How do I get the current dimming level for a device>

Even after I use setLevel to set the dimming level and the light indeed dims to that value I get a null value for the level attribute. How can I get the current level?

Sounds like your missing the correct parser for the devices status update.
Go through the stock dimmer devices, use that as a starting point.

Set the “level” attribute as well. Just note that some device brands do not report their physical levels instantly.

Parsing – i’m using existing devices so am at the mercy of the generic parsers for Z-Wave and Zigbee switchLevel devices. The log implies that the parsing is happening but it is getting lost somewhere.
I did see 57e36001-1441-4e5e-bd91-aa4fbb59a7e5 8:52:34 PM: debug Parse returned [dim16 is on, dim16 dimmed 50 %]
so something somewhere is parsing the command

As to setting the level I added “device.level = level” but it didn’t seem to make any difference. What is the correct way to to this

A pointer to code snippets would help a lot since there are so many implicit assumptions in the ST world.

Now things have gone downhill. I"m not even getting on/off reported properly even after I removed the “device.level = level” code. This is a real problem as I try to make production use of SmartThings.

Post your code (github link preferred) and I’m sure we can provide assistance.

Don’t worry, once it clicks, it’ll all make sense.


OK – what are the steps to putting it on github? (I also ran into a reflection bug but just found a way to comment out enough code to avoid that bugs)

To add injury to insult I can’t reach the SmartThings server so that any connected apps in my house no longer work! How can an app send a message to a device without going through the frozen cloud?

Just to clarify now that things are working. As long an app is entirely within the ST world then maybe it can work but I am connecting external applications through the API and that API must go through the ST site. For any serious use I need to speak to local devices - ideally as peers but at least through a local hub rather than having every last operation go through a cloud that is far far away. The idea that I can’t turn on a light if I can’t get to the cloud and if that cloud is foggy is not acceptable in the real world.