kingsleyadam / local-abbfreeathome

A Python Package for interacting with the ABB (Busch Jaeger) Free@Home System via the Local API
MIT License
3 stars 2 forks source link

Support for sensor only switches #74

Open nrenner73 opened 3 days ago

nrenner73 commented 3 days ago

OK, here´s another one:

I have two different kinds of wireless switches in my installation, which are single switch sensors only. There is no actuator present. These are not visible in the integration, but I´d like to trigger scenes or automations in HA with these. At the moment I use them to call scenes directly in f@h or link them to a separate f@h actuator in my fuse box.

One is a Busch Jaeger 6221/1.0-WL

{
  "00000000-0000-0000-0000-000000000000": {
    "devices": {
      "ABB7F6312A91": {
        "deviceReboots": "20",
        "floor": "02",
        "room": "14",
        "interface": "RF",
        "deviceId": "2039",
        "displayName": "Jalousien zentral",
        "unresponsive": false,
        "unresponsiveCounter": 0,
        "defect": false,
        "channels": {
          "ch0000": {
            "floor": "02",
            "room": "14",
            "displayName": "Jalousien zentral",
            "functionID": "3",
            "inputs": {
              "idp0001": {
                "pairingID": 18,
                "value": "0"
              },
              "idp0002": {
                "pairingID": 273,
                "value": "0"
              },
              "idp0005": {
                "pairingID": 278,
                "value": "0"
              }
            },
            "outputs": {
              "odp0002": {
                "pairingID": 32,
                "value": "1"
              },
              "odp0003": {
                "pairingID": 33,
                "value": "0"
              },
              "odp0006": {
                "pairingID": 4,
                "value": "0"
              }
            },
            "parameters": {
              "par0002": "30",
              "par0001": "50",
              "par0007": "1"
            }
          }
        },
        "parameters": {
          "par00ed": "1"
        }
      }
    }
  }
}

and the other one is a new Busch-Jaeger flexTronics Wireless Set 64891 U

{
  "00000000-0000-0000-0000-000000000000": {
    "devices": {
      "ABB703007068": {
        "deviceReboots": "2",
        "floor": "03",
        "room": "0F",
        "interface": "RF",
        "deviceId": "3100",
        "displayName": "Flur Keller 1",
        "unresponsive": false,
        "unresponsiveCounter": 0,
        "defect": false,
        "channels": {
          "ch0002": {
            "floor": "03",
            "room": "0F",
            "displayName": "Flur Keller 1",
            "functionID": "1008",
            "inputs": {
              "idp0000": {
                "pairingID": 256,
                "value": "0"
              },
              "idp0001": {
                "pairingID": 18,
                "value": "0"
              },
              "idp0002": {
                "pairingID": 257,
                "value": "0"
              },
              "idp0003": {
                "pairingID": 273,
                "value": "0"
              },
              "idp0004": {
                "pairingID": 261,
                "value": "0"
              },
              "idp0005": {
                "pairingID": 262,
                "value": "0"
              },
              "idp0006": {
                "pairingID": 278,
                "value": "0"
              },
              "idp0007": {
                "pairingID": 359,
                "value": "0"
              }
            },
            "outputs": {
              "odp0000": {
                "pairingID": 1,
                "value": "0"
              },
              "odp0001": {
                "pairingID": 4,
                "value": "0"
              },
              "odp0002": {
                "pairingID": 418,
                "value": "65535"
              },
              "odp0003": {
                "pairingID": 360,
                "value": "0"
              }
            },
            "parameters": {
              "par0002": "30",
              "par0001": "50",
              "par0007": "1"
            }
          },
          "ch0003": {
            "floor": "03",
            "room": "0F",
            "displayName": "Flur Keller 1",
            "functionID": "1009",
            "inputs": {
              "idp0000": {
                "pairingID": 256,
                "value": "0"
              },
              "idp0001": {
                "pairingID": 261,
                "value": "0"
              },
              "idp0002": {
                "pairingID": 359,
                "value": "0"
              }
            },
            "outputs": {
              "odp0000": {
                "pairingID": 1,
                "value": "0"
              },
              "odp0001": {
                "pairingID": 4,
                "value": "0"
              },
              "odp0002": {
                "pairingID": 418,
                "value": "65535"
              },
              "odp0003": {
                "pairingID": 360,
                "value": "0"
              }
            },
            "parameters": {}
          }
        },
        "parameters": {
          "par0137": "3"
        }
      }
    }
  }
}
kingsleyadam commented 3 days ago

Thanks for the device configs. It might be easier/quicker if you could update to the latest version of the integration and provide the output from the diagnostics download for these two.

That should include function and pairing names so we don't have to look up a bunch of values.

nrenner73 commented 3 days ago

You are right, I hadn´t noticed that difference in the diagnostics yet.

Here´s the first one:

"ABB7F6312A91": {
        "deviceReboots": "20",
        "floor": "02",
        "room": "14",
        "interface": "RF",
        "deviceId": "2039",
        "displayName": "Jalousien zentral",
        "unresponsive": false,
        "unresponsiveCounter": 0,
        "defect": false,
        "channels": {
          "ch0000": {
            "displayName": "Jalousien zentral",
            "floor": "02",
            "function": "FID_BLIND_SENSOR",
            "functionID": "3",
            "inputs": {
              "idp0001": {
                "pairing": "AL_NIGHT",
                "pairingID": 18,
                "value": "1"
              },
              "idp0002": {
                "pairing": "AL_INFO_ERROR",
                "pairingID": 273,
                "value": "0"
              },
              "idp0005": {
                "pairing": "AL_SYSAP_INFO_ERROR",
                "pairingID": 278,
                "value": "0"
              }
            },
            "outputs": {
              "odp0002": {
                "pairing": "AL_MOVE_UP_DOWN",
                "pairingID": 32,
                "value": "1"
              },
              "odp0003": {
                "pairing": "AL_STOP_STEP_UP_DOWN",
                "pairingID": 33,
                "value": "1"
              },
              "odp0006": {
                "pairing": "AL_SCENE_CONTROL",
                "pairingID": 4,
                "value": "0"
              }
            },
            "parameters": {
              "par0002": "30",
              "par0001": "50",
              "par0007": "1"
            },
            "room": "14"
          }
        },
        "parameters": {
          "par00ed": "1"
        }
      },

and the second one:

"ABB703007068": {
        "deviceReboots": "4",
        "floor": "03",
        "room": "0F",
        "interface": "RF",
        "deviceId": "3100",
        "displayName": "Flur KG 1",
        "unresponsive": false,
        "unresponsiveCounter": 0,
        "defect": false,
        "channels": {
          "ch0002": {
            "displayName": "Flur KG 1",
            "floor": "03",
            "function": "FID_SWITCH_SENSOR_PUSHBUTTON_TYPE0",
            "functionID": "1008",
            "inputs": {
              "idp0000": {
                "pairing": "AL_INFO_ON_OFF",
                "pairingID": 256,
                "value": "0"
              },
              "idp0001": {
                "pairing": "AL_NIGHT",
                "pairingID": 18,
                "value": "1"
              },
              "idp0002": {
                "pairing": "AL_INFO_FORCE",
                "pairingID": 257,
                "value": "0"
              },
              "idp0003": {
                "pairing": "AL_INFO_ERROR",
                "pairingID": 273,
                "value": "0"
              },
              "idp0004": {
                "pairing": "AL_SYSAP_INFO_ON_OFF",
                "pairingID": 261,
                "value": "0"
              },
              "idp0005": {
                "pairing": "AL_SYSAP_INFO_FORCE",
                "pairingID": 262,
                "value": "0"
              },
              "idp0006": {
                "pairing": "AL_SYSAP_INFO_ERROR",
                "pairingID": 278,
                "value": "0"
              },
              "idp0007": {
                "pairing": "AL_LOCK_SENSOR",
                "pairingID": 359,
                "value": "0"
              }
            },
            "outputs": {
              "odp0000": {
                "pairing": "AL_SWITCH_ON_OFF",
                "pairingID": 1,
                "value": "0"
              },
              "odp0001": {
                "pairing": "AL_SCENE_CONTROL",
                "pairingID": 4,
                "value": "0"
              },
              "odp0002": {
                "pairing": "AL_INFO_GROUP_TIMER_CONTROL_8",
                "pairingID": 418,
                "value": "0"
              },
              "odp0003": {
                "pairing": "AL_INFO_LOCKED_SENSOR",
                "pairingID": 360,
                "value": "0"
              }
            },
            "parameters": {
              "par0002": "30",
              "par0001": "50",
              "par0007": "1"
            },
            "room": "0F"
          },
          "ch0003": {
            "displayName": "Flur KG 1",
            "floor": "03",
            "function": "FID_SWITCH_SENSOR_PUSHBUTTON_TYPE1",
            "functionID": "1009",
            "inputs": {
              "idp0000": {
                "pairing": "AL_INFO_ON_OFF",
                "pairingID": 256,
                "value": "0"
              },
              "idp0001": {
                "pairing": "AL_SYSAP_INFO_ON_OFF",
                "pairingID": 261,
                "value": "0"
              },
              "idp0002": {
                "pairing": "AL_LOCK_SENSOR",
                "pairingID": 359,
                "value": "0"
              }
            },
            "outputs": {
              "odp0000": {
                "pairing": "AL_SWITCH_ON_OFF",
                "pairingID": 1,
                "value": "0"
              },
              "odp0001": {
                "pairing": "AL_SCENE_CONTROL",
                "pairingID": 4,
                "value": "0"
              },
              "odp0002": {
                "pairing": "AL_INFO_GROUP_TIMER_CONTROL_8",
                "pairingID": 418,
                "value": "0"
              },
              "odp0003": {
                "pairing": "AL_INFO_LOCKED_SENSOR",
                "pairingID": 360,
                "value": "0"
              }
            },
            "parameters": {},
            "room": "0F"
          }
        },
        "parameters": {
          "par0137": "3"
        }
      },
kingsleyadam commented 3 days ago

For ABB703007068 and the two functions FID_SWITCH_SENSOR_PUSHBUTTON_TYPE1 and FID_SWITCH_SENSOR_PUSHBUTTON_TYPE0 I think this is an easy add, we can just pair it up with the existing SwitchSensor and it'll work without any changes. It'll also then appear in Home Assistant automatically.

The function FID_BLIND_SENSOR from ABB7F6312A91 would require a bit more work, but not much. I'd recommend we create a new BlindSensor class because it has two different type of outputs compared to SwitchSensors, AL_MOVE_UP_DOWN and AL_STOP_STEP_UP_DOWN which we can expose in Home Assistant.

I'll move this issue to the PyPi package as this will be need to be implemented there first.

derjoerg commented 3 days ago

I have cover/blinds also in my setup and have them on my todo list to add them. Perhaps I get more knowledge when I implemented my ones, which I can also test and then we can look at these.

nrenner73 commented 3 days ago

I see the issue with BB7F6312A91. Basically it´s just a sensor, but I can define different functions in f@h. In my case I use it as a central switch to open/close all my blinds in the house at once.

If it helps, I could reconfigure it for testing purposes as a central light switch to have this implemented first.

And another idea, I have saved the config for the roller/blind actuators as the grande finale ;-) Would it be better to implement these first?

kingsleyadam commented 3 days ago

@nrenner73 , This is ok, we implement by function, if you changed the device to function differently the function itself would be different and wouldn't work for your setup. My guess is FID_BLIND_SENSOR is fairly common and easy enough to implement.