Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Split endpoints into separate accessoires #517

Open
Bartus78 opened this issue Sep 10, 2022 · 7 comments
Open

[Feature] Split endpoints into separate accessoires #517

Bartus78 opened this issue Sep 10, 2022 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@Bartus78
Copy link

Problem description
I would like to have my Danfoss Icon thermostats (https://www.zigbee2mqtt.io/devices/Icon.html) that are endpoints in one device, visible via Homebridge in separate rooms in homekit.
With homekit's own option to display the individual devices separately, it is not possible to disperse them over several rooms.

If you try to do that, you still cannot move one thermostat to the kitchen and another one to the bathroom. If you move one sub-device to a room, all the others move there too.

Suggested solution
Option to split up multiple endpoints into separate accessoires.

@Bartus78 Bartus78 added the enhancement New feature or request label Sep 10, 2022
@itavero itavero changed the title [Feature split multiple endpoints into separate accessoires] [Feature] Split endpoints into separate accessoires Sep 14, 2022
@itavero
Copy link
Owner

itavero commented Sep 25, 2022

I'm not sure how straightforward this will be, but I think this should be doable.

It will require some manual configuration, for which I see several options:

  • Configure a certain device (either by serial number or friendly name) to split up all endpoints into separate accessories. In other words, have a boolean configuration option to either expose it as a single accessory (current behavior) or split up all endpoints (new behavior).
  • Configure a certain device (either by serial number or friendly name) to split up specific endpoints into separate accessories and leave all remaining endpoints in the "global" accessory. In other words, provide an array of endpoints that should be split into separate accessories.
  • Configure a certain device (either by serial number or friendly name) to split up sets of specific endpoints into separate accessories. In other words, you'd get an array of arrays in the configuration and the endpoints listed in the same array would be combined in the same accessory.

The first option is probably the easiest to implement, but might not always result in the best user experience.

I'd also have to see if all exposes information from Zigbee2MQTT always contains an endpoint.

Additionally, ignoring things based on the endpoint they belong to might also be a logical feature. Probably easier then excluding a lot of individual keys.

@Bartus78
Copy link
Author

Bartus78 commented Sep 25, 2022

Thank you.

I would say in my use case, option 1 would already help out. Of course options 2 and 3 leave room for more specific solutions. However, I am not aware of other z2m devices that give rise to the same problem. Options 2 and 3 do make setting it up more complex...

@itavero
Copy link
Owner

itavero commented Sep 25, 2022

I also recall someone with a dual gang switch or dimmer that also had the actual lights (endpoints) in different rooms.

I guess option 1 is also the easiest for most users as it keeps the required configuration to a minimum.

First thing I'll check is if there are properties in any of the exposes information for any of the devices that do not have an endpoint specified.
If that also occurs, I have to think about how to deal with those scenarios as well.

@itavero
Copy link
Owner

itavero commented Sep 30, 2022

I did a check if there are devices that have entries in there exposes information that define an endpoint, but also have entries that do not define an endpoint (not taking linkquality and battery into account).

While generating the list below, I noticed that composite objects sometimes define an endpoint but its features do not. In that case the endpoint should be "inherited" by the features as well, even though it's not explicitly defined.

In the last release of Zigbee2MQTT there are 63 of those devices:

  • Aurora Lighting AU-A1ZBDSS:
    • Endpoint UNDEFINED: brightness
    • Endpoint left: state_left, power_left
    • Endpoint right: state_right, power_right
    • Notes: has a property to change the backlight brightness of the device. This would currently not be used by homebridge-z2m though.
  • Custom devices (DiY) DNCKATSW002:
    • Endpoint UNDEFINED: action
    • Endpoint left: state_left
    • Endpoint right: state_right
    • Note: Actuators have separate endpoints, but buttons (action) is combined into one (without an explicit endpoint).
  • Custom devices (DiY) DNCKATSW003:
    • Endpoint UNDEFINED: action
    • Endpoint center: state_center
    • Endpoint left: state_left
    • Endpoint right: state_right
    • Note: Actuators have separate endpoints, but buttons (action) is combined into one (without an explicit endpoint).
  • Custom devices (DiY) DNCKATSW004:
    • Endpoint UNDEFINED: action
    • Endpoint bottom_left: state_bottom_left
    • Endpoint bottom_right: state_bottom_right
    • Endpoint top_left: state_top_left
    • Endpoint top_right: state_top_right
    • Note: Actuators have separate endpoints, but buttons (action) is combined into one (without an explicit endpoint).
  • Custom devices (DiY) ptvo.switch:
    • Endpoint UNDEFINED: action
    • Endpoint l1: state_l1, l1
    • Endpoint l10: state_l10, l10
    • Endpoint l11: state_l11, l11
    • Endpoint l12: state_l12, l12
    • Endpoint l13: state_l13, l13
    • Endpoint l14: state_l14, l14
    • Endpoint l15: state_l15, l15
    • Endpoint l16: state_l16, l16
    • Endpoint l2: state_l2, l2
    • Endpoint l3: state_l3, l3
    • Endpoint l4: state_l4, l4
    • Endpoint l5: state_l5, l5
    • Endpoint l6: state_l6, l6
    • Endpoint l7: state_l7, l7
    • Endpoint l8: state_l8, l8
    • Endpoint l9: state_l9, l9
  • DIYRuZ DIYRuZ_Flower:
    • Endpoint UNDEFINED: soil_moisture, illuminance, humidity, pressure
    • Endpoint bme: temperature_bme
    • Endpoint ds: temperature_ds
    • Note: Nothing has an endpoint defined, except for the different temperature sensors it supports.
  • DIYRuZ DIYRuZ_FreePad:
    • Endpoint UNDEFINED: action
    • Endpoint button_1: switch_type_button_1, switch_actions_button_1
    • Endpoint button_10: switch_type_button_10, switch_actions_button_10
    • Endpoint button_11: switch_type_button_11, switch_actions_button_11
    • Endpoint button_12: switch_type_button_12, switch_actions_button_12
    • Endpoint button_13: switch_type_button_13, switch_actions_button_13
    • Endpoint button_14: switch_type_button_14, switch_actions_button_14
    • Endpoint button_15: switch_type_button_15, switch_actions_button_15
    • Endpoint button_16: switch_type_button_16, switch_actions_button_16
    • Endpoint button_17: switch_type_button_17, switch_actions_button_17
    • Endpoint button_18: switch_type_button_18, switch_actions_button_18
    • Endpoint button_19: switch_type_button_19, switch_actions_button_19
    • Endpoint button_2: switch_type_button_2, switch_actions_button_2
    • Endpoint button_20: switch_type_button_20, switch_actions_button_20
    • Endpoint button_3: switch_type_button_3, switch_actions_button_3
    • Endpoint button_4: switch_type_button_4, switch_actions_button_4
    • Endpoint button_5: switch_type_button_5, switch_actions_button_5
    • Endpoint button_6: switch_type_button_6, switch_actions_button_6
    • Endpoint button_7: switch_type_button_7, switch_actions_button_7
    • Endpoint button_8: switch_type_button_8, switch_actions_button_8
    • Endpoint button_9: switch_type_button_9, switch_actions_button_9
  • DIYRuZ FreePad_LeTV_8:
    • Endpoint UNDEFINED: action
    • Endpoint button_1: switch_type_button_1, switch_actions_button_1
    • Endpoint button_2: switch_type_button_2, switch_actions_button_2
    • Endpoint button_3: switch_type_button_3, switch_actions_button_3
    • Endpoint button_4: switch_type_button_4, switch_actions_button_4
    • Endpoint button_5: switch_type_button_5, switch_actions_button_5
    • Endpoint button_6: switch_type_button_6, switch_actions_button_6
    • Endpoint button_7: switch_type_button_7, switch_actions_button_7
    • Endpoint button_8: switch_type_button_8, switch_actions_button_8
  • HEIMAN HS2SW2A/HS2SW2A-N:
    • Endpoint UNDEFINED: device_temperature
    • Endpoint left: state_left
    • Endpoint right: state_right
  • HEIMAN HS2SW3A/HS2SW3A-N:
    • Endpoint UNDEFINED: device_temperature
    • Endpoint center: state_center
    • Endpoint left: state_left
    • Endpoint right: state_right
  • LELLKI WP30-EU:
    • Endpoint UNDEFINED: power, current, voltage, energy, power_outage_memory
    • Endpoint l1: state_l1
    • Endpoint l2: state_l2
    • Endpoint l3: state_l3
  • Legrand 067772:
    • Endpoint UNDEFINED: led_when_off, led_when_on
    • Endpoint left: state_left
    • Endpoint right: state_right
  • Lonsonho TS130F_dual:
    • Endpoint UNDEFINED: calibration_time
    • Endpoint left: moving_left, state_left, position_left, calibration_left, motor_reversal_left
    • Endpoint right: moving_right, state_right, position_right, calibration_right, motor_reversal_right
  • Makegood MG-AUZG01:
    • Endpoint UNDEFINED: power, current, voltage, energy
    • Endpoint l1: state_l1
    • Endpoint l2: state_l2
  • Mercator SPP02GIP:
    • Endpoint UNDEFINED: energy
    • Endpoint left: state_left, power_left, current_left, voltage_left
    • Endpoint right: state_right
  • Mercator SPP04G:
    • Endpoint UNDEFINED: energy, power_outage_memory
    • Endpoint left: state_left, power_left, current_left, voltage_left
    • Endpoint right: state_right
  • Moes MS-104BZ:
    • Endpoint UNDEFINED: power_on_behavior
    • Endpoint l1: state_l1
    • Endpoint l2: state_l2
  • Moes ZP-LZ-FR2U:
    • Endpoint UNDEFINED: power_outage_memory, child_lock
    • Endpoint l1: state_l1
    • Endpoint l2: state_l2
  • Moes ZTS-EU_2gang:
    • Endpoint UNDEFINED: indicate_light, power_on_behavior
    • Endpoint l1: state_l1
    • Endpoint l2: state_l2
  • Moes ZTS-EU_3gang:
    • Endpoint UNDEFINED: indicate_light, power_on_behavior
    • Endpoint l1: state_l1
    • Endpoint l2: state_l2
    • Endpoint l3: state_l3
  • Moes ZTS-EU_4gang:
    • Endpoint UNDEFINED: indicate_light, power_on_behavior
    • Endpoint l1: state_l1
    • Endpoint l2: state_l2
    • Endpoint l3: state_l3
    • Endpoint l4: state_l4
  • Perenio PEHWE20:
    • Endpoint UNDEFINED: last_message_lqi, last_message_rssi
    • Endpoint l1: state_l1, power_on_behavior_l1, switch_type_l1
    • Endpoint l2: state_l2, power_on_behavior_l2, switch_type_l2
  • ROBB ROB_200-026-0:
    • Endpoint UNDEFINED: energy
    • Endpoint l1: state_l1
    • Endpoint l2: state_l2
  • Schneider Electric 545D6102:
    • Endpoint UNDEFINED: action
    • Endpoint l1: state_l1, brightness_l1, level_config_l1.on_off_transition_time, level_config_l1.on_transition_time, level_config_l1.off_transition_time, level_config_l1.current_level_startup, ballast_minimum_level_l1, ballast_maximum_level_l1, dimmer_mode_l1
  • Schneider Electric 545D6306:
    • Endpoint UNDEFINED: occupancy, illuminance_lux, illuminance, occupancy_timeout
    • Endpoint l1: state_l1
  • Schneider Electric 545D6514:
    • Endpoint UNDEFINED: action
    • Endpoint l1: state_l1
    • Endpoint l2: state_l2
  • Siglis ZFP-1A-CH:
    • Endpoint UNDEFINED: action
    • Endpoint l1: state_l1, brightness_l1, color_l1.x, color_l1.y
    • Endpoint l2: state_l2, brightness_l2
    • Endpoint l3: state_l3, brightness_l3
    • Endpoint l4: state_l4, brightness_l4
    • Endpoint l5: state_l5, brightness_l5
    • Endpoint l6: state_l6, position_l6, tilt_l6
    • Endpoint l7: state_l7, position_l7, tilt_l7
  • Siglis ZFU-1D-CH:
    • Endpoint UNDEFINED: action
    • Endpoint l1: state_l1, brightness_l1, color_l1.x, color_l1.y
    • Endpoint l2: state_l2
    • Endpoint l3: state_l3, brightness_l3
  • Smartenit 4040B:
    • Endpoint UNDEFINED: power, energy
    • Endpoint l1: state_l1
    • Endpoint l2: state_l2
  • Sprut.device WB-MSW-ZIGBEE v.3:
    • Endpoint UNDEFINED: temperature, illuminance, illuminance_lux, humidity, occupancy, occupancy_level, co2, voc, noise, noise_detected, noise_timeout, occupancy_timeout, temperature_offset, occupancy_sensitivity, noise_detect_level, co2_autocalibration, co2_manual_calibration, th_heater
    • Endpoint l1: state_l1
    • Endpoint l2: state_l2
    • Endpoint l3: state_l3
  • TuYa TS0002_switch_module:
    • Endpoint UNDEFINED: power_on_behavior, switch_type
    • Endpoint l1: state_l1
    • Endpoint l2: state_l2
  • TuYa TS0002_switch_module_2:
    • Endpoint UNDEFINED: power_on_behavior
    • Endpoint l1: state_l1
    • Endpoint l2: state_l2
  • TuYa TS0003_switch_module:
    • Endpoint UNDEFINED: power_on_behavior, switch_type
    • Endpoint l1: state_l1
    • Endpoint l2: state_l2
    • Endpoint l3: state_l3
  • TuYa TS0004_switch_module:
    • Endpoint UNDEFINED: power_on_behavior, switch_type
    • Endpoint l1: state_l1
    • Endpoint l2: state_l2
    • Endpoint l3: state_l3
    • Endpoint l4: state_l4
  • TuYa TS0012_switch_module:
    • Endpoint UNDEFINED: power_on_behavior, switch_type
    • Endpoint left: state_left
    • Endpoint right: state_right
  • TuYa TS0013:
    • Endpoint UNDEFINED: power_on_behavior, backlight_mode
    • Endpoint center: state_center
    • Endpoint left: state_left
    • Endpoint right: state_right
  • TuYa TS0013_switch_module:
    • Endpoint UNDEFINED: power_on_behavior, switch_type
    • Endpoint center: state_center
    • Endpoint left: state_left
    • Endpoint right: state_right
  • TuYa TS0115:
    • Endpoint UNDEFINED: power_on_behavior
    • Endpoint l1: state_l1
    • Endpoint l2: state_l2
    • Endpoint l3: state_l3
    • Endpoint l4: state_l4
    • Endpoint l5: state_l5
  • TuYa TS011F_2_gang_2_usb_wall:
    • Endpoint UNDEFINED: power_on_behavior, backlight_mode
    • Endpoint l1: state_l1
    • Endpoint l2: state_l2
    • Endpoint l3: state_l3
    • Endpoint l4: state_l4
  • TuYa TS011F_2_gang_wall:
    • Endpoint UNDEFINED: power_on_behavior, backlight_mode
    • Endpoint l1: state_l1
    • Endpoint l2: state_l2
  • Ubisys J1:
    • Endpoint UNDEFINED: state, position, tilt
    • Endpoint meter: power
  • Ubisys S1-R:
    • Endpoint UNDEFINED: state, action, power_on_behavior
    • Endpoint meter: power
  • Ubisys S1:
    • Endpoint UNDEFINED: state, action, power_on_behavior
    • Endpoint meter: power
  • Ubisys S2:
    • Endpoint UNDEFINED: action
    • Endpoint l1: state_l1, power_on_behavior_l1
    • Endpoint l2: state_l2, power_on_behavior_l2
    • Endpoint meter: power
  • Xiaomi LLKZMK11LM:
    • Endpoint UNDEFINED: power, energy, device_temperature, voltage, current, power_outage_count, power_outage_memory, interlock
    • Endpoint l1: state_l1
    • Endpoint l2: state_l2
  • Xiaomi QBCZ15LM:
    • Endpoint UNDEFINED: power, energy, device_temperature, voltage, current, power_outage_memory, led_disabled_night, button_lock, button_switch_mode, overload_protection
    • Endpoint relay: state_relay
    • Endpoint usb: state_usb
  • Xiaomi QBKG03LM:
    • Endpoint UNDEFINED: device_temperature, action
    • Endpoint left: state_left, operation_mode_left
    • Endpoint right: state_right, operation_mode_right
  • Xiaomi QBKG12LM:
    • Endpoint UNDEFINED: device_temperature, energy, power, action
    • Endpoint left: state_left, operation_mode_left
    • Endpoint right: state_right, operation_mode_right
  • Xiaomi QBKG20LM:
    • Endpoint UNDEFINED: power, energy, voltage, flip_indicator_light, power_outage_memory, led_disabled_night, device_temperature, action
    • Endpoint left: state_left, operation_mode_left
    • Endpoint right: state_right, operation_mode_right
  • Xiaomi QBKG22LM:
    • Endpoint UNDEFINED: action
    • Endpoint left: state_left, operation_mode_left
    • Endpoint right: state_right, operation_mode_right
  • Xiaomi QBKG24LM:
    • Endpoint UNDEFINED: power, action
    • Endpoint left: state_left, operation_mode_left
    • Endpoint right: state_right, operation_mode_right
  • Xiaomi QBKG25LM:
    • Endpoint UNDEFINED: mode_switch, power_outage_memory, led_disabled_night, device_temperature, flip_indicator_light, action, power_outage_count
    • Endpoint center: state_center, operation_mode_center
    • Endpoint left: state_left, operation_mode_left
    • Endpoint right: state_right, operation_mode_right
  • Xiaomi QBKG26LM:
    • Endpoint UNDEFINED: power, power_outage_memory, led_disabled_night, device_temperature, flip_indicator_light, action
    • Endpoint center: state_center, operation_mode_center
    • Endpoint left: state_left, operation_mode_left
    • Endpoint right: state_right, operation_mode_right
  • Xiaomi QBKG31LM:
    • Endpoint UNDEFINED: power, energy, voltage, device_temperature, power_outage_memory, led_disabled_night, flip_indicator_light, action
    • Endpoint left: state_left, operation_mode_left
    • Endpoint right: state_right, operation_mode_right
  • Xiaomi QBKG34LM:
    • Endpoint UNDEFINED: power, energy, voltage, flip_indicator_light, power_outage_memory, led_disabled_night, device_temperature, action
    • Endpoint center: state_center, operation_mode_center
    • Endpoint left: state_left, operation_mode_left
    • Endpoint right: state_right, operation_mode_right
  • Xiaomi QBKG39LM:
    • Endpoint UNDEFINED: device_temperature, mode_switch, action, power_outage_memory, flip_indicator_light
    • Endpoint left: state_left, operation_mode_left
    • Endpoint right: state_right, operation_mode_right
  • Xiaomi QBKG41LM:
    • Endpoint UNDEFINED: action, power_outage_memory, device_temperature, flip_indicator_light
    • Endpoint left: state_left, operation_mode_left
    • Endpoint right: state_right, operation_mode_right
  • Xiaomi WS-EUK02:
    • Endpoint UNDEFINED: power_outage_memory, flip_indicator_light, led_disabled_night, power_outage_count, device_temperature, mode_switch, action
    • Endpoint left: state_left, operation_mode_left
    • Endpoint right: state_right, operation_mode_right
  • Xiaomi WS-EUK04:
    • Endpoint UNDEFINED: power, energy, action, device_temperature, power_outage_memory, flip_indicator_light, led_disabled_night, power_outage_count
    • Endpoint left: state_left, operation_mode_left
    • Endpoint right: state_right, operation_mode_right
  • Xiaomi ZNCJMB14LM:
    • Endpoint UNDEFINED: standby_enabled, theme, beep_volume, lcd_brightness, language, screen_saver_style, standby_time, font_size, lcd_auto_brightness_enabled, homepage, screen_saver_enabled, standby_lcd_brightness, available_switches, switch_1_text_icon.switch_1_icon, switch_1_text_icon.switch_1_text, switch_2_text_icon.switch_2_icon, switch_2_text_icon.switch_2_text, switch_3_text_icon.switch_3_icon, switch_3_text_icon.switch_3_text
    • Endpoint center: state_center
    • Endpoint left: state_left
    • Endpoint right: state_right
  • Xiaomi ZNDDMK11LM:
    • Endpoint UNDEFINED: power, energy, voltage, device_temperature, power_outage_memory, dimmer_mode
    • Endpoint l1: state_l1, brightness_l1, color_temp_l1, color_l1.x, color_l1.y
    • Endpoint l2: state_l2, brightness_l2, color_temp_l2
  • Zemismart TB25:
    • Endpoint UNDEFINED: power_on_behavior
    • Endpoint center: state_center
    • Endpoint left: state_left
    • Endpoint right: state_right
  • Zemismart ZIGBEE-B09-UK:
    • Endpoint UNDEFINED: power_outage_memory
    • Endpoint l1: state_l1
    • Endpoint l2: state_l2

I'll browse through some of these to get a better understanding on what the use cases are.

I think for all cases above, it's fine to consider an "undefined" endpoint as a separate endpoint, resulting in an additional accessory when split up by endpoints.

itavero added a commit that referenced this issue Sep 30, 2022
Add option to exclude based on endpoint (relates to #517).
itavero added a commit that referenced this issue Sep 30, 2022
Add option to exclude based on endpoint (relates to #517).
itavero added a commit that referenced this issue Oct 1, 2022
Add option to exclude based on endpoint (relates to #517).
@itavero itavero self-assigned this Oct 1, 2022
itavero added a commit that referenced this issue Oct 1, 2022
Add option to exclude based on endpoint (relates to #517).
@jannehietamaki
Copy link

jannehietamaki commented Oct 16, 2022

This is great. I have loads of Ubisys S2's and having them as single devices in Homekit makes them pretty much unusable.

Was there some way to expose same device twice, so that I could exclude different endpoints for each device instance or how that should be handled?

@itavero
Copy link
Owner

itavero commented Dec 9, 2022

Just released v1.10.0 to homebridge-z2m@next which includes the ability to ignore properties based on their endpoint. Because there were quite some internal changes, I haven't pushed it to latest yet. So far it seems to be working fine on my setup, but if you run into any issues, please do let me know.

FYI: Splitting the endpoints is still on my backlog 😉

@Bartus78
Copy link
Author

Dear Itavero,

Thank you very much for this update. It works great on my setup as well, without any bugs. Looking forward to the splitting option.

Merry Christmas.

B

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants