Arduino BLE GATT Characteristic linked to Switch Item

  • Platform information:
    • Hardware: Raspberry Pi 4B 8GB
    • OS: Latest Raspberry Pi OS (Buster?)
    • Java Runtime Environment: Open JDK 11
    • openHAB version: 3.1.0
    • Bluez version : 5.50
      I’m trying create a BLE device using an Arduino NANO 33 IOT and the ArduinoBLE library that I can add to OpenHAB as a thing. I have created a custom service with a 128 bit uuid and have added two GATT characteristics, a temperature characteristic (0x2A6E) and an analog characteristic (0x2A58). the temperature characteristic is defined as read + notify and the analog characteristic is defined as read + write + notify. The device is recognised by the bluetooth binding and added as “A generic bluetooth device that supports GATT characteristics”. Both are linked to Items of type Number and the Item linked to the analog characteristic is referenced in the sitemap as a Setpoint. The temperature characteristic is being set on the Arduino using a DS18B20. This all works fine and I can see the correct temperature displayed in the Basic UI and I can set the analog characteristic using the Basic UI with the serial port of the Arduino correctly printing the set value. So far so good :smiley:
      The problem I am having is finding a GATT characteristic that I can successfully link to a switch item. I have tried many of the predefined GATT characteristics but have had no luck. I have tried linking to another analog characteristic (0x2A58) and using a map transform on the switch profile but no luck.
      Has anybody successfully linked a switch item to a GATT characteristic and if so how was it done? If anyone can offer some suggestions how I could accomplish I would be very grateful :slight_smile: