Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[question] Are dimmers still scaled down from 0..255 to 0..99 ? #294

Closed
LordMike opened this issue Jan 20, 2021 · 6 comments
Closed

[question] Are dimmers still scaled down from 0..255 to 0..99 ? #294

LordMike opened this issue Jan 20, 2021 · 6 comments
Assignees
Labels
question Further information is requested

Comments

@LordMike
Copy link
Contributor

One of my pet peeves with z2m was that in some cases, it would scale the light values from a supplied 0..255 range to a 0..99 range. I was hoping this scaling wasn't present in zwavejs2mqtt, as it was a new project and it was possible to make breaking changes :)..

I'm seeing logs like this, so I guess it is. Is there a way to disable this scaling?

2021-01-20 22:16:08.328 INFO MQTT: Message received on zwavejs2mqtt/wallswitch_2/38/5/targetValue/set, '16'
2021-01-20 22:16:08.329 INFO ZWAVE: Writing 6 to 38-5-targetValue
@LordMike LordMike added the question Further information is requested label Jan 20, 2021
@LordMike
Copy link
Contributor Author

LordMike commented Jan 20, 2021

I actually may have my own answer.. Gateway.js scales multilevels in those ranges, but unlikc z2m, I can disable that code path by not having hass discovery..

https://github.com/zwave-js/zwavejs2mqtt/blob/3c6b99ec307f09924a962c4bdfc29d0509a95462/lib/Gateway.js#L705-L715

So I've disabled hass discovery.. :)

2021-01-20 22:25:08.331 INFO MQTT: Message received on zwavejs2mqtt/wallswitch_2/38/5/targetValue/set, '16'
2021-01-20 22:25:08.331 INFO ZWAVE: Writing 16 to 38-5-targetValue

@jcam
Copy link
Contributor

jcam commented Jan 21, 2021

With the fix-dimmers branch, this scaling will be removed entirely :)

@LordMike
Copy link
Contributor Author

Fix dimmers branch?

Great if it disappears. You can indicate to HASS what the scale is, if needed, by the brightnes_scale setting. Setting this to 99, makes 99 be the maximum value.

@jcam
Copy link
Contributor

jcam commented Jan 24, 2021

Yes, we did that in the fix_dimmers branch which is now merged to master.

@jcam
Copy link
Contributor

jcam commented Jan 24, 2021

Unfortunately a side effect of switching from the template to the default schema (required to use brightness_scale), is that if brightness is not known, it will no longer send 255, which is the z-wave internal value that means turn back on to last brightness

@LordMike
Copy link
Contributor Author

You can probably achieve that by reporting the payload_on value as 255 .. which in turn would mess with the on_command_type setting ... Hmm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants