NorthernMan54 / node-red-contrib-homebridge-automation

Homebridge and Node-RED Integration
Apache License 2.0
107 stars 18 forks source link

Copy some HA features #34

Open ahartman opened 4 years ago

ahartman commented 4 years ago

I have been using your Node-Red-Homebridge nodes for some months now to full satisfaction. Recently, I have also played around with Node-RED-HomeAssistant; the nodes are similar, naturally. However, they have some powerful features that would also be beneficial in your plugin. I now require two nodes for each HB item, one to report events rom the node and one to control the node. With 25 lights in Homebridge, that is a lot of nodes. I highlight 3 powerful features from the NR-HA plugin:

  1. The Control Node Device field - entity_id in HA plugin - accepts a comma-separated list of devices; Additionally, the Control Node Device field can be left blank and be filled from the msg.payload, i.e., from a function node. This can lead to a considerable reduction in there number of necessary Control nodes
  2. The Event and Status Node Device field accept a substring or a regex expression; A single node can observe many Homebridge entities.

These features would lead to smaller and clearer flows as you could so the same with fewer nodes.

Regards, ahartman

NorthernMan54 commented 4 years ago

With the Control, Resume and Status nodes, this isn't that complex of an enhancement and should be feasible. The only challenge would be device names/id's, as people have duplicates in their setup and the current pick list approach avoids it as an issue. How does NR-HA deal with duplicate device names? HomeKit has its own internal scheme for uniquely identifying devices, but an end user wouldn't have the ability to self know what these are.

The Event node is a lot trickier, as it creates an event registration into HomeKit/Homebridge to gain visibility into each status change. And this causes an issue, as without the registration no events are passed to HomeKit/Homebridge. I'm not sure if this is feasible.

ahartman commented 4 years ago

I have no idea how HA treats duplicate names as it is so simple to avoid these. Homekit filters the room name from device name: define an 'Office Desk Light' for example. Placing this in room 'Office' makes Homekit hide 'Office' in the device are and the device is displayed as 'Desk Light'.

For the Control, Resume and Control nodes, you could skip the regex and make the select list multi-select.

Maximum flexibility would be when one can send the device name/ID from a function node in msg.