Open faronov opened 5 years ago
You can check an example of how it can be extended that will add the possibility to create any services and any accessories https://github.com/RavenSystem/esp-homekit-devices/blob/master/devices/common/custom_characteristics.h
Please see: https://github.com/KhaosT/HAP-NodeJS/blob/master/lib/Characteristic.js#L21
Shouldn't be difficult to integrate, i.e. probably just setting a custom UUID.
An example of an custom characteristic AtmosphericPressureLevel can be found here: https://github.com/rxseger/homebridge-bme280/blob/master/lib/CustomCharacteristic.js#L12
@faronov @fschaefer I finally made up my mind to look at this and add it in near future.
How do you see it to be used actually? Is it for using Eve? Or other apps? How do you see adding custom characteristics? Should we add them to code or allow users to add them?
Bump. Your opinion is important for me.
Currently this available for Eve, not sure about other apps I think we must allow a user to specify any UUID for custom characteristic and add details
Can you make an example of such? I mean details of custom characteristics.
check this https://github.com/RavenSystem/esp-homekit-devices/blob/master/devices/common/custom_characteristics.h#L27 it has a bunch of custom characteristics
this also a good example https://github.com/rxseger/homebridge-bme280/blob/master/lib/CustomCharacteristic.js#L12 Apple did not support pressure for sensor but eve support it if you wish to add this information to show in eve app you just add eve defined UUID for that and it will show up in eve app
this is also a good example https://github.com/simont77/homebridge-weather-station-eve it will not only show all weather details, but it will show graphic history like that https://i.imgur.com/8opO7hel.png
@Shaquu maybe some sort of config option to 'define' them on the bridge, and then have the available by pretty name on the services? (Or in the fancy UI once that gets implemented)
I'll probably also be using a few of them to map some of the stuff my Aqara zigbee sensors data so that I can view it in Eve.
Hello! A good example for custom characteristics is Samsung's air conditioner with WindFree mode. Right now neither "thermostat" nor "coolerheater" item allows to push such a mode to the A/C and of course - this is the one I use most often :-) Only the standard ones like: Heat / Cool / Dry / Auto are available.
Part of the device status response:
"airConditionerMode": { "supportedAcModes": { "value": [ "aIComfort", "cool", "dry", "wind", "auto", "heat"
After update of Samsung Automation Studio (v 1.0.11) my device accepts / reports following parameters: Samsung_Avant_Windfree_1.0.11
Feature is ready to be tested on dev branch.
{"Test": true}
should be enough)Heads up all, this is being built now. We are looking for feedback on the best way to handle it. Please join the discussion on discord if you have thoughts!
From now on this feature is labeled as experimental.
To enable it run node-red with NRCHKB_EXPERIMENTAL=true
env variable.
hi everyone, I’d like to test the functionality and with some tinkering have the newest dev version (38) running on nodered 1.2.9 (in a docker container).
The package shows up and so does the nodes relevant to this, but for some reason the NRC* node doesn’t show up in my palette:
Am I missing something? Some hidden handshake to drag it to my flows?
Are you running with experimental mode as described by Shaquu in the comment just above yours? I haven't actually tried this feature yet but I'm following along a bit.
As said @CaseyRo read my previous comment :) You need to start NodeRED with special parameter.
https://github.com/NRCHKB/node-red-contrib-homekit-bridged/issues/52#issuecomment-790752453
I was aware of that part - so I added it to the docker composer setup as an environment variable (and the node specific project variable too, to make sure this works):
unfortunately, still no node showing up in my palette. I could build a separate docker image to have this env variable around when launching, would that make a difference? (I guess not, but you’re the expert here!)
First thing, add DEBUG=NRCHKB* env variable. Start container and share the logs from boot.
Second consider using our image nrchkb/node-red-homekit
2021-03-23T17:30:39.676Z NRCHKB:HAPHostNode [CYB:7371888d.19c8e] Creating Bridge with UUID 00989278-93fe-4160-a9a0-2d8265ffef59
2021-03-23T17:30:42.303Z NRCHKB:HAPServiceNode [testkees:a177d0d.8518bb] Starting Parent Service
2021-03-23T17:30:42.314Z NRCHKB:AccessoryUtils [testkees:a177d0d.8518bb] Looking for accessory with service subtype 7504ba4e-507a-4ced-aba9-ada697d1958e ...
2021-03-23T17:30:42.315Z NRCHKB:AccessoryUtils [testkees:a177d0d.8518bb] ... didn't find it. Adding new accessory with name testkees and UUID 0c3e7fad-ad90-41f3-9d37-ea8395cd233c
2021-03-23T17:30:42.322Z NRCHKB:AccessoryUtils [testkees:a177d0d.8518bb] Bridge now has 1 accessories.
2021-03-23T17:30:42.323Z NRCHKB:ServiceUtils [testkees:a177d0d.8518bb] Looking for service with UUID 7504ba4e-507a-4ced-aba9-ada697d1958e ...
2021-03-23T17:30:42.324Z NRCHKB:ServiceUtils [testkees:a177d0d.8518bb] ... didn't find it. Adding new ServiceLabel service.
2021-03-23T17:30:47.330Z NRCHKB:HAPHostNode [CYB:7371888d.19c8e] Publishing Bridge with pin code 123-45-678 and 1 accessories
2021-03-23T17:30:47.359Z NRCHKB:BridgeUtils [testkees:a177d0d.8518bb] Bridge published
Logs filtered on NRCHKB.
Why would I use your docker image? I'm a bit cautious to simply assume that is better - happy to run a separate docker instance to test if that makes sense (for testing)
Regarding the image I would say that if you are comfortable with your own set up then there is no need to move to ours. Thing is that sometimes people use strange images/setup like iostack which is less easy for us to debug.
Regarding logs, are you sure you did not skip some? Check first lines after node-red starts. If you don't see what I see then probably you are not passing the experimental flag properly.
Welcome to Node-RED
===================
24 Mar 23:51:53 - [info] Node-RED version: v1.2.9-git
24 Mar 23:51:53 - [info] Node.js version: v14.15.4
24 Mar 23:51:53 - [info] Windows_NT 10.0.19042 x64 LE
24 Mar 23:51:55 - [info] Loading palette nodes
24 Mar 23:51:57 NRCHKB-Error Experimental features enabled +0ms
Here you go @Shaquu:
I already spotted I'm running NR on an older Node version - maybe that's a key here?
Great. I think I have found a bug so please update to latest dev.
Thanks @Shaquu! It's there! I'm testing it once my workday is over! excited
@CaseyRo just be careful and backup what you have ;) It's called experimental for a reason.
@CaseyRo just be careful and backup what you have ;) It's called experimental for a reason.
yes sir, especially with adding new accesoires to homekit 😀 (home+ is great for backups of that)
@Shaquu I've added an custom characteristic but it seems that it is not loaded into HomeKit. I want to add PowerUsage for a Fritz DECT 200, so I can build an automation based on the current power usage. I called it "Watts" and added {"Watts":true} to characteristics properties. But nothing happens.
BTW: Would it be possible to make the unit field not a dropdown but an input field? Because I need the unit "W" and "kWh"
@Tyraenor few things. Custom Characteristic will not appear in Home.app most of the time. You can see it in alternative apps like Eve. Possibly Custom Service will bring additional features.
Regarding watts, list is made from HomeKit specification so there is no possibility to add custom I believe.
@Shaquu Yes I know that, sorry for not being clear about the fact, that I looked into Eve app for that. My problem is, that I want to see the current power consumption in the Eve app. It works when using other platforms like Homebridge or ioBroker. So I was hoping that I can achieve a similar thing in Node-RED, too.
What I basically want is the service Outlet, with the Community Characteristic "Watts" or "PowerUsage", which has the UUID E863F10D-079E-48FF-8F27-9C2605A29F52.
This feature is experimental and still in active development. If it does not work I can promise it will once we are done with it. Can you give me details regarding your configuration for custom characteristic? I might try it myself later :)
The first issue is, that I cannot select the correct unit in the custom characteristic editor, which would be "W".
See my screenshot of the editor and my homekit node.
Currently there is no way to remove a custom one after it has been added right?
Edit: I guess one could delete .node-red/nrchkb/:hash:
while node-red is not running, but not tried yet.
If "String" is selected, the parameter is not passed to the device.
Edit: I guess one could delete
.node-red/nrchkb/:hash:
while node-red is not running, but not tried yet.
I removed the file and node-red no longer complians, I've abanonded this for now :( It kept complaining about validValues.
@Tyraenor Units are set up according to HomeKit Specification. If you believe that other values are allowed (will not break HK) then I can add an option for a custom value.
@sjorge
Characteristic Properties
{
"Volt": true,
"Ampere": true,
"Kilowatt-Hour": true,
"Watt": true
}
Changes to this feature will be released in 1.4.0 and Custom Characteristics will remain as experimental.
To enable start node-red with NRCHKB_EXPERIMENTAL=true
https://nrchkb.github.io/wiki/discover-more/experimental/#getting-started
@Shaquu thank u for this nice feature. It is possible to enter custom units in the form? When i update the json, it works fine, but the UI overwrite it :(
Hi, for your first question change Uint
to Int
and for the second, unfortunately no it is not possible to have custom units 😭
Just to note, upgrading to 1.7.0-dev.1 I needed to re-add my custom ones. It seems the hash changed to a more secure one.
@sjorge
upgrading to 1.7.0-dev.1 I needed to re-add my custom ones. It seems the hash changed to a more secure one.
can you please figure out what in particular you have done? The first issue I saw with 1.7.0.dev.1 , none of my custom characteristics setup is working anymore. After restoring backup of the 1.6.0.dev, the custom characteristic was working fine again.
I just added them all again manually.
After I noticed that the file they are saved under had a new hash, that is longer.
@sjorge
I just added them all again manually.
...means what inparticular Deleteing this from your flow:
and add it completely new from scratch?
Yes
I think this will be a good idea for the roadmap just add a possibility to create any custom characteristic like add any UUID type and name for that? it will be allowed to add any custom characteristic to EVE app.