NRCHKB / node-red-contrib-homekit-bridged

Node-RED Contribution - HomeKit Bridged : Node-RED nodes to simulate Apple HomeKit devices.
https://nrchkb.github.io
MIT License
416 stars 52 forks source link

[Help needed]: How to take input (or read a value) from Home app #435

Closed satwikkansal closed 3 years ago

satwikkansal commented 3 years ago

Your Current NRCHKB Plugin Version

No response

Operating System

No response

How can we help?

Hello @crxporter :)

I'm using homekit node to pass temperature information from a sensor to a TemperatureSensor service that I've then added in the Apple Home app. The flow of information in this direction works fine.

However, what I'm not able to figure out is how to make the information flow in the opposite direction. For example, I'd like to add an accessory in my home app whose widget would let me on/off a programmable switch or let me write some custom value in an input box. And then, I'd like to read this value in a node-red node. I tried StatelessSwitch and StatefulSwitch but on adding them to Home app, it said unsupported accessory.

Can you please let me know if that is even possible? And if yes, what should I try to achieve something like this.

Thanks in advance :)

Any more details?

If this is specific to some hardware or specific software version, please explain here.

Any code or functions to add?

No response

crxporter commented 3 years ago

What if you try using just "Switch" item? You should be able to set it up like this screenshot then watch the nodered debug panel. You will see messages like {"On":true} and {"On":false} coming "out" of the homekit switch service. This service is two-way meaning it sends to homekit or receives from homekit.

Screen Shot 2021-09-07 at 9 34 59 AM

The stateless switch item is used for a button device or a doorbell, it is one way "in" to homekit.

satwikkansal commented 3 years ago

Okay, got it, using just the Switch is what I had to do, thanks :)