Giter VIP home page Giter VIP logo

Comments (9)

bluepixel00 avatar bluepixel00 commented on August 25, 2024 1

For others wishing to implement this "hack" you would add something like the following to your script / automation. A script has an "off" or "on" state. "on" when it is actively running

condition: template
value_template: "{{not is_state('script.your_script_name','on') }}"

Along with a delay at the end after the service is executed.
delay: '00:0:15'

from dasshio.

stavfx avatar stavfx commented on August 25, 2024 1

I think that since #82 the timeout config is no longer being used

from dasshio.

bluepixel00 avatar bluepixel00 commented on August 25, 2024

This is occurring with 0.3.6 dashio and home assistant 0.93.2 but was working in a previous version of both dashio and home assistant. The only way I was able to remove the impact of this issue was by modifying my script to only run when it is not already running. This seems to have solved the repeated triggers from dashio. Is nobody else seeing this issue?

from dasshio.

neilma1 avatar neilma1 commented on August 25, 2024

Yup - theres a few of us that reported it in issue #86 (admitedly the title isnt as explicit as yours :)
Mind sharing the script? My buttons were set up originally to toggle a light. However I have had to modify mine to just switch the light off rather than toggle (however means I have turn the light on manually :)

What would the script look like?

from dasshio.

bluepixel00 avatar bluepixel00 commented on August 25, 2024

Since I am using this button as a weather report I added a condition to see if the speaker is still playing and then added a delay at the end since each button press last for 20 seconds.

`weather_report:
alias: Weather Report
sequence:

  • condition: template
    value_template: "{{not is_state('media_player.basement_speaker','playing') }}"
  • service: media_player.volume_set
    data:
    entity_id: media_player.basement_speaker
    volume_level: '.30'
  • service: tts.google_say
    entity_id: media_player.basement_speaker
    data_template:
    message: 'It is {{ now().strftime( "%-I" )}} {{ "%0.02d" | format(now().strftime("%-M") | int) }} {{ now().strftime( "%p" )}}.
    The weather is currently {{states.sensor.dark_sky_summary.state}} and feels like {{states.sensor.dark_sky_apparent_temperature.state|round}} degrees.'
    cache: false
  • delay: '00:0:15'`

from dasshio.

bluepixel00 avatar bluepixel00 commented on August 25, 2024

In your case you could just prevent the script from running again with a similar condition and adding the delay.

from dasshio.

neilma1 avatar neilma1 commented on August 25, 2024

Thank you! I have taken the weather idea and implemented that. Will work on changing my switches to follow the same process over next few days. Much appreciated!

from dasshio.

bluepixel00 avatar bluepixel00 commented on August 25, 2024

Glad it works. I know it is a hack but at least it gets things running again. Prior to this change my weather report would keep restarting for the first 20 seconds and then finish so didn't make it very helpful. :)

from dasshio.

capstan1 avatar capstan1 commented on August 25, 2024

For others wishing to implement this "hack" you would add something like the following to your script / automation. A script has an "off" or "on" state. "on" when it is actively running

condition: template
value_template: "{{not is_state('script.your_script_name','on') }}"

Along with a delay at the end after the service is executed.
delay: '00:0:15'

Sorry fpr the noobish question, but could you give me an Example of a Script I could use for toggling a light?

from dasshio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.