Site Tools


Sidebar

coding_projects:obs_plugin_countdown_timer:v1.x

This is an old revision of the document!


Countdown Timer Version 1.x

Installation

To install the plugin, run the installer for your operating system. These are available here. This should install the plugin into the correct folder.

Usage Guide

General Settings

  1. Add an OBS Text Source to your scene.
  2. Select the Docks menu and click on Countdown Timer. (This should display the countdown dockable widget on screen)
  3. Either keep the plugin as a floating window or dock it on the OBS screen by dragging to a relevant area.
  4. On the plugin, select the text source you created in step 1 from the Source dropdown menu.
  5. You have two ways to set the timer:
    1. Option 1 – Set the counter by manually setting the number of days, hours, minutes and seconds. #Option 1
    2. Option 2 – Set a datetime for the timer to countdown to. #Option 2

Countdown Option 1 - Set Days/Hours/Minutes/Seconds

  1. Click on the period tab to manually set the counter datetime.
  2. Set the days, hours, minutes and seconds in the edit fields.
  3. Click the set/reset button (left button) to set the time to the timer and text field.
  4. Click the play button (right button) to start the timer.
  5. Clicking the pause button will pause the timer. To continue, press the play button again.
  6. After pausing, clicking the set/reset button will reset the timer to the datetime in the input fields.

Countdown Option 2 - Set Time to Countdown to

  1. Click on the datetime tab to set the time.
  2. In the time edit field, set what date and time you want to count down to.
  3. Click the play button (right button) to start the timer.
  4. Clicking the stop button will pause the timer. To continue, press the play button again. This will update the timer and carry on counting down.

Options

Time Display Options

You can choose what to display on the Text Source (days, hours, minutes and/or seconds). Click on the checkbox next to the unit of time you wish to display. For example, selecting minutes and seconds only will show the time in the mm:ss format.

You can select whether to show leading zeros or not by ticking/unticking the Leading Zero tick box.

Count Up

Ticking the Count Up tick box will have the timer count up to the set time.

  • For period: when clicking the set button, the timer will reset to zero and then the play button starts the timer to count up to the set period.
  • For datetime: clicking the play button will reset the timer to zero and then start counting up to the period between when the timer was started and the datetime entered in the datetime field.

End Message

The End Message feature will play a measure when the timer hits zero. Click the tickbox next to the Message field to enable it. Enter the message in the text field that you want displayed when the timer runs out.

Switch Scene

The Scene feature allows you to switch to a scene when the timer runs out. Click the checkbox next to the Scene dropdown to enable it. Select the source you wish to switch automatically to once the timer runs out.

OBS Hotkeys

You can set the following hotkeys:

  • Start Countdown Timer – period start button
  • Pause Countdown Timer – period pause button
  • Set Countdown Timer – period set button
  • Start Countdown To Time – time start button
  • Stop Countdown To Time – time stop button

Websocket Hooks

Connect to the OBS websocket connection using the instructions for Websocket here: OBS Websocket.

Send Messages

  • The vendor name for the plugin is: ashmanix-countdown-timer
  • To activate a function you need to send a message with the following JSON data:
{
    "op": 6,
    "d": {
        "requestType": "CallVendorRequest",
        "requestId": "{{customId}}",
        "requestData": {
            "vendorName": "ashmanix-countdown-timer",
            "requestType": "{{requestType}}"
        }
    }
}

The requestType value will determine what function will be activated. Use the above template and replace

{{customId}}

with a custom ID string and

{{requestType}}

with one of the request type strings listed below:

  • Start Countdown Timer – activates the period start button – requestType: period_play
  • Pause Countdown Timer – activates the period pause button – requestType: period_pause
  • Set Countdown Timer – activates the period set button – requestType: period_set
  • Start Countdown To Time – activates the time start button – requestType: to_time_play
  • Stop Countdown To Time – activates the time stop button – requestType: to_time_stop
  • Add Time To Timer (v1.4.2)

Adds more time to the timer – requestType: add_time, requestData.requestData: dd:hh:mm:ss. An example is shown below:

{
    "op": 6,
    "d": {
        "requestType": "CallVendorRequest",
        "requestId": "{{customId}}",
        "requestData": {
            "vendorName": "ashmanix-countdown-timer",
            "requestType": "add_time",
            "requestData": {
                "time_to_add": "00:01:01:01"
            }
        }
    }
}
  • Set Timer Time (v1.4.2)

Sets the timer – requestType: set_time, requestData.requestData: dd:hh:mm:ss. An example is shown below:

{
    "op": 6,
    "d": {
        "requestType": "CallVendorRequest",
        "requestId": "{{customId}}",
        "requestData": {
            "vendorName": "ashmanix-countdown-timer",
            "requestType": "set_time",
            "requestData": {
                "time_to_set": "00:02:02:02"
            }
        }
    }
}
Emitted Messages

The following are emitted from the timer:

  • Timer State Changed (v1.4.2) – emitted when the timer:
    • Starts
    • Pauses
    • Stops
    • Completes
    • It will be in the form of:
{
    "op": 5,
    "d": {
        "eventData": {
            "eventData": {
                "state": "{{stateChange}}",
                "text_source": "{{textSource}}",
                "timer_id": "{{timerID}}"
            },
            "eventType": "{{timerStateChange}}",
            "vendorName": "ashmanix-countdown-timer"
        },
        "eventIntent": 512,
        "eventType": "VendorEvent"
    }
}
  • Timer Tick (v1.4.2) – emitted when the timer ticks. It will be in the form of:
{
    "op": 5,
    "d": {
        "eventData": {
            "eventData": {
                "time_display": "00:00:00:01",
                "time_left_ms": 1000,
                "timer_id": "{{timerID}}"
            },
            "eventType": "timer_tick",
            "vendorName": "ashmanix-countdown-timer"
        },
        "eventIntent": 512,
        "eventType": "VendorEvent"
    }
}
coding_projects/obs_plugin_countdown_timer/v1.x.1748767286.txt.gz · Last modified: by admin