Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot send event to different button from within a multi action #36

Open
JackMoran1 opened this issue Oct 25, 2023 · 2 comments
Open

Comments

@JackMoran1
Copy link

I have a WSProxy button inside a multi action and another outside of it on the same page. I want to send setImage to the button outside of my multi action button when pressing the multi action button. Any possible way to do this using node-red?

@kenwarner
Copy link

did you ever figure this out @JackMoran1? I'm interested in a similar scenario.

@ybizeul
Copy link
Owner

ybizeul commented Aug 24, 2024

Or, soI was able to make it work.

In any case, you'll probably need the special nodes sd-input and sd-output from node-red-contrib-streamdeck-ws node-red plugin : https://github.com/ybizeul/StreamDeckWS/tree/main/Sources/node-red-contrib-streamdeck-ws

What it fixes for you is it caches the StreamDeck keys with their associated contexts.

A StreamDeck context is basically a reference generated by StreamDeck so it knows what device and key we're talking to

That way you're not limited to the context you know (sent by the current event) and you can use sd-output so send an event to any key, as long as node-red knows about it (i.e. it sent at least one event in the past, either while starting, or because the key has been pushed at some point).

I insist, because this is important : if you try to update your "outside" key but your StreamDeck initialized before node-red started or you never pushed that key, the node-red environment won't know how to address it.

So I recommend that during your test, you just push that key so node-red learns its context.

My test is, the function below :

const d = new Date()
msg = {"title": d.getSeconds().toString()}
return msg;

Sending to a sd-output node configured as :
image

Let me know if you need further info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants