I’ve been exploring the integration of Node-RED with Home Assistant to enhance my smart lighting setup. After successfully migrating from an Ikea gateway, I’m now focusing on using Node-RED to provide feedback from my sensors and switches to Alexa. While the on/off functionality works seamlessly, I’ve encountered some challenges with brightness and color temperature adjustments.
One specific issue I’m facing is getting the brightness percentage and color temperature values to update correctly in Alexa. When I adjust the brightness from 50% to 100%, the state doesn’t reflect the change as expected. I’ve tried modifying the payload to convert the brightness value from 0-255 to a percentage, but it’s not working as smoothly as I’d hoped.
Here’s the current setup I’m using for on/off feedback:
javascript
if (msg.payload == “ON” || msg.payload == “on”) {
return {
“payload”: {
“state”: {
“power”: “ON”
}
},
“acknowledge”: true
};
} else if (msg.payload == “OFF” || msg.payload == “off”) {
return {
“payload”: {
“state”: {
“power”: “OFF”
}
},
“acknowledge”: true
};
}
I’m aiming to extend this to include brightness, color hue, and color temperature. If anyone has successfully implemented this or has tips on how to handle the conversion correctly, I’d greatly appreciate the insight! It would be amazing to have a fully integrated system where Alexa accurately reflects the state of my lights, making my home even smarter and more user-friendly.
Thanks in advance for any guidance or suggestions!