Giter VIP home page Giter VIP logo

Comments (5)

thedist avatar thedist commented on September 26, 2024 1

That's already possible.

Set the Event to Startup
Set the Condition to internal: Variable: Check boolean expression with the Expression timestampToSeconds($(internal:time_hms)) >= 36000 && timestampToSeconds($(internal:time_hms)) <= 37800
Set the Action to whatever you want

That will check once on startup if the time is between 10:00:00 and 10:30:00 inclusive. If it is between that time the action is triggered.

If you also wanted to handle the case of startup being at 09:55:00 but still want the action to fire when it hits 10:00:00 there are other ways to do it, such as using a variable to see if the thing has already been triggered, that way it doesn't matter how many times the event fires to check (so you could add an additional event to fire at 10:00:00 in case Companion starts up prior to that) and have the action also change a variable to true and adjust the condition to check that variable to see if it has already fired once or not.

from companion.

Julusian avatar Julusian commented on September 26, 2024 1

@thedist thats a good suggestion.

I think the only thing we should do to improve this is to have a new feedback/condition to make these timestamp comparisons easier to do

from companion.

ukiews avatar ukiews commented on September 26, 2024

@thedist Thank you!
If I want this to check for a specific day of the week as well, would I add an "Event" "Time of Day" and keep the time cleared?

from companion.

Julusian avatar Julusian commented on September 26, 2024

If I want this to check for a specific day of the week as well, would I add an "Event" "Time of Day" and keep the time cleared?

no, you should add another condition of type internal: Variable: Check boolean expression with the Expression $(internal:time_dow) == 1 || $(internal:time_dow) == 2 or whatever the check should be based on which days it should be.

To explain, the events aren't filters. Having multiple events just means more times/scenarios when the trigger should be executed. The conditions can then be used to decide whether to actually run the trigger each time one of the events says to execute.

from companion.

ukiews avatar ukiews commented on September 26, 2024

If I want this to check for a specific day of the week as well, would I add an "Event" "Time of Day" and keep the time cleared?

no, you should add another condition of type internal: Variable: Check boolean expression with the Expression $(internal:time_dow) == 1 || $(internal:time_dow) == 2 or whatever the check should be based on which days it should be.

To explain, the events aren't filters. Having multiple events just means more times/scenarios when the trigger should be executed. The conditions can then be used to decide whether to actually run the trigger each time one of the events says to execute.

Got it. Basically, they execute as OR, not AND. A description note would be helpful next to the field.

from companion.

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.