HSM not acting as expected

After I programmatically tell HSM to disarm, the logs say it did. but the app gui Label says it is still in its last state (armedNight). I don't think HSM GUI Label on the app is reflecting truth at all times - in fact it disagrees with itself when compared to what is in the log under certain conditions.

For those interested, my logs look like this when I woke my house up verbally this am.
app:9372026-08-27 07:17:43.577 AM

trace

Mode Manager Advanced - [Early Morning (Voice)]: HSM Verification Guard Passed: Location HSM is confirmed at 'disarmed'.

app:9372026-08-27 07:17:43.574 AM

trace

Mode Manager Advanced - [Early Morning (Voice)]: === verifyHsmSync Execution -> Expected: 'disarmed' | Actual: 'disarmed' | DispatchMs: 1787840257365 (Dispatched 6208ms ago) | Retry: 0/3 ===

app:9372026-08-27 07:17:37.988 AM

trace

Mode Manager Advanced - [Early Morning (Voice)]: === Mode Manager Adv [Handler: HSM Status Update] Ends ===

app:9372026-08-27 07:17:37.952 AM

trace

Mode Manager Advanced - [Early Morning (Voice)]: Calling setStatus() on tile device with extended metadata payload...

app:9372026-08-27 07:17:37.949 AM

trace

Mode Manager Advanced - [Early Morning (Voice)]: updateStatusTileDevice -> Updating 'Virtual Mode Status Tracker Tile' | Mode: 'Early Morning' | Reason: 'Voice' | HSM: 'Disarmed' | Time: '07:17:37 AM'

app:9372026-08-27 07:17:37.940 AM

trace

Mode Manager Advanced - [Early Morning (Voice)]: HSM Target Reached: Clearing pending state variables. (Was targeting 'disarmed')

app:9372026-08-27 07:17:37.938 AM

trace

Mode Manager Advanced - [Early Morning (Voice)]: HSM status successfully updated to 'disarmed' (Confirmed in 572ms).

app:9372026-08-27 07:17:37.918 AM

trace

Mode Manager Advanced - [Early Morning (Voice)]: HSM Event Received -> Value: 'disarmed' | Source: 'hsmStatus'

app:9372026-08-27 07:17:37.915 AM

trace

Mode Manager Advanced - [Early Morning (Voice)]: === Mode Manager Adv [Handler: HSM Status Update ('disarmed')] Begins ===

app:52026-08-27 07:17:37.866 AM

warn

Alert Intrusion-Night canceled

app:52026-08-27 07:17:37.704 AM

info

Disarmed

app:9372026-08-27 07:17:37.598 AM

trace

Mode Manager Advanced - [Early Morning (Voice)]: === Mode Manager Adv [Pipeline: Override | Alexa Awake Switch 'Alexa Mode - Awake' (on via Alexa Voice Routine) | tx_1787840252491_16] Ends ===

app:9372026-08-27 07:17:37.595 AM

trace

Mode Manager Advanced - [Early Morning (Voice)]: COMPLETE TRANSACTION #tx_1787840252491_16 -> Mode: 'Early Morning' | Reason: 'Voice'

app:9372026-08-27 07:17:37.592 AM

trace

Mode Manager Advanced - [Early Morning (Voice)]: === syncOutputs Execution Sequence Completed ===

app:9372026-08-27 07:17:37.523 AM

trace

Mode Manager Advanced - [Early Morning (Voice)]: Scheduling verification check 'verifyHsmSync' in 6 seconds to confirm receipt...

app:9372026-08-27 07:17:37.384 AM

trace

Mode Manager Advanced - [Early Morning (Voice)]: DISPATCHING LOCATION EVENT -> sendLocationEvent(name: 'hsmSetArm', value: 'disarm') [Timestamp: 07:17:37.382 AM]

app:9372026-08-27 07:17:37.376 AM

trace

Mode Manager Advanced - [Early Morning (Voice)]: HSM state transition required. Current: 'armedNight' | Target: 'disarmed' → Dispatching location event: disarm

app:9372026-08-27 07:17:37.373 AM

trace

Mode Manager Advanced - [Early Morning (Voice)]: HSM In-Flight Guard Inspection -> PendingTarget: 'null' | MatchingPending: false | ExpiresMs: 0 | CurrentMs: 1787840257365 | WindowActive: false

app:9372026-08-27 07:17:37.368 AM

trace

Mode Manager Advanced - [Early Morning (Voice)]: syncHsmState Evaluation -> Current Location HSM: 'armedNight' | Expected Target: 'disarmed' | Command: 'disarm' | Reason: 'Voice' | RetryCount: 0

app:9372026-08-27 07:17:37.358 AM

trace

Mode Manager Advanced - [Early Morning (Voice)]: HSM Target Calculation -> Mode: 'Early Morning' | Period: 'earlyMorning' | IsSleeping: false | Calculated Target: 'disarmed' (disarm)

app:9372026-08-27 07:17:37.355 AM

trace

Mode Manager Advanced - [Early Morning (Voice)]: syncOutputs [Step 3/3]: Evaluating HSM state synchronization...

app:9372026-08-27 07:17:36.320 AM

trace

Mode Manager Advanced - [Early Morning (Voice)]: Sending audio speech notification to 'Bedroom Echo w/Clock'

app:9372026-08-27 07:17:34.218 AM

trace

Mode Manager Advanced - [Early Morning (Voice)]: Sending audio speech notification to 'Office Echo Left w/Clock'

app:9372026-08-27 07:17:33.899 AM

trace

Mode Manager Advanced - [Early Morning (Voice)]: Sending standard push notification to 'Notifications Tile'

app:9372026-08-27 07:17:33.268 AM

trace

Mode Manager Advanced - [Early Morning (Voice)]: Calling setStatus() on tile device with extended metadata payload...

app:9372026-08-27 07:17:33.265 AM

trace

Mode Manager Advanced - [Early Morning (Voice)]: SINGLE-ACK CONSUMED: Confirmed internal output sync for 'Mode - Early Morning' [56:on]

app:9372026-08-27 07:17:33.246 AM

trace

Mode Manager Advanced - [Early Morning (Voice)]: updateStatusTileDevice -> Updating 'Virtual Mode Status Tracker Tile' | Mode: 'Early Morning' | Reason: 'Voice' | HSM: 'Armed Night' | Time: '07:17:33 AM'

app:9372026-08-27 07:17:33.238 AM

trace

Mode Manager Advanced - [Early Morning (Voice)]: syncOutputs [Step 2/3]: Processing status tile update and push notifications...

app:9372026-08-27 07:17:32.852 AM

trace

Mode Manager Advanced - [Early Morning (Voice)]: Syncing Output Device 'Mode - Early Morning' [ID: 56 | Target: ON]

app:9372026-08-27 07:17:32.692 AM

trace

Mode Manager Advanced - [Early Morning (Voice)]: SINGLE-ACK CONSUMED: Confirmed internal output sync for 'Mode - Awake' [64:on]

app:9372026-08-27 07:17:32.685 AM

trace

Mode Manager Advanced - [Early Morning (Voice)]: Syncing Output Device 'Mode - Sleeping' [ID: 61 | Target: OFF]

app:9372026-08-27 07:17:32.594 AM

trace

Mode Manager Advanced - [Early Morning (Voice)]: Syncing Output Device 'Mode - Awake' [ID: 64 | Target: ON]

app:9372026-08-27 07:17:32.589 AM

trace

Mode Manager Advanced - [Early Morning (Voice)]: syncOutputs [Step 1/3]: Synchronizing Presence, Sleep, and Alexa switches...

app:9372026-08-27 07:17:32.586 AM

trace

Mode Manager Advanced - [Early Morning (Voice)]: Parameters -> TargetMode: 'Early Morning' | PeriodKey: 'earlyMorning' | Reason: 'Voice' | IsSleeping: false | IsStartupSync: false

app:9372026-08-27 07:17:32.584 AM

trace

Mode Manager Advanced - [Early Morning (Voice)]: === syncOutputs Execution Sequence Initiated ===

app:9372026-08-27 07:17:32.566 AM

info

Mode Manager Advanced - [Sleeping (Voice)]: Changing Hubitat Location Mode from 'Sleeping' to 'Early Morning' | Reason remains 'Voice' (Alexa Awake Switch 'Alexa Mode - Awake' (on via Alexa Voice Routine))

app:9372026-08-27 07:17:32.560 AM

trace

Mode Manager Advanced - [Sleeping (Voice)]: === Mode Manager Adv [Pipeline: Override | Alexa Awake Switch 'Alexa Mode - Awake' (on via Alexa Voice Routine) | tx_1787840252491_16] Begins ===

app:9372026-08-27 07:17:32.473 AM

trace

Mode Manager Advanced - [Sleeping (Voice)]: Alexa Awake Switch changed to 'on' (Voice Marker Active: true | Attributed Reason: 'Voice')

app:9372026-08-27 07:17:32.470 AM

trace

Mode Manager Advanced - [Sleeping (Voice)]: Alexa Voice Source Marker verified successfully (1864ms remaining in routine burst window).

app:9372026-08-27 07:17:31.907 AM

trace

Mode Manager Advanced - [Sleeping (Voice)]: Syncing Output Device 'Alexa Mode - Voice Source' [ID: 1025 | Target: OFF]

app:9372026-08-27 07:17:31.902 AM

trace

Mode Manager Advanced - [Sleeping (Voice)]: Alexa Voice Marker activated. Trigger window open for 2500ms.

I expect to be directed away from HSM being the cause - but no failure on my part is visible. How do I turn Logging Up (trace/debug etc) on HSM?

The exact issue - he HSM Gui Label on my hub did not update and still shows previous state on the GUI app screen as. I do not cache my browser, and this was a fresh window open in Firefox. If I enter and exit the HSM app, (without touching anything) it clears.

I first noticed this today during basic log review as I improve my Mode Manager app. I have zero rules that touch HSM and my HSM has no external triggers except for my app. I manage it directly and only from my Mode Manager app.

"these logs also include the safety monitor. It is currently showing 'armed night' in my GUI. I'm up, home and awake. its currently Morning period. what failed?

My bug hunt - evaluation of logs produced this:

I found the important part, and the Mode Manager itself did not fail to disarm HSM during the Morning transition.

In fact, the logs show the opposite.

What happened

At 07:17:37, your voice wake transaction explicitly calculated that HSM should be disarmed:

  • Mode: Early Morning

  • Control Source: Voice

  • Awake: true

  • Target: disarmed

It then dispatched the disarm command because HSM was armedNight.

Hubitat then reported the HSM status as disarmed 572 ms later, and the app cleared its pending HSM target. The verification check also passed.

Then at 07:30, the Morning scheduled transition ran. It calculated:


Mode: Morning
Period: morning
IsSleeping: false
Expected HSM: disarmed

And it found HSM was already disarmed, so correctly did not send another disarm command.

The Morning tile update also explicitly recorded:

HSM: Disarmed

So why is HSM currently Armed Night?

That means something happened after the logged Morning transaction or the HSM label has failed to reset.

The Mode Manager's last demonstrated HSM action was correct:


07:17:37  Mode Manager disarms HSM
07:17:37  HSM confirms disarmed
07:17:43  Verification passes
07:30:01  Morning evaluates HSM
           Current: disarmed
           Expected: disarmed
           No action required

My conclusion

The current Armed Night state was not caused by the failure of the Morning schedule to disarm HSM. The app successfully disarmed it before Morning even started, and Morning confirmed it remained disarmed.

Therefore, one of these occurred afterward:

  1. Another app or automation armed HSM.

  2. A manual/dashboard action armed HSM.

  3. An HSM-related automation or rule reacted to another device/state change.

  4. Less likely: Hubitat's HSM state changed without the relevant event appearing in the portion of logs supplied.

The key next thing to find is an event like:


HSM Event Received -> Value: 'armedNight'

after 07:30 AM.

That event would tell us exactly when HSM changed back.

One thing I would specifically investigate

Your Mode Manager is subscribed to HSM status and logs HSM changes, as demonstrated by the successful armedNight and disarmed events earlier. So if HSM is now Armed Night and the Mode Manager remained running/subscribed, I would expect a corresponding HSM status event.

That makes me suspicious that the later change may have occurred outside this particular log window, or that there was some app reload/update/subscription interruption afterward.

But based on the logs we have:

Mode
Manager did its job correctly. It armed HSM at Wee Hours, disarmed it
when you woke, verified the disarm, and confirmed at Morning that HSM
was still disarmed.

So the failure is almost certainly a subsequent re-arm from somewhere else, rather than the Morning period logic itself.

How does HSM know you are no longer in night mode if you did not set it to use modes to change? Mode Manager != Hubitat Safety Monitor. Complete logs around the events would be helpful, because it is unclear how you "programatically" changed the modes the way you stated you did. However, the logs as shown look like it armed at 12:30 AM the previous night, and was never disarmed until the next morning until 07:17, at which time it canceled the existing intrusion alert that had been triggered by the door contact that opened at 12:57. This is not surprising as you have not defined any way to cancel the alerts in your HSM setup.

I let modes control mine, and have 0 issues. But, it is not Mode Manager controlling HSM. It is HSM subscribing to the modes by setting them up in HSM (which your image shows that you have not done)

Programatically.

private void syncHsmState(String expectedHsmStatus, String hsmCmd, String controlSource, int retryCount = 0) {
if (!getSettingBool("manageHSM", true)) return

String currentHsm = location.hsmStatus ?: "unknown"

// If HSM is already in the expected state, clear any pending flags and return
if (currentHsm == expectedHsmStatus) {
    state.pendingHsmTarget = null
    return
}

logInfo "HSM status transition initiated -> Target: '${expectedHsmStatus}' | Command: '${hsmCmd}' | Control Source: '${controlSource}'"

// Programmatically set HSM arming state via Hubitat location event
sendLocationEvent(name: "hsmSetArm", value: hsmCmd)

// Schedule a post-dispatch verification check to confirm state receipt
runIn(6, "verifyHsmSync", [data: [expectedHsm: expectedHsmStatus, commandedHsm: hsmCmd, retryCount: retryCount]])

}