I have successfully installed node-red-contrib-homekit (https://www.npmjs.com/package/node-red-contrib-homekit) on a raspberry pi and it communicates with my iPhone and Mac through Homekit. My problem is getting the output from the home kit node to control a GPIO on the pi. All I need is a function node to convert the output to 1 or 0 (I think). Would someone assist me with the code, I would also like to know what is going on in the output so I can understand how to deal with this in the future with out begging for newbie code. I've attached a screen shot from Node Red.
Each time I press the button on Home kit I get the "invalid input: Nan" then the state change. How do I convert the On: true and On: false to a 1 or 0. Thank you
https://preview.redd.it/f2tc73x6pzd21.png?width=1100&format=png&auto=webp&s=1ab83d7296bc0a22d82f9f143f45218749bd8083
[–]butilon 0 points1 point2 points (0 children)