brutella / hc

hc is a lightweight framework to develop HomeKit accessories in Go.
Apache License 2.0
1.74k stars 189 forks source link

Radiation sensor #213

Closed sighmon closed 2 years ago

sighmon commented 2 years ago

Hi @brutella,

I've been playing around trying to setup a DF Robot Gravity Geiger Counter in HomeKit with hc (via a Prometheus exporter).

My repo: https://github.com/sighmon/homekit-geiger-counter

In the Home app it reports This accessory is not currently supported by the Home app.

I assume the TypeGeigerCounter UUID I made up is causing the problem, or perhaps the TypeRadiation UUID?

Do you know which UUIDs I should be using? Anything else I have messed up?

brutella commented 2 years ago

I assume the TypeGeigerCounter UUID I made up is causing the problem, or perhaps the TypeRadiation UUID?

You are right, those types are not known to the Apple Home app, and therefore not supported. But other HomeKit apps (ex. Home+) would display the custom types correctly.

sighmon commented 2 years ago

@brutella I checked Home+ too, but I can't find it in any of the categories. Should it appear in Sensors seeing I'm setting the type to TypeSensor?

Others are showing up in there fine.

sighmon commented 2 years ago

@brutella Any chance you've had the time to have a look at why my sensor isn't showing up in Home+?

brutella commented 2 years ago

I've just checked out your project and I've found an issue where you use the same type for all 3 radiation characteristics. HomeKit doesn't seem to like that and returns an error. Make sure that every characteristic in the radiation service has a different type.

Secondly I've updated Home+ to support your accessory as a sensor. Please install the latest TestFlight build and try it again.

sighmon commented 2 years ago

@brutella Do you expect this to work for the 3 radiation characteristics? https://github.com/sighmon/homekit-geiger-counter/pull/3/files

Your TestFlight build of Home+ works perfectly thank you!