Closed cholawo closed 1 year ago
Another thing to add, I notice this also affects any items that are Group:Dimmer:AVG
since those will very often not be integers. I can't think of any way to ensure that they get converted to an integer without openhab-google-assistant rounding their values.
Thanks for reaching out.
Valid points. Was not aware of such a behavior of openHAB so far.
Will likely implement this soon.
Should be resolved with #425
@cholawo could you verify the fixed behavior?
@michikrug yes I now have percentages shown for light groups in google home app, thanks so much for sorting it out!
@michikrug TL;DR I want to suggest that openhab-google-assistant should round brightness to an integer when sending to Google. Trait docs say brightness should be an integer.
I've noticed that my Google Home app often won't display the current percentage brightness of a light.
I've found the reason: brightness percentage in openhab isn't an integer but something like 33.46456692913385826771653543307087 This happens for me because I'm using the mqtt things and channels binding. I believe I've set that up as it was meant to be:
When it transforms from 0-254 to a percentage, that percentage is understandably not an integer. When I tested setting brightness to integer in openhab, Google Home App does then show the brightness. I appreciate that there are other ways I could transform the number in openhab, but I removed JS transformations when the new mqtt binding gave the ability to transform natively. Also I want to retain the real percentage in openhab as it's useful to be able to convert back to a precise 0-254 number sometimes.