kingsleyadam / local-abbfreeathome-hass

This is the Home Assistant custom_components (HACS) repository for Busch Jaeger/ABB Free@Home (Local API)
MIT License
3 stars 2 forks source link

Movement detectors should be channel-name agnostic #39

Closed derjoerg closed 4 days ago

derjoerg commented 5 days ago

Hi, I just encountered the following behaviour. I have movement detectors, where the channel-name equals the device-name and also supports the brightness value. For them you name the motion entity just "Motion", which is totally fine

BUT 😃

I also have a device, which supports 4 binary sensors and they are configured as movement detectors (without brightness, the outdoor-ones I mentioned earlier). In this device I now have 4 entities, which each just named "Motion" and also the entity-ids are just counting ...motion, ...motion_2, ... movement-naming

Would it be meaningful to add the following? If channel-name == device-name -> use the existing naming with "Motion" If channel-name != device-name -> use the channel-name for display and entity-id

Here is the config-output:

      "ABB2EDAF3651": {
        "interface": "TP",
        "deviceId": "B007",
        "displayName": "Binary input, 4gang, MDRC",
        "unresponsive": false,
        "unresponsiveCounter": 0,
        "defect": false,
        "channels": {
          "ch0000": {
            "floor": "02",
            "room": "0E",
            "displayName": "Bewegung Vorne",
            "selectedIcon": "52",
            "functionID": "11",
            "inputs": {},
            "outputs": {
              "odp000d": {
                "pairingID": 6,
                "value": "0"
              }
            },
            "parameters": {
              "par0010": "1"
            }
          },
          "ch0001": {
            "floor": "02",
            "room": "10",
            "displayName": "Bewegung Ost",
            "selectedIcon": "52",
            "functionID": "11",
            "inputs": {},
            "outputs": {
              "odp000d": {
                "pairingID": 6,
                "value": "0"
              }
            },
            "parameters": {
              "par0010": "1"
            }
          },
          "ch0002": {
            "floor": "02",
            "room": "0F",
            "displayName": "Bewegung Hinten",
            "selectedIcon": "52",
            "functionID": "11",
            "inputs": {},
            "outputs": {
              "odp000d": {
                "pairingID": 6,
                "value": "0"
              }
            },
            "parameters": {
              "par0010": "1"
            }
          },
          "ch0003": {
            "floor": "02",
            "room": "12",
            "displayName": "Bewegung West",
            "selectedIcon": "52",
            "functionID": "11",
            "inputs": {},
            "outputs": {
              "odp000d": {
                "pairingID": 6,
                "value": "0"
              }
            },
            "parameters": {
              "par0010": "1"
            }
          }
        },
        "parameters": {
          "par000f": "1"
        }
      },
kingsleyadam commented 5 days ago

Ok, in this situation each motion detector does have it's own unique name in Free@Home correct?

kingsleyadam commented 5 days ago

@derjoerg , I added this logic to the Window/Door sensor PR which is here: https://github.com/kingsleyadam/local-abbfreeathome-hass/pull/40

I also realize, this same situation most likely also applies there. So this logic will apply to all binary sensors.

derjoerg commented 5 days ago

@derjoerg , I added this logic to the Window/Door sensor PR which is here: #40

I also realize, this same situation most likely also applies there. So this logic will apply to all binary sensors.

Yes, perfect

kingsleyadam commented 4 days ago

Addressed in https://github.com/kingsleyadam/local-abbfreeathome-hass/pull/40