Unknown source of "turn off switch action"

I have a few simple automations, one of which is to turn off a water valve at 10pm if alarmo is "armed away". Instead, it turns off immediately upon arming away.
The "activity message":
House water turned off triggered by action Switch: Turn off switch
1:11:58 PM - 42 minutes ago
Ring Keypad Automations triggered by state of Alarmo changed to Armed away
1:11:58 PM - 42 minutes ago
As you can see (reading from bottom to top), the system was armed away and the water was then turned off by "action Switch: Turn off switch"

While the subject switch exists, it wasn't activated by anything that I can find. The valve opens and closes properly when I do move the switch slider from on to off, etc.

The automations YAML for the intended function is here but the actiivity log shows it hasn't run yet.:

- id: '1781327843586'
  alias: House water off when armed away
  description: ''
  triggers:
  - trigger: time
    at: '22:00:00'
  conditions:
  - condition: device
    device_id: 5fa77a7b5b880eb8283d0317ba0606e2
    domain: alarm_control_panel
    entity_id: 42115a39821e4b598e534f19aa0942c8
    type: is_armed_away
  actions:
  - type: turn_off
    device_id: a60e28437339755eae757011ddf8183b
    entity_id: 9351b59df0a5058563ee0ef9cd669b0d
    domain: switch
  mode: single

The only other references to this device (water valve) are the automation to turn the valve on when the alarm is disarmed, and to turn the valve off when the moisture is detected in one of three moisture sensors. The "turn on when disarmed" works properly and is logged appropriately, the moisture detection hasn't trigerred and shows having never trigerred.

I am baffled!

Hi, welcome to the forum!

Have a look at this: Why and how to avoid device_ids in automations and scripts

Thanks, good advice for going forward regarding device IDs. Any idea how I can track down this problem? One additional piece of info, my first automation for the water valve was to simply turn it off when armed away, and that worked as advertised. However, I didn't want to cycle the valve everytime I armed away unless I was really away as in overnight, so I changed the automation to what is listed in the post, but the valve still closes immediately upon "armed away", as if the old auitomation is still around someplace though not visible either when inspecting the YAML or when reviewing the automations in the UI. I've updated everything, cleared caches, restarted everyting multiple times. I'm tempted to delete the automations file, and see what happens when "armed away".

From the automation that you are sharing, I can tell you that the trigger fires at 22h00 and IF that condition is met, the action runs.
Have you looked at the traces (upper right corner when editing the autmation)?
Also, if you look at the activity from the switch itself, you also can see what happens.

Post this automation...

To test and review results, etc….. I armed the system to away and the system immediately turned off the water valve. Reviewing the "armed away automation", it says "never triggered", reviewing the trace, it shows it last started last night at 10pm (as it should) but didn't execute because the system was armed to home, not away. This is correct. Conclusion is the "armed away" automation, with the 10pm requirement, isn't the source of the command turning off the water.
When I disarmed the system, the water valve turned on as it should, and the automation shows last triggered at the time of disarming, as it should.
Reviewing "activity", here are the lines at issue:
House water turned off triggered by action Switch: Turn off switch
10:52:12 AM - 47 minutes ago
Ring Keypad Automations triggered by state of Alarmo changed to Armed away
10:52:12 AM - 47 minutes ago
Note Alarmo went "armed away" followed (line preceding) by "house water turned off triggered by action Switch: Turn off switch"
There seems to be nothing connected to the switch except the automations discussed for "armed away" and "disarmed", and water leak detected (3 different sensors). The only automation showing ever run is the "on when disarmed". None of the automations that turn off the water show any history of activity.

Here's the complete automation.yaml

- id: '1769725357980'
  alias: Driveway lights on at sunset
  description: ''
  triggers:
  - trigger: sun
    event: sunset
    offset: 0
  conditions: []
  actions:
  - type: turn_on
    device_id: 0e96540d3a771ab987b0d82fd4b8daa9
    entity_id: 4dd8ea0a840d18bb23ea8b866ed69468
    domain: switch
  mode: single
- id: '1769725456638'
  alias: Driveway Lights off at 9PM
  description: ''
  triggers:
  - trigger: time
    at: '21:00:00'
    weekday:
    - sun
    - mon
    - tue
    - wed
    - thu
    - fri
    - sat
  conditions: []
  actions:
  - type: turn_off
    device_id: 0e96540d3a771ab987b0d82fd4b8daa9
    entity_id: 4dd8ea0a840d18bb23ea8b866ed69468
    domain: switch
    metadata:
      secondary: false
  mode: single
- id: '1770420468256'
  alias: Away lights on
  description: ''
  triggers:
  - trigger: sun
    event: sunset
    offset: 0
  conditions:
  - condition: time
    before: '22:00:00'
  - condition: device
    device_id: 5fa77a7b5b880eb8283d0317ba0606e2
    domain: alarm_control_panel
    entity_id: 42115a39821e4b598e534f19aa0942c8
    type: is_armed_away
  actions:
  - type: turn_on
    device_id: 841a4a3c1cbbad0eabcbd82e01c98002
    entity_id: 59fc0beed02123b3ae740a6613f3216e
    domain: switch
  - type: turn_on
    device_id: 8e4ffbb3ea7c68f3b24b271095fb20f6
    entity_id: 893d21767ea1a882de6bbb44cac60825
    domain: switch
  - type: turn_on
    device_id: 6c1e4d2c81cddfeb299b41e6f256da98
    entity_id: 16a190e1912b5c8f8ca676311f51fd13
    domain: switch
  mode: single
- id: '1770420556419'
  alias: Away lights off
  description: ''
  triggers:
  - trigger: time
    at: '22:00:00'
  conditions: []
  actions:
  - type: turn_off
    device_id: 841a4a3c1cbbad0eabcbd82e01c98002
    entity_id: 59fc0beed02123b3ae740a6613f3216e
    domain: switch
  - type: turn_off
    device_id: 8e4ffbb3ea7c68f3b24b271095fb20f6
    entity_id: 893d21767ea1a882de6bbb44cac60825
    domain: switch
  - type: turn_off
    device_id: 6c1e4d2c81cddfeb299b41e6f256da98
    entity_id: 16a190e1912b5c8f8ca676311f51fd13
    domain: switch
  mode: single
- id: '1771885985925'
  alias: Ring Keypad Automations 2
  description: ''
  use_blueprint:
    path: ImSorryButWho/synchronize-ring-alarm-keypad-v2-with-alarmo.yaml
    input:
      keypad: c37b018ca72f62bb3fb83be183aa4ac1
      alarm: alarm_control_panel.alarmo
- id: '1771886534862'
  alias: Ring Keypad Automations 3
  description: ''
  use_blueprint:
    path: ImSorryButWho/synchronize-ring-alarm-keypad-v2-with-alarmo.yaml
    input:
      keypad: 3a75ef973094a2d177476e48ff081d12
      alarm: alarm_control_panel.alarmo
- id: '1771902455785'
  alias: Ring Keypad Automations
  description: ''
  use_blueprint:
    path: ImSorryButWho/synchronize-ring-alarm-keypad-v2-with-alarmo.yaml
    input:
      keypad: 499aea8ccd0cb73a7d006ce535e3744d
      alarm: alarm_control_panel.alarmo
- id: '1772922642052'
  alias: Send fire alarm to Monitoring company
  description: ''
  triggers:
  - trigger: state
    entity_id:
    - binary_sensor.5_alarm_panel_pro_55bb2c_zone_4
    - binary_sensor.5_alarm_panel_pro_55bb2c_zone_2
    - binary_sensor.5_alarm_panel_pro_55bb2c_zone_3
    - binary_sensor.5_alarm_panel_pro_55bb2c_zone_1
    to:
    - 'on'
  conditions: []
  actions:
  - action: notify.mobile_app_sm_s901u
    metadata: {}
    data:
      message: Fire / Smoke / Heat Detected
  - action: noonlight.create_alarm
    metadata: {}
    data:
      service: fire
  mode: single
- id: '1773013679666'
  alias: New automation
  description: ''
  triggers:
  - type: moist
    device_id: ede9dff89dfeb5cf2a977f526a57e6fb
    entity_id: 03d15232be022e7c3a20d1e0a22aafd4
    domain: binary_sensor
    trigger: device
    for:
      hours: 0
      minutes: 10
      seconds: 0
  - type: moist
    device_id: f9c2bb729aa502e829f597e9c472acf4
    entity_id: 48383faeb451d62c3289803392443d97
    domain: binary_sensor
    trigger: device
    for:
      hours: 0
      minutes: 10
      seconds: 0
  - type: moist
    device_id: f877639b3815d3fd7d8c7a19949032a7
    entity_id: 220c47b8ffe9deb34e9c143034802588
    domain: binary_sensor
    trigger: device
  conditions: []
  actions:
  - type: turn_off
    device_id: a60e28437339755eae757011ddf8183b
    entity_id: 9351b59df0a5058563ee0ef9cd669b0d
    domain: switch
  - action: notify.mobile_app_sm_s901u
    metadata: {}
    data: {}
  mode: single
- id: '1773013822310'
  alias: Turn on water when disarmed
  description: ''
  triggers:
  - device_id: 5fa77a7b5b880eb8283d0317ba0606e2
    domain: alarm_control_panel
    entity_id: 42115a39821e4b598e534f19aa0942c8
    type: disarmed
    trigger: device
  conditions: []
  actions:
  - type: turn_on
    device_id: a60e28437339755eae757011ddf8183b
    entity_id: 9351b59df0a5058563ee0ef9cd669b0d
    domain: switch
  mode: single
- id: '1773076621727'
  alias: Pending Alarm Blinking Light
  description: ''
  triggers:
  - trigger: state
    entity_id:
    - alarm_control_panel.alarmo
    from:
    - armed_away
    to:
    - pending
  conditions: []
  actions:
  - repeat:
      while:
      - condition: state
        entity_id: alarm_control_panel.alarmo
        state:
        - pending
      sequence:
      - type: turn_on
        device_id: fe1ac924ca4e23c69ce4239b95f6ff20
        entity_id: 25178beaffbffcea5464ea34808aec72
        domain: switch
      - delay:
          hours: 0
          minutes: 0
          seconds: 0
          milliseconds: 500
      - type: turn_off
        device_id: fe1ac924ca4e23c69ce4239b95f6ff20
        entity_id: 25178beaffbffcea5464ea34808aec72
        domain: switch
      - delay:
          hours: 0
          minutes: 0
          seconds: 0
          milliseconds: 500
  - type: turn_off
    device_id: fe1ac924ca4e23c69ce4239b95f6ff20
    entity_id: 25178beaffbffcea5464ea34808aec72
    domain: switch
  mode: single
- id: '1780963154365'
  alias: Button_1
  description: ''
  triggers:
  - device_id: 1c8abf708e25fb583417c834e4f43016
    domain: zha
    type: remote_button_short_press
    subtype: button_1
    trigger: device
  conditions: []
  actions:
  - device_id: 8e4ffbb3ea7c68f3b24b271095fb20f6
    domain: select
    entity_id: e567123ad0a0fa8e510b1b3a2a22511f
    type: select_option
    option: Toggle
  mode: single
- id: '1780964966542'
  alias: Button_1
  description: ''
  triggers:
  - device_id: 1c8abf708e25fb583417c834e4f43016
    domain: zha
    type: remote_button_short_press
    subtype: button_1
    trigger: device
  conditions: []
  actions:
  - type: toggle
    device_id: 8e4ffbb3ea7c68f3b24b271095fb20f6
    entity_id: 893d21767ea1a882de6bbb44cac60825
    domain: switch
  mode: single
- id: '1781327843586'
  alias: House water off when armed away
  description: ''
  triggers:
  - trigger: time
    at: '22:00:00'
  conditions:
  - condition: device
    device_id: 5fa77a7b5b880eb8283d0317ba0606e2
    domain: alarm_control_panel
    entity_id: 42115a39821e4b598e534f19aa0942c8
    type: is_armed_away
  actions:
  - type: turn_off
    device_id: a60e28437339755eae757011ddf8183b
    entity_id: 9351b59df0a5058563ee0ef9cd669b0d
    domain: switch
  mode: single

Nick, I have exhausted the suggestions and posted the results. The "switch" isn't being activated by anything intentional in the programming, but is behaving like the original automation that did this exact thing, but was changed to incorporate the 10pm constraint, is still being executed. What can I do beside redoing the entire installation?

Have you tried restarting HA? You may be running old versions of the automations.

Yes, updates, restarted yaml, hard restart, power off and in, etc. I have since added other automations and they execute correctly. If you read the descriptions I provided, the history shows no automation was triggered when the water valve was turned off, the recorded activity is "switch off", which is what is recorded if I used the ui and just manually slid the on/off slider to off for the valve.

I loaded Spook today, it found 4 unknown entities related to my heat sensors, nothing to do with the water valve issue. Nothing else identified by Spook.

I ran some more tests today...
Log activity - see house water off at 3:05:19 manually by me, and turned off by who-knows-what at 2:59:54 after arming the system to "away".

House water turned on triggered by action Switch: Turn on switch
3:05:24 PM - 15 minutes ago - Erik Fjerstad
House water turned off triggered by action Switch: Turn off switch *manually turned off
3:05:19 PM - 15 minutes ago - Erik Fjerstad
SM-S901U changed to June 30, 2026 at 3:00 PM
3:00:17 PM - 20 minutes ago
House water turned on triggered by automation Water On when Disarmed triggered by state of Alarmo
3:00:17 PM - 20 minutes ago - Erik Fjerstad
Turn on water when disarmed triggered by action Alarm control panel: Disarm alarm
3:00:17 PM - 20 minutes ago - Erik Fjerstad - Traces
Ring Keypad Automations triggered by action Alarm control panel: Disarm alarm
3:00:17 PM - 20 minutes ago - Erik Fjerstad
Ring Keypad Automations 3 triggered by action Alarm control panel: Disarm alarm
3:00:17 PM - 20 minutes ago - Erik Fjerstad
Ring Keypad Automations 2 triggered by action Alarm control panel: Disarm alarm
3:00:17 PM - 20 minutes ago - Erik Fjerstad
Alarmo changed to Disarmed triggered by action Alarm control panel: Disarm alarm
3:00:17 PM - 20 minutes ago - Erik Fjerstad
SM-S901U changed to June 30, 2026 at 2:59 PM
2:59:54 PM - 20 minutes ago
House water turned off triggered by action Switch: Turn off switch The Offending Line
2:59:54 PM - 20 minutes ago
Ring Keypad Automations triggered by state of Alarmo changed to Armed away
2:59:54 PM - 20 minutes ago
Ring Keypad Automations 3 triggered by state of Alarmo changed to Armed away
2:59:54 PM - 20 minutes ago
Ring Keypad Automations 2 triggered by state of Alarmo changed to Armed away
2:59:54 PM - 20 minutes ago
Alarmo changed to Armed away
2:59:54 PM - 20 minutes ago
Ring Keypad Automations triggered by action Alarm control panel: Arm alarm away
2:58:24 PM - 22 minutes ago - Erik Fjerstad
Ring Keypad Automations 3 triggered by action Alarm control panel: Arm alarm away
2:58:24 PM - 22 minutes ago - Erik Fjerstad
Ring Keypad Automations 2 triggered by action Alarm control panel: Arm alarm away
2:58:24 PM - 22 minutes ago - Erik Fjerstad
Alarmo changed to Arming triggered by action Alarm control panel: Arm alarm away
2:58:24 PM - 22 minutes ago - Erik Fjerstad

When reviewing the "related automations" for the water valve, there are 3. One to turn off when a leak is detected, and this one hasn't run; one to turn off when armed away (which has the 10pm night condition) and it also has never run; and one to turn the valve on when disarmed, and it shows having run once "2 hours ago" which corresponds to the time in the above activity log.
Water Leak Detected - Garage - Never
Water off when armed away - Garage - Never
Water On when Disarmed - Garage - 2 hours ago