Closed MyOzCam closed 2 months ago
So basically you would like to hook into nrchkb/HapNodeJS internals? I don't see a problem, actually feature which will allow that is planned (plugin system).
I think the get event is called when the home app opens up and "refreshes" the item state? If I understand, basically you want to poll another api in nodered whenever someone opens up the home app, right?
Yes. I believe “get” event is there for this purpose.
Second output will contain
msg.hap.event
Together with NRCHKB 2.0.0 onSet and onChange will be merged into unified output called events It will output data for all event types defined below:
Until then node service2 might be released as experimental feature.
Node output will look like:
type HAPServiceNodeEvent = {name: CharacteristicEventTypes, context?: any}
type HAPServiceNodeOutput = {
payload: { [key: string]: any }
hap: {
oldValue?: any
newValue?: any
context?: any
event: HAPServiceNodeEvent
session?: {
sessionID?: SessionIdentifier,
username?: HAPUsername,
remoteAddress?: string,
localAddress?: string,
httpPort?: number,
}
}
name?: string
topic: string
}
Anything with ?
is optional and anything without will always be defined? It's looking good!
All of these messages are from one single output, correct?
Indeed,? means that undefined is allowed so value can be empty :)
So a switch node watching for
msg.hap.event == "onSet"
we would expect to see the same output as current first output?
This is available now in "experimental" using Service 2
node!
@Shaquu can you provide or point us to some quick nodes on how to enable experimental?
@crxporter here it is described how to enable experimental mode https://nrchkb.github.io/wiki/discover-more/experimental/#getting-started
What's the schedule to move this into the standard ... perhaps (initially) as an alternative node?
@ralphwetzel no schedule :) Sorry, doing my best. If it ever reaches stable, I will post a huge banner on a website somewhere!
Can we make a new output to fire whenever a HomeKit controller request the current value of the characteristic?
It could be necessary when the HomeKit node is used to control a TV which is based on webService API. Currently I am triggering a query to the TV periodically (say 1 min) to update the latest status of TV to Homekit node. So, currently status displaying on home.app may not be real time. If we can have a 'get' event output, we can fire an trigger of query to update the latest status in almost realtime.