* [homekit] delay starting until a particular StartLevel
instead of a blind "delay by seconds", the new default won't even
attempt to start until items are loaded (both file-based and UI-based),
with an additional config to let the user delay it any further (in
case they have items coming from JSR223 scripts that can't run until
at least SL20 anyway).
Signed-off-by: Cody Cutrer <cody@cutrer.us>
* [homekit] add BasicFan accessory
This is Fan v1. It's a subset of FanV2, except that Home allows you
to customize the icon to show a ceiling fan.
Signed-off-by: Cody Cutrer <cody@cutrer.us>
just the sub-commands.
since the show command is already a "search", I didn't feel it's super
important to implement on that
Signed-off-by: Cody Cutrer <cody@cutrer.us>
* [homekit] persist all known accessories, to prevent loss of homekit information
See the readme for more details, but basically this keeps track of every
accessory we've ever created, and if it no longer exists, presents a dummy
accessory instead. If the accessory comes back, nothing is lost in the Home
app; if you meant to prune it permanently, you have to run a console command.
there are also several fixes to prevent presenting the device with missing data -
such as when the bundle stops, _don't_ explicitly remove the accessories until
the server has stopped.
we also don't increment the configuration version unless the configuration
has _actually_ changed (so removing and re-adding the exact same thing
won't trigger the device to reconnect). this even works across restarts
of the bundle, because we're persisting all the accessory information
for dummy information anyway.
* [homekit] Address review comments for accessory persistence
* update hap-java to 2.0.4
* remove unused local variable
* [homekit] ensure accessories are replaced in a batch
so that HAP-Java can maintain subscriptions with the new objects
* [homekit] log individual dummy accessories up to 5
* [homekit] Tweak readme for dummy accessories slightly.
* Be consistent with proper usage of useDummyAccessories.
* Make the sentence more clear about the effects of having dummy accessories.
Signed-off-by: Cody Cutrer <cody@cutrer.us>
otherwise if your step is 1.0 in fahrenheit, then your
values will get rounded to 1.0 celsius, and you might not
even notice you've lost precision in the Home app.
Signed-off-by: Cody Cutrer <cody@cutrer.us>
* [homekit] increase flexibility of ColorTemperature
allow Number or Dimmer items, and mired or Kelvin units.
Signed-off-by: Cody Cutrer <cody@cutrer.us>
* [homekit] Improve output of console's `homekit show` command
* include the full JSON from all the characteristics, so you can confirm
everything is configured correctly.
* only use simple class names; the fully qualified package is just a
distraction.
* show linked services if they exist
* include the class name of services, not just the GUID
Signed-off-by: Cody Cutrer <cody@cutrer.us>
If you have many instances, it can take a while. So stop all the
instances in parallel. Also, fix a race condition where the update
debouncer might get called again after being stopped, because the
change listener was deregistered _after_ the debouncer was stopped.
Signed-off-by: Cody Cutrer <cody@cutrer.us>
* [homekit] fix BooleanItemReader to work with DimmerItems
DimmerItems have a PercentType state, which is easily convertible
to OnOffType, but is not inherited from it. So take that into account.
i.e. a variable speed fan can use a single DimmerItem for both
ActiveStatus and RotationSpeed.
* [homekit] Document that Dimmer is a possible item type for several booleans
Signed-off-by: Cody Cutrer <cody@cutrer.us>
* [homekit] allow configuring maxValue on VOCDensity
the default of 1000 is quite low in reality. tested and confirmed
working with iOS 16
* [homekit] allow step value to be configured for VOCDensity
Signed-off-by: Cody Cutrer <cody@cutrer.us>
this helps to auto-configure if the binding is providing the necessary info
metadata config still overrides
Signed-off-by: Cody Cutrer <cody@cutrer.us>
this is a theme, and I've extracted a helper method and applied it to several
other locations as well
example, I have a double-sliding door, with two contact sensors
in the alarm system, defined as:
```
Group:Contact:AND(CLOSED,OPEN) DeckDoor_Contact "Deck Door [%s]" <door> (gExteriorDoors, gWarningVisibility_Contact, gDoor, lMainFloor, gInflux) { homekit="ContactSensor" [instance=2] }
Contact DeckNDoor_Contact "Deck Door North" <door> (gInflux, DeckDoor_Contact, gGreatContacts) { channel="dscalarm:zone:46c52f35:zone11:zone_status" }
Switch DeckNDoor_Tamper "Deck Door North Tamper [%s]" <warning> (gTamper, gWarningVisibility_Switch) { channel="dscalarm:zone:46c52f35:zone11:zone_tamper" }
Contact DeckSDoor_Contact "Deck Door South" <door> (gInflux, DeckDoor_Contact, gGreatContacts) { channel="dscalarm:zone:46c52f35:zone12:zone_status" }
Switch DeckSDoor_Tamper "Deck Door South Tamper [%s]" <warning> (gTamper, gWarningVisibility_Switch) { channel="dscalarm:zone:46c52f35:zone12:zone_tamper" }
```
This allows the Group:Contact to be used for the ContactSensor.
Signed-off-by: Cody Cutrer <cody@cutrer.us>
given:
```
Group eThermostat { homekit="Thermostat" }
Number:Temperature Thermostat_AmbTemp (eThermostat) { homekit="CurrentTemperature" }
Number:Temperature Thermostat_SetTemp (eThermostat) { homekit="TargetTemperature" }
Group gThermostatZoneContacts
// in reality there are multiple thermostats and multiple of these groups,
// so that a rule on members of gThermostatZoneContacts can find the related
// thermostat to turn it off when a window is open
Group:Contact:OR(OPEN,CLOSED) gWindows (eThermostat, gThermostatZoneContacts)
Contact Window_Contact (gWindows) { homekit="ContactSensor" }
```
When constructing the Thermostat accessory for eThermostat, detects the
Window_Contact as a mandatory characteristic, because it's a base accessory
in a nested group. This leads to lots of warnings about the temperature
value of a contact item being out of range.
The fix is two-fold - first of all, there's no reason to search nested
groups for characteristics of a complex accessory. Second of all,
even if for some reason you were to nest an accessory in an accessory,
the nested accessory does not actually belong to the outer accessory,
so don't add it as a mandatory characteristic of the outer.
I suspect there's still one more bug, because AbstractHomekitAccessoryImpl.
getCharacteristic(HomekitCharacteristicType.CURRENT_TEMPERATURE) was
returning Window_Contact, which is only tagged as a ContactSensor. But
after fixing the above two bugs, it was no longer reproducible, and I
didn't continue digging.
Signed-off-by: Cody Cutrer <cody@cutrer.us>
this is especially important if you use the same item for both
TargetTemperature and HeatingThresholdTemperature characteristics,
since the former was already doing unit conversion for min/max.
Signed-off-by: Cody Cutrer <cody@cutrer.us>
if an Item associated with a temperature characteristic has a QuantityType
(of dimension Temperature) as its state, regardless of current unit,
use that to convert to celsius instead of any other configuration.
Note that this is only for supply values to HomeKit; commands coming from
HomeKit will still send a DecimalType with units according to the HomeKit-wide
useFahrenheit configuration.
Signed-off-by: Cody Cutrer <cody@cutrer.us>
* Add default translations for io add-ons
This makes the texts used by these add-ons translatable with Crowdin.
Signed-off-by: Wouter Born <github@maindrain.net>