Closed satiromarra closed 2 years ago
I am having this same issue and unable to get the proper brightness value. Any fixes for this?
For now you can write an apply function which converts the incoming floating point number to an integer to get around this.
I am tempted to relax the validation by converting numbers to integers automatically, but I haven't had a chance to make this change yet.
Actually, rereading the issue I may have misunderstood the issue. I need to reproduce...
Do you have a sample Config and a sample MQTT message which causes this issue?
config:
"accessories": [
...
{
"accessory": "mqttthing",
"type": "lightbulb",
"url": "mqtt://xxxxxx:1883",
"mqttPubOptions": {
"retain": true
},
"topics": {
"getOn": "DimmerRgb1",
"setOn": "DimmerRgb1",
"getRGB": "DimmerRgb1/rgb",
"setRGB": "DimmerRgb1/rgb"
},
"integerValue": false,
"onValue": "on",
"offValue": "off",
"retain": true,
"name": "RGB"
},
...
log:
[RGB] Ignoring invalid value [29.01960784313726] for Brightness - not an integer
Steps to reproduce error: In iOS or macOS, open Home app, next activate RGB item and select any color, then view the log file.
@satiromarra's description above matches mine, but if you need my config as well I can provide it. It seems the brightness value is being derived from the RGB values instead of from an MQTT message, so I'm not seeing a way to fix this in my config.
Thanks, both. Very helpful. Sorry, I had initially misunderstood.
Should be fixed in version 1.1.39.
Updated and works perfectly. Good job! Thanks a lot
When a device is defined as RGB or HSV, the Brightness value received is float.
[RGB] Ignoring invalid value [29.01960784313726] for Brightness - not an integer
The configuration does not allow modifying the Brigthness value:
If topics.setRGB is populated .... brightness, hue and saturation topics are ignored.
If topics.setHSV is populated, a combined value is used and any individual brightness, hue, saturation and color temperature topics are ignored.
Posible solution in "function isValid" add a condition before check "isInteger":
after: