I´m still new to node red. In the past couple of month I successfully connected my smarthome devices from ioBroker with node red to Amazon Alexa.
Since I want to switch to Homekit I am now trying to adapt my logic for Homekit.
I successfully adapted simple on/off as well as dimmable lights logic.
What I´m still trying to figure out is how to adapt the color lighting which is more complex.
To get this up and running I have three problems that need to be fixed:
1. Homekit to Target System
Homekit delivers values as hsv (Hue/Saturation/Brightness) as well as On/Off to control a color lamp.
Problem is, that Homekit only sends the complete set of values (hsv) if necessary and else only the changed values (e.g. only Brightness or only Hue or only Saturation or On or Off etc.).
All values are send as Objects (e.g. msg.payload.Brightness = 100).
Problem is that my target system always needs the complete set of values and it needs them as a string (e.g. "hsv(237,100,60)"), in order to change the status of the light.
I would basically need some kind of cache that stores all values and only sends the complete set as a string.
2. Set back to default value if switched off and on again:
Next problem is that Homekit stores the last config when switching on/off.
It would be great, if I could include a default value for hsv if the lamp was switched off and is switched on again.
If someone then changes the light to red but doesn´t know how to get back just has to turn it off and on to get the default lighting.
3. Update Homekit status if lighting was changed in targed system:
Last but not least I need to figure out on how to change the status messages of my smarthome system in order for Homekit to understand and show the correct status in Homekit.
My smarthome system sends to different kind of strings if tlighting is changed:
temp(47,4464) or hsv(237,100,60).
Both formats are used depending on the type of change (only brightness or also color).
Homekit only understands hsv and the values have to be seperate objects (e.g. msg.payload.Brightness).
Does anyone have any idea how to solve these problems?
Thx and brgds,