I’m encountering an issue when trying to run a script outside the Home Assistant app. I’ve created a simple script to turn on or off the dining room light. The script works perfectly fine when run within the Home Assistant app, but I’m having trouble when attempting to trigger it outside the app. Here’s what I tried:
-
Added a widget on the desktop with the script and tried to run it.
-
Added a button in the control center linked to the script.
-
Created a shortcut with the script and ran it via the Shortcuts app.
Unfortunately, none of these methods worked. I also noticed that none of them generated any logs in Home Assistant, so I can’t pinpoint where the problem might be.
When running the script via the shortcut, I receive an error indicating that it didn’t finish executing in time. I’ve attached a screenshot of the error message below.
Has anyone else experienced this issue, or does anyone have suggestions on how to troubleshoot this further? Any help would be greatly appreciated. Thank you!
alias: "Meal light "
sequence:
- action: light.toggle
metadata: {}
data: {}
target:
device_id: 198d161390376cf7db9e4dba0f0a5054
- choose:
- conditions:
- condition: state
state: "on"
entity_id: light.dinning_light_mss510x_main_channel
sequence:
- action: light.turn_off
metadata: {}
data: {}
target:
device_id: cefee030501d4e3b4029c9c20c12bdb9
- conditions:
- condition: state
state: "off"
entity_id: light.dinning_light_mss510x_main_channel
- condition: or
conditions:
- condition: sun
after: sunset
- condition: state
state: snowing
entity_id: weather.forecast_home
- condition: state
entity_id: weather.forecast_home
state: cloudy
- condition: state
entity_id: weather.forecast_home
state: rainy
sequence:
- action: light.turn_on
metadata: {}
data: {}
target:
device_id: cefee030501d4e3b4029c9c20c12bdb9
description: Switch lights for meal time
icon: mdi:silverware