Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95451

Script's switch returns to off

$
0
0

@TheFax wrote:

Hello friends,
I have a script in my hassio that:

  1. turns on a fan
  2. wait some time (30…120 minutes, depends by a slider)
  3. then turn off the fan.

What I expect is: when I start the script via the related switch on the Lovelace interface, the switch goes to ON position and remains ON until the script is terminated and the fan turn off.

The probelm is when I turn on the switch, it returns to off after some seconds, but the script is not yet terminated and the fan is active. If I update the Home Assistant webpage (pressing F5 for example), the switch returns to on position as expected.

It’s a strange behaviour.

Could you help me?

This is the source of the script:

ventilazione_forzata:
  alias: "Ventilazione a tempo"
  sequence:
    - data:
        entity_id: switch.ventola
      service: switch.turn_on
    - delay:
        minutes: "{{ states('input_number.slider_fan') | int }}"
    - data:
        entity_id: switch.ventola
      service: switch.turn_off

My hassio is latest version (107.x), and it is installed into a Raspberry.
I have it since version 0.94, and this issue has always been present.
The fan is connected to a Sonoff with Tasmota firmware, but I think this is not useful, because the problem seems related to the script itself.

Posts: 3

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 95451

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>