estbeetoo / node-red-contrib-kodi

Node-RED plugin (node) to communicate with Kodi/XBMC
Other
3 stars 4 forks source link

Fail on kodi-out #2

Closed vang1804 closed 5 years ago

vang1804 commented 7 years ago

Hi,

When I am trying to send a command on kodi, I have the following error...

11 Sep 21:55:35 - [error] [kodi-out:Test] error calling send: TypeError: Cannot read property 'apply' of undefined 11 Sep 21:55:35 - [error] [kodi-out:Test] send error: TypeError: Cannot read property 'apply' of undefined

Any suggestion?

aborovsky commented 7 years ago

Hi, Vangelis! I'all check check it in few days.

Please, tell me about versions you use (NodeJS, Node-RED). Вс, 11 сент. 2016 г. в 14:59, Vangelis notifications@github.com:

Hi,

When I am trying to send a command on kodi, I have the following error...

11 Sep 21:55:35 - [error] [kodi-out:Test] error calling send: TypeError: Cannot read property 'apply' of undefined 11 Sep 21:55:35 - [error] [kodi-out:Test] send error: TypeError: Cannot read property 'apply' of undefined

Any suggestion?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/estbeetoo/node-red-contrib-kodi/issues/2, or mute the thread https://github.com/notifications/unsubscribe-auth/ABl5LGyZH4n_4m-J-NxZ8nnMuhqBiQDjks5qpE93gaJpZM4J6E2c .

[image: BeeToo] http://beetoo.me/ Когда умный дом по-настоящему умный Александр Боровский, Технический директор Alexander Borovsky, CTO, Co-Founder +7-926-0-945-00 <+7926094500> +7-499-391-33-62 <+74993913362>aborovsky@beetoo.me http://beetoo.me

vang1804 commented 7 years ago

Hi,

You question about the version, made me think. So, I upgrade both node.js and node-red, but I have the same error.. Version are bellow.. 13 Sep 15:40:47 - [info] Node-RED version: v0.14.6 13 Sep 15:40:47 - [info] Node.js version: v4.5.0 13 Sep 15:40:47 - [info] Linux 4.1.7+ arm LE

And the errors, again...

13 Sep 15:42:51 - [error] [kodi-out:Test] error calling send: TypeError: Cannot read property 'apply' of undefined 13 Sep 15:42:51 - [error] [kodi-out:Test] send error: TypeError: Cannot read property 'apply' of undefined 13 Sep 15:42:55 - [error] [kodi-out:Test] error calling send: TypeError: Cannot read property 'apply' of undefined 13 Sep 15:42:55 - [error] [kodi-out:Test] send error: TypeError: Cannot read property 'apply' of undefined 13 Sep 15:43:19 - [error] [kodi-out:Test] error calling send: TypeError: Cannot read property 'apply' of undefined 13 Sep 15:43:19 - [error] [kodi-out:Test] send error: TypeError: Cannot read property 'apply' of undefined 13 Sep 15:43:19 - [error] [kodi-out:Test] error calling send: TypeError: Cannot read property 'apply' of undefined 13 Sep 15:43:19 - [error] [kodi-out:Test] send error: TypeError: Cannot read property 'apply' of undefined

aborovsky commented 7 years ago

May I ask you to attach JSON of Node-RED's flow? Which is being sending something to koi-out node. Also, what version of Kodi do you use?

вт, 13 сент. 2016 г. в 8:47, Vangelis notifications@github.com:

Hi,

You question about the version, made me think. So, I upgrade both node.js and node-red, but I have the same error.. Version are bellow.. 13 Sep 15:40:47 - [info] Node-RED version: v0.14.6 13 Sep 15:40:47 - [info] Node.js version: v4.5.0 13 Sep 15:40:47 - [info] Linux 4.1.7+ arm LE

And the errors, again...

13 Sep 15:42:51 - [error] [kodi-out:Test] error calling send: TypeError: Cannot read property 'apply' of undefined 13 Sep 15:42:51 - [error] [kodi-out:Test] send error: TypeError: Cannot read property 'apply' of undefined 13 Sep 15:42:55 - [error] [kodi-out:Test] error calling send: TypeError: Cannot read property 'apply' of undefined 13 Sep 15:42:55 - [error] [kodi-out:Test] send error: TypeError: Cannot read property 'apply' of undefined 13 Sep 15:43:19 - [error] [kodi-out:Test] error calling send: TypeError: Cannot read property 'apply' of undefined 13 Sep 15:43:19 - [error] [kodi-out:Test] send error: TypeError: Cannot read property 'apply' of undefined 13 Sep 15:43:19 - [error] [kodi-out:Test] error calling send: TypeError: Cannot read property 'apply' of undefined 13 Sep 15:43:19 - [error] [kodi-out:Test] send error: TypeError: Cannot read property 'apply' of undefined

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/estbeetoo/node-red-contrib-kodi/issues/2#issuecomment-246669953, or mute the thread https://github.com/notifications/unsubscribe-auth/ABl5LAKjgiJwlVXdMm3VyGv_5Qewrs1oks5qpptWgaJpZM4J6E2c .

[image: BeeToo] http://beetoo.me/ Когда умный дом по-настоящему умный Александр Боровский, Технический директор Alexander Borovsky, CTO, Co-Founder +7-926-0-945-00 <+7926094500> +7-499-391-33-62 <+74993913362>aborovsky@beetoo.me http://beetoo.me

vang1804 commented 7 years ago

Hi Alexander,

It is a simple notification. I test it also with TCP connection to kodi and returned ok. Kodi version is 6.0.3 by Openelec.

kodi.payload = { "jsonrpc":"2.0", "method":"GUI.ShowNotification", "params":{ "title":msg.topic, "message":msg.payload, "displaytime":60000 }, "id":1}

return kodi;

aborovsky commented 6 years ago

Thank you fro reporting! чт, 15 сент. 2016 г. в 21:13, Vangelis notifications@github.com:

Hi Alexander,

It is a simple notification. I test it also with TCP connection to kodi and returned ok. Kodi version is 6.0.3 by Openelec.

kodi.payload = { "jsonrpc":"2.0", "method":"GUI.ShowNotification", "params":{ "title":msg.topic, "message":msg.payload, "displaytime":60000 }, "id":1}

return kodi;

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/estbeetoo/node-red-contrib-kodi/issues/2#issuecomment-247406868, or mute the thread https://github.com/notifications/unsubscribe-auth/ABl5LDuxZjbcmNDKpLmaMtDUF8ppUB9Dks5qqYq2gaJpZM4J6E2c .

-- [image: BeeToo] http://beetoo.me/ Когда умный дом по-настоящему умный Александр Боровский, Технический директор Alexander Borovsky, CTO, Co-Founder +7-926-094-50-00 <+7926094500> +7-499-391-33-62 <+74993913362>aborovsky@beetoo.me http://beetoo.ru http://beetoo.me/

joeduck commented 6 years ago

Hi,

i have the same issue. What can i do? Thanks for a answer.

aborovsky commented 5 years ago

Hi, @joeduck! Are you able to help me with current project? I mean, to contribute into the project.

thinkbig1979 commented 5 years ago

Hi @aborovsky,

I tested on my kodi system just now with the following Try removing the parentheses on the keys.

kodi.payload = { "jsonrpc": "2.0", "method": "GUI.ShowNotification", "params": { "title": "message title", "message": "hello world", "displaytime": 60000 }, "id":1 }

So it seems your message formatting is correct. Have you declared your message object? var kodi = {}; are you returning kodi.msg in your function? Are your incoming message topic and payload formatted correctly?

aborovsky commented 5 years ago

@thinkbig1979 @vang1804 Try to format command's payload object in this way (below is my Function node body):

{
    payload: {
        cmd: "GUI.ShowNotification",
        args: {
            title: "message title",
            message: "hello world",
            displaytime: 60000
        }
    }
}

It works as expected.

User parentheses or not depends on whether it JSON or plain JS object. Function node's body is a JS, one may not to use parentheses for field names. Inject node JSON templates force you to set valid JSON, that's why parentheses are required.