Looks like the Home application breaks non-trivial predicates?

I've just bumped into a weird problem. I've created a pretty simple and perfectly working event trigger with a non-trivial predicate which is just an AND of two characteristic-value ones.

Then I've renamed it in the Home application, and it stopped working. A dump suggests the cause is a broken predicate, for it looks now rather differently — one of those two characteristic-value predicates seems broken (details below).

Is that possible? Could please someone check whether the problem is really a Home ugly bug, or whether I do something wrong at my side? Versions are

  • macOS 27.0.1 (26A434)
  • Home 11.0 (1241.1.7.4.3)

I would gladly post a bugreport, but at this moment I am far from being sure I do not overlook something of importance myself. Thanks!

My code — for clarity stripped of all the error checking and reporting — looks like this:

    HMHome *home=...;
    HMCharacteristic *knihovna=..., *stul=..., *sklenik=...; // light chars, found by names
    HMActionSet *switchOff=...; // trivial switch-off for another light, found by name
    HMEventTrigger *trigger=...; // found by name if exists

    if (trigger) { // if found, the predicate is logged out and that's all
        NSLog(@"=== predicate found: %@", trigger.predicate);
        return;
    }
    // otherwise, the trigger and predicate are created this way:
    HMCharacteristicEvent *evt=[[HMCharacteristicEvent alloc] initWithCharacteristic:sklenik triggerValue:@1];
    NSPredicate *p1=[HMEventTrigger predicateForEvaluatingTriggerWithCharacteristic:knihovna relatedBy:NSEqualToPredicateOperatorType toValue:@1];
    NSPredicate *p2=[HMEventTrigger predicateForEvaluatingTriggerWithCharacteristic:stul relatedBy:NSEqualToPredicateOperatorType toValue:@1];
    NSPredicate *p=[[NSCompoundPredicate alloc] initWithType:NSAndPredicateType subpredicates:@[p1, p2]];
    NSLog(@"=== predicate created: %@", p);
    HMEventTrigger *et=[[HMEventTrigger alloc] initWithName:@"TEST-ONLY" events:@[evt] predicate:p];
    [home addTrigger:et completionHandler:^(NSError *error) {
        if (!error) [et addActionSet:switchOff completionHandler:^(NSError *error) {
            if (!error) [et enable:YES completionHandler:^(NSError *error) {
                if (!error) NSLog(@"=== success!");
            }];
        }];
    }];

As already mentioned, the trigger works perfectly (is trivial enough, would be weird if not). When created and also later, when found by name, the predicate looks like this:

=== predicate found: (characteristic == <HMCharacteristic, Unique ID: 7444CCCE-1C1B-5234-8CAE-01DA4D811B8B, Type: 00000025, Instance ID: 9> AND characteristicValue == 1) AND (characteristic == <HMCharacteristic, Unique ID: 2E046807-9127-565F-B9CB-10BC0F2EE6D2, Type: 00000025, Instance ID: 9> AND characteristicValue == 1)

Then, I just go to the Home application and rename the trigger, nothing else. It immediately stops working properly, and from that moment on, the predicate looks like this — note the difference:

=== predicate found: characteristic == <HMCharacteristic, Unique ID: 2E046807-9127-565F-B9CB-10BC0F2EE6D2, Type: 00000025, Instance ID: 9> AND (characteristic == <HMCharacteristic, Unique ID: 7444CCCE-1C1B-5234-8CAE-01DA4D811B8B, Type: 00000025, Instance ID: 9> AND characteristicValue == 1)