#i have an automation which keeps not
1 messages · Page 1 of 1 (latest)
`alias: Pool Schedule
description: ""
trigger:
- platform: state
entity_id:- input_boolean.pool_run_schedule
- platform: state
entity_id:- sensor.octopus_electricity_current_rate
to: null
- sensor.octopus_electricity_current_rate
- platform: state
entity_id:- schedule.pool_heater
to: null
- schedule.pool_heater
- platform: state
entity_id:- input_number.pool_heating_maximum_unit_cost
to: null
condition: []
action:
- input_number.pool_heating_maximum_unit_cost
- if:
- condition: state
alias: Run schedule is turned on
entity_id: input_boolean.pool_run_schedule
state: "on" - condition: state
alias: The schedule calls for heating
entity_id: schedule.pool_heater
state: "on" - condition: template
alias: Current electricity rate is below max
value_template: >-
{{ (states("sensor.octopus_electricity_current_rate") | float <=
states("input_number.pool_heating_maximum_unit_cost") | float / 100)
}}
then: - service: script.turn_on
data: {}
target:
entity_id: script.pool_cycle
else: - service: script.turn_off
data: {}
target:
entity_id: script.pool_cycle - service: switch.turn_off
data: {}
target:
entity_id:
- switch.pool_filter
- switch.pool_heat_pump
mode: single
`
- condition: state
I suspect that just because script.turn_on starts a script asynchronously, it may still count as the automation running as it's the parent
oh i see
You could run a simple test with an automation and a script that simply calls delay: xxxx
yes i could
Use an event trigger
can you detect if a script is running?
ok. i can also experiment with a different mode (maybe restart) for the automation,and only start the script if it's not running. i would need to experiment to see if the script gets cut down on the restart
is there anything i can do in an action which outputs a message to the log
thanks. i am sure i will be able to figure this out now