Is it possible to use node red to press a button inside a 3rd party node… Bare with me as its a weird one.
Im using a 3rd party node to controll the tv. Every time the tv turns off i have to repeat the process to access the controlls. I’ve looked into this extensivly to see if there’s ways to do it through LG forums and githubs for the node, but its not possible.
If you see the two images i have to click into node red, then through two menus to get to connect. If i can automate this button to be pressed everytime the tv turns on, that would be the dream. Has anyone come across anything like this before??
Another kind user has pointed me to the direction of the below, saying
If that node is GitHub - hobbyquaker/node-red-contrib-lgtv: Node-RED Nodes to control LG webOS Smart TVs 📺
When the button is pressed it makes an HTTP request to the endpoint the config creates. You can do this same thing with a http request node.
};
}
Object.keys(node.users).forEach(id => {
node.users[id].status(s);
});
};
}
RED.httpAdmin.get('/lgtv-connect', (req, res) => {
if (!status || status === 'Close') {
lgtv = require('lgtv2')({
url: 'ws://' + req.query.host + ':3000',
saveKey(key, cb) {
token = key;
RED.nodes.addCredentials(req.query.id, {
token: key
});
if (typeof cb === 'function') {
cb();
and
$('#lgtv-connect').button('option', 'disabled', true);
$('#lgtv-spinner').removeClass('hide');
timeout = false;
setTimeout(() => {
timeout = true;
}, 30000);
pollConnection();
});
function pollConnection() {
$.getJSON('lgtv-connect/?id=' + nodeId + '&host=' + $('#node-config-input-host').val(), data => {
$('#lgtv-state').html(data.state);
if (data.token) {
$('#node-config-dialog-ok').button('option', 'disabled', false);
$('#lgtv-spinner').addClass('hide');
$('#node-config-input-token').val(data.token);
} else if (timeout) {
$('#lgtv-state').html('');
$('#lgtv-spinner').addClass('hide');
$('#lgtv-connect').button('option', 'disabled', false);
} else {
Ive had a little bit of experience with http nodes and just simple http links, but not Json. This what im asking possible with the above code? If so can anyone shed a little bit more light on it or maybe point me in the right direction?