Help getting xiaomi square button working in deconz

I originally installed deconz by placing just the local host (raspbee board) in config

deconz:
  host: 127.0.0.1

I also use configuration -> Integrations-> Configure deCONZ which was discovered. I had two I think the second is my Phillips Hue. But configure didn’t identify which was which. I selected configure after putting the deCONZ in “Authenticate App” mode.

HA said it was configured. My configuration.yaml remains the same. I do NOT have an api_key configured and I can’t figure out how to create one to do so.

I added my xiaomi button as a “other sensor” and it was found but only sensor.squarebutton_battery_level was added as an entity.

  1. Do I need to generate an api_key for deconz ? If so how is this done?
deconz:
  host: 127.0.0.1
  api_key: xxxxxxxxxxx
  1. Do I need to configure xiaomi_aqara to get the switch to work? If so what key to I enter for the gateway? (maybe the key from #1 if answered yes)
xiaomi_aqara:
  discovery_retry: 5
  gateways:
    - key: xxxxxxxxxxxxxxxx