bitfocus / companion-module-stagetimerio-api

MIT License
2 stars 3 forks source link

Using websocket to get variables #2

Closed lhermann closed 7 months ago

lhermann commented 2 years ago

The current web socket API is not documented and uses Firebase authentication tokens.

In order to have variables available in Companion we need add a publicly available and documented web socket that uses the same authentication method Authorization: Bearer YOUR_API_KEY

Events (thinking out loud):

What time/date format works best for Companion? Will ISO strings work? "2021-12-03T06:52:14.141Z"

In response to:

@estilles @nacalai creator of stagetimer.io here. Sorry for reviving this thread 😅

Currently the API does not return values. Internally we use web sockets. How could we make values like message text or current time available as variables in Companion?

Hey Lukas! We spoke briefly via email a few weeks ago. I've been meaning to send you and Liz a message regarding adding feedbacks and variables to the module.

There're many ways to tackle this, but since you're already using web sockets internally, that might be the way to go. I guess my questions are:

If the answers to these questions are yes, then we can definitely use web sockets to add feedbacks and variables to the module.

This is a separate topic though. We should probably create a separate issue.

Originally posted by @estilles in https://github.com/bitfocus/companion-module-hermann-stagetimerio/issues/1#issuecomment-985256752

estilles commented 2 years ago

In order to have variables available in Companion we need add a publicly available and documented web socket that uses the same authentication method Authorization: Bearer YOUR_API_KEY

That would be great! I'm assuming the module will stop using the REST API, and this new web sockets API will will provide the ability to both trigger Stagetimer actions and receive state/feedbacks as well. Correct?

Is this new web sockets API currently on your roadmap?

Events (thinking out loud):

  • Timer changes (start, stop, reset, ...)
  • Message changes (show, hide, color, text, ...)
  • Blackout (true, false)

Definitely. I can probably think of a few more.

lhermann commented 2 years ago

This new web sockets API will provide the ability to both trigger Stagetimer actions and receive state/feedbacks as well. Correct?

Should not be too difficult to implement all endpoints as events. So yes.

Is this new web sockets API currently on your roadmap?

It is now ;)

Definitely. I can probably think of a few more.

By all means, please :)

estilles commented 2 years ago

That's great news. Please let me know when you have an API I can use to test and update this module.

Right now your REST API provides the ability to:

The following could be useful:

Settings

Timers

Messages


It would be nice to have to ability to retrieve the state of the following:


I'm sure I'm missing something. If I remember I'll update this thread.

lhermann commented 2 years ago

@estilles I'll get back to you as soon as I have time to work in this. Probably early January 👍

estilles commented 2 years ago

Sounds good @lhermann. I'll be standing by.

lhermann commented 2 years ago

Hey @estilles, sorry for the delay here. I had some personal things coming in between. The topic is till top 2 on our priority list.

estilles commented 2 years ago

@lhermann! Great to hear from you. I was out sick for a while as well at the beginning of the year. I'm back now, so will just stand by for your updates.

davidjoshuaford commented 2 years ago

Following this project with interest!

+1 to get countdown timer variables back into Companion so a countdown clock and feedback colors can be added to a button.

lhermann commented 2 years ago

@davidjoshuaford I did not forget about this. stagetimer.io became a bit more propular than I expected so I'm knee-deep into scaling right now which unfortunately took priority.

davidjoshuaford commented 2 years ago

Great to hear of its success! We used it on a live broadcast over the weekend and it kept our east coast and west coast studios in sync.

Would love to see ST feedback coming into Companion so that buttons can be triggered by a ST producer.

ie when a Stage Timer producer starts a timer, it presses a button to switch AUX outputs, play hyperdeck, mutes a mic etc. You could essentially build program cues around it and automate a ROS.

estilles commented 2 years ago

@lhermann I'm more than happy to continue helping out whenever you're ready.

lhermann commented 1 year ago

New API is released including a publicly available websocket: https://stagetimer.io/docs/api-v1/

MatteoGheza commented 1 year ago

@estilles let me know if I can help you