Auto click button on Dashboard-ui

Hi y'all, i hope you can help me.
I have my 'node-red-node-ui-microphone' set on my dashboard and i'd like to "autoclick" it every 5 seconds. How can i click 'Start' and then stop it after 5 seconds (then restart it again)?
I'd like to have a 5 seconds' rec, 5 seconds pause and then restart another registration.
This registration will go in my 'Speech to text' node (IBM Watson)

Cattura

Cattur3253523a

I don't know how to do because Microphone-ui doesn't have input wire. Should i use Javascript or something like that?

At the end: i need a loop but this loop must be on clicking the button every 5 secs (i cant use inject or something like that :frowning: )

Thank you so much! I hope you get my problem or i'll try to explain it better :slight_smile:

Currently there is no way to do that in a flow with that node.

If you need longer recording, there is a beta node that you might be able to use node-red-contrib-sox-utils

This could be done with js

Create a temple node and write js target microphone dom. It has a node-id attribute so you could easily find DOM and emulate its action inside a setInterval function

Maybe, give it a try.

Could you help me with this? Should i take an inject and wire it with template node?
Then i should put something like this setTimeout(document.getElementByID('ui_microphone').click(),5000); ?

There is a way to put an input to a node even if it doesnt have it?
Like Microphone-ui doesn't have input, i would use it just for looping it every 5 seconds.

What part of my first reply did you not understand?

Just write directly in template node (template UI node) with tag

I tried like this:

<script>
    setInterval(function() {
  document.querySelector("button.nr-ui-microphone-button.md-button.md-ink-ripple").click()
}, 5000);
</script>

What i'm doing wrong? i put <button class=nr-ui-microphone-button md-button md-ink-ripple etc.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.