Dimming from app works for other brands of dimmers.
If I manually set the dimming value at the switch and then check the app, it shows the correct dimming value.
But if I move the slider nothing happens.
This is for zooz zen72, but I think this affects all zoom dimmers.
Please provide your hub model (C7, C8, etc.) and its platform version from Settings>Hub Details.
Check out the following post for help troubleshooting problems and gathering details that will help others to identify and solve the problem you are experiencing: ‼ READ FIRST - Before Posting in Get Help
Where are you dimming from in the app? The device page or a dashboard?
What app version do you have? (especially need to know if its old or new 2.x app)
@bobbyD@moncho1138 This is clearly a bug on the device page of the iOS (maybe Android also) mobile app 2.x. It is sending the level as a string value. The docs define the level value as a number.
Here is the code from my custom driver:
String setLevel(Number level, Number duration=null) {
logDebug "setLevel($level, $duration)..."
turningOn[device.id] = (new Date()).time + 1000
return getSetLevelCmds(level, duration)
}
I could change my driver to have level by untyped but then I would also need to assume it may not be a number and attempt to convert to an Number every time so the rest of my code would work.
Asked about this, and there isn't a consensus right now... but we are thinking, at least for now, you should play it safe and to be able to handle (at least) a string anywhere you'd expect a number in the driver when it comes to user-supplied data. There are lots of ways data can come in, including the device detail page, mobile app, different dashboards, and Maker API or other HTTP endpoints; and not all may handle conversion of numbers to actual Number subclasses for you automatically.
Yes, this means there are a few built-in drivers that will be updated, this being one of them.
I have at least 5, in 5 different HPM packages that use setLevel
IMO this is a breaking change from the HE app.
Ran into this same issue a while back with the "pushed" function, the old dashboard sends the button number as a string. Should have learned my lesson I guess.
This is already fixed in Hubitat platform 2.3.9.166 for all stock drivers. Custom drivers are outside the hub's control and may need updates if they would have previously thrown an error on string input.
@jtp10181 I have just found out about this problem with your custom driver last night, tried to dim using the app and nothing happened at all. When setting the level via the app, the command is called but no processed from your driver, but when I call it with the Alexa skill, all works as intended (usually the way we do it).
Basically converting the string being received by the app to an number as expected by the driver, did not go farther by adding the duration possibility of a string also because it might be null and would throw an error, so would need to test for that before trying to convert it to an Integer.
Yeah thats a quick and dirty way to patch it. I have it fixed locally, fixing the main function and the subsequent function that it calls.
I have a bunch of backlogged updates, just takes me a good hour (at least) of focus to tidy everything up and push one package out. Plus I usually update a whole set at once, not a single driver. I go through all the uncommitted changes on each driver line by line to review for any mistakes. Also at the same time making note of changes in the changelog. Copy the changelog to each driver in the set, update version numbers etc... Then I have to compose the changelog for the HPM json file, and update the json file versions and any other changes. Finally, put together a commit with the proper files and notes (I like things well documented). Then after I push the change I do a trial update via HPM to make sure it all works. Lastly I edit my community post and reply to the thread that there is an update.
Well that was a longer explanation than I thought it would be... but that's why I'm slow but also I think why I do not usually have a bunch of little bug fix patches.
This is not really a bug on my end, its a breaking change by HE that I have to patch.