OH3, SerialUPB, HomeKit & a reboot (now, NoResponse)

Quick question. I built the links but they’re all showing up as ERROR. Thoughts? It’s a Simply Automated PIM (which is capable of sending/receiving Links)

Hi, couple of things… First off, one virtual thing is enough, it will “listen” to any scene changes, and your rule can distinguish which scene was activated.

Based on the device IDs, it looks like you didn’t connect the virtual things to the bridge (PIM) when you created them. A correct ID would look like upb:virtual:4acb90a1cc:someId, note that this has the ID of the PIM in it.

(I am thinking I might scrap the virtual thing in the next release, and just put the link channels directly on the PIM thing. Not sure why I didn’t do that to begin with.)

Yeah, that was it. Now they’re online (though, I disabled all but one based on what you said above). To cut down on UPB traffic, I’m thinking I will keep them as independent rules for each link, that way when a specific link is triggered, it only queries that group which only has the impacted devices in it. I’ll probably play with it a bit to see which is best (independent or single group). I may also keep this so OH can send links (I’m assuming, if I create a channel for it).

But, I’ve not figured out where to build the group(s), and when I go to build the rules, the layout of the syntax is a bit different. I think I’ve figured it out, with the attached, but then can’t figure where to put the refresh command. I’m starting off easy by just building a single (Default Link 241), and throwing them all in there, and once I can get that running, then I’ll explore whether dedicated links makes more sense or not to reduce traffic as well as allow the sending of links from OH.

triggers:
  - id: "1"
    configuration:
      thingUID: upb:virtual:f46511e78d
    type: core.ChannelEventTrigger
conditions: []
actions:
  - inputs: {}
    id: "2"
    configuration:
      itemName: OFCBackOverheadLts_Brightness
      command: (REFRESH)
    type: core.ItemCommandAction

If you name your groups like gSceneN where N is the link number, then you only need one rule along the lines of (untested):

rule "Refresh on scene change"
when
  Item UPB_Active_Scene received update
then
  sendCommand('gScene' + newState, REFRESH)
end

That should only refresh the devices in the specific scene.

Groups are just special types of items, so create them in the Items list with the “+” button, and set the type to “Group”. Then edit each child item and set its group membership accordingly. Note that the group will contain the state items (switch/dimmer) of the devices, not the things themselves (as groups contains other items).

I’m not sure what that translates to in the UI, I tend to use textual config files for rules. It’s pretty simple, just drop the upb.rules file in /etc/openhab/conf/rules.

Ahh, getting closer.

Created a group “UPBLinkRefresh” and added all devices to it.

Then created this rule (and yes, once that file was created, it showed up like this in the UI with a padlock, stating it could only be edited from the file itself):

// Triggers:
// - When UPBL010_HallwayUpperOverheadLTS was updated
// - When UPBL011_OFCUpperBackDeskOverheads was updated
// - When UPBL012_OFCUpperBackOverheadLTS was updated
// - When UPBL013_OFCUpperBackDeskandOverheads was updated
// - When UPBL019_EntryFrontOverhead was updated
// - When UPBL020_OFCUpperCommonCubeLTS was updated
// - When UPBL021_OFCUpperCommonOverheadLTS was updated
// - When UPBL022_UpperOfcCommonOverheadEntryFrtOverheadLTS was updated
// - When UPBL100_ALLOFF was updated
// - When UPBL101_ALLON was updated
// - When UPBL102_FansOFF was updated
// - When UPBL110_ALLOFFAway was updated
// - When UPBL241_DEFAULT was updated

// context: upb-1
gScene.sendCommand(REFRESH)

Can’t seem to get it to trigger, and if I manually run, it still doesn’t seem to refresh the item state.

Tried both variations of the THEN stateme:

  sendCommand('gScene' + newState, REFRESH)
  gScene.sendCommand(REFRESH)

(sigh). :slight_smile:

Ok but you say your group is named UPBLinkRefresh, but your rule refers to gScene. Those need to be the same.

I tested it with this rule, which also logs the scene change so you can see when it triggers:

rule "Refresh on scene change"
when
  Item UPB_Active_Scene received update
then
  logInfo('upb', 'scene {} activated', newState)
  gUpbScene.sendCommand(REFRESH)
end

Again, gUpbScene is replaced with your group name, and UPB_Active_Scene is replaced with your virtual device’s item name.

If that doesn’t help, please send a log at DEBUG level.