The PM10Density shows this coming out of HomeKit:
Input is:
msg.payload={"PM10Density":4}
Thanks that seems to work for me as well!
Thanks for your help!
And for the second problem! I have found my error.
if(msg.payload.hasOwnProperty("On")) {
if(msg.payload.On === true) {
msg.payload = "ON";
}
else {
msg.payload = "OFF";
}
return msg;
}
I check it like that to see if that parameter should be updatedā¦
Iāve been searching on github and found an example where the āold versionā of node-red homekit changed all the ā.ā (dots), for example PM2.5Density, to ā_ā (underscore).
I donāt know how to do pull requests github but Iāve figured out how to fix the issue.
This is the repo we are using:
We need to change line 188 of homekit.js from:
var key = info.characteristic.displayName.replace(/ /g, '');
to:
var key = info.characteristic.displayName.replace(/ /g, '').replace(/\./g, '_')
and line 200 from:
var cKey = characteristic.displayName.replace(/ /g, '');
to:
var cKey = characteristic.displayName.replace(/ /g, '').replace(/\./g, '_')
Then youād be able to send the following into homekit in node red:
{"PM2_5Density":6}
So if you know how to make a pull request / build github code / install it in node-red⦠That would be a solution. Because yes Iāve confirmed the issue is indeed with the ā.ā
Ha! I got it!
I went to this file on my pi: (sudo nano)
~/.node-red/node_modules/node-red-contrib-homekit-bridged/homekit.js
And changed lines 188 and 200 as I described above then restarted node-red. Now I can send PM2_5Density into and out from HomeKit in node-red.
Thanks!! Will try that now!
Thanks it is working now!
Another thing which I might not understand:
If I donāt specify at the brightness item that it should be ItemCommand, it wonāt do anything if I change the brightness through HomeKit. If I specify it as a command, if I change the brightness, it will start a loop, because the HomeKit node always sends out the item update, even if it is not triggered through HomeKit.
Did you have a problem like this before?
Yes I tried to explain that up above. Read back through the part about
if (msg.hap.context!==undefined)
Thanks and sorry! That what I was looking for!
Thank you! I have almost finished my setup with Node-RED (I donāt have that much stuff yet and implementing not dimmable switches are easy) just some final touches and tests needed. If anyone interested I have implemented the following not so ātrivialā things:
Once you understand how HomeKit works it is not so bad to implement these things. The only key on for example Air Purifier, that it has two states, current state and target state. And after you set the target state you should send a current state to that device 1-2s later to not just show āTurning on/offā¦ā
There is a pretty good documentation on Appleās site which can help which commands are accepted at a device type (and which one is required and optional) and also get some info how you should send the commands.
I have also tried implementing āSpeakerā device into HomeKit, but it said that this device is not supported yet. Iām on iOS12. Would be great to control volume from HomeKit. Maybe @crxporter do you know why this happens?
Later I would like to implement camera streams and a few other things. It seems better than the builtin HomeKitā¦
I am pretty sure there are other apps that support these devices through HomeKit. I think elgato eve is a popular one.
I use AirPlay for my music so Iāve never been concerned with volume control but I believe itās possible along with some basic media control if I remember right from my pre openhab days when I used homebridge.
Yes please! That would be helpful to see those devices especially for the SecuritySystem with code setup(a keypad pin code to set the state for the SecuritySystem)
btw, @rkrisi, @crxporter, one more question for you guys:
Did you guys somehow knows how to push an in app notification when the air quality gets worse?(eg. PM2.5 sensor), I believe homekit natively doesnāt support this function(only support notification for the motion, contact sensors I think?), so how do you guys deal with this?
I currently have to create a virtual ācontactā sensor inside node-red, so that when PM2.5 gets high->trigger the virtual contact sensor to ON state->then push the in app notification⦠but this workflow looks stupid and needs one virtual contact per air quality sensor(I have many of them), plus notification text is saying ācontact being turned ONā, not āPM2.5 poorā, which makes other people a bit confused when receiving such in app push text.
The SecuritySystem is not fully complete yet (not tested) but I havent found an option to set PIN code for the SecuritySystem. For the air quality sensor⦠Iām sending the PM2.5 value to the sensor and I calculate an AirQuality value (you can see the accepted values for this in the Apple
docs, somewhere around a 0-7 scale) and send that also to the Sensor item. Today I was able to see that if the AirQuality value is greater than 3, it will trigger that sensor (like the motion sensor when detects motion). However you canāt set an automation or notification to that sensor. Weirdā¦
This is a limitation of the HomeKit app. It only will notify for doors, windows, contact sensors, smoke/carbon monoxide sensors, motion, locks, and security systems.
The option might be available in the elgato eve app - it has several options that appleās app doesnāt have. The ones I remember looking at are it can run an automation based on when an outlet is āin useā and have conditions on whether that will run. I ultimately decided it wasnāt useful to have that (all much easier to do in openhab) so I didnāt pursue further options in that.
Security system has been on my list of things to play with for a while⦠Generally the HomeKit security system is just there to turn on/off an actual security system. Iāve looked a little at building a security system programmatically through node red and/or openhab. Maybe Iāll fiddle with that next week⦠if I get it Iāll come back here to add to my tutorials.
If I understood correctly - homekit doesnāt actually use codes for this. It just assumes authentication is complete if your phone (or watch) is unlocked. Similar to a garage door or door lock.
So if youāre connecting to an openhab security system for example, youād put the pin code into node red then use homekit ādisarm security systemā as the trigger to send that code on to node red.
Again I havenāt actually done this except for looking for like 5 minutes at to see if it works⦠perhaps these comments will lead you in the right direction.
Yes thatās what I thought of as well. My original implementation for openHab is the same, it wonāt ask for the PIN code, you can just toggle the Arm/Disarmā¦
So for now, almost everything works, except I canāt control my Air Purifier and RGBW led color channels from HomeKit. These are under implementation
Anyway it works really good, Node-RED uses minimal resources and the HomeKit connection is stable
Hi, how to add a rtsp camera stream into node red homekit? Thanks~
As I understand this setup doesnāt work for camerasā¦
Hereās some information - feel free to look through it, Iād be interested if you get this workingā¦
https://github.com/oliverrahner/node-red-contrib-homekit-bridged/issues/16
I have read this topic with great interest.
I would like to use node-red + homekit for the first time
Installed on Raspberry + Openhab + Node-red, everything is ok
I installed node-red-contrib-homekit-bridged via Manage Palette, but I see a red triangle.
The service homekit-service and homekit-bridge are not green.
Iāve never seen this error but it seems like you might already have homekit installed in node red. Itās available from various developers - take a look at your āinstalled nodesā in the manage pallete screen to see if HomeKit is in there.
Also check your available nodes in case homekit is there and ready to use.
I had to reinstall everything, now it works
Openhab 2.4.0M5 + Node-red + node-red-contrib-homekit-bridged + Bindings Openwebnet
Node-Red ⦠one word ⦠fantastic !!!
Some questions :