Git Product home page Git Product logo

node-red-contrib-simplecast's Introduction

node-red-contrib-simplecast

A simple nodered node to cast to chromecast or googlehome

doc todo...

see example flow for now.

[{"id":"a1a1e96f.e8a11","type":"tab","label":"SimpleCast example","disabled":false,"info":""},{"id":"19edf089.1e4677","type":"debug","z":"a1a1e96f.e8a11","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1090,"y":160,"wires":[]},{"id":"bda77856.dc68c8","type":"inject","z":"a1a1e96f.e8a11","name":"","topic":"","payload":"{\"type\":\"GET_STATUS\"}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":740,"y":540,"wires":[["db2bbcaf.3da8e8"]]},{"id":"dc623df1.bdc278","type":"inject","z":"a1a1e96f.e8a11","name":"media 1","topic":"","payload":"{\"type\":\"MEDIA\",\"media\":{\"url\":\"https://bigs.fr/0.mp3\"}}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":160,"wires":[["db2bbcaf.3da8e8"]]},{"id":"319460c6.2e1598","type":"inject","z":"a1a1e96f.e8a11","name":"TTS","topic":"","payload":"{\"type\":\"TTS\", \"text\": \"this is a test\"}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":120,"wires":[["db2bbcaf.3da8e8"]]},{"id":"494aa455.ae99d4","type":"inject","z":"a1a1e96f.e8a11","name":"","topic":"","payload":"{\"type\":\"PAUSE\"}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":455,"y":220,"wires":[["db2bbcaf.3da8e8"]],"icon":"font-awesome/fa-pause","l":false},{"id":"8895d822.7359e","type":"inject","z":"a1a1e96f.e8a11","name":"","topic":"","payload":"{\"type\":\"STOP\"}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":455,"y":300,"wires":[["db2bbcaf.3da8e8"]],"icon":"font-awesome/fa-stop","l":false},{"id":"6a4bcae0.f5ffcc","type":"inject","z":"a1a1e96f.e8a11","name":"","topic":"","payload":"{\"type\":\"PLAY\"}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":455,"y":340,"wires":[["db2bbcaf.3da8e8"]],"icon":"font-awesome/fa-play","l":false},{"id":"ae08a931.139fa","type":"inject","z":"a1a1e96f.e8a11","name":"","topic":"","payload":"{\"type\":\"CLOSE\"}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":720,"y":460,"wires":[["db2bbcaf.3da8e8"]]},{"id":"b2bf0325.63f318","type":"inject","z":"a1a1e96f.e8a11","name":"","topic":"","payload":"{\"type\":\"STATUS\"}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":455,"y":260,"wires":[["db2bbcaf.3da8e8"]],"icon":"font-awesome/fa-info","l":false},{"id":"cb8d17a0.1858d","type":"inject","z":"a1a1e96f.e8a11","name":"10","topic":"","payload":"{\"type\":\"SEEK_DELTA\",\"time\":10}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":470,"y":140,"wires":[["db2bbcaf.3da8e8"]],"icon":"font-awesome/fa-forward"},{"id":"a64a2eb7.e3d6d","type":"inject","z":"a1a1e96f.e8a11","name":"-10","topic":"","payload":"{\"type\":\"SEEK_DELTA\",\"time\":-10}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":470,"y":180,"wires":[["db2bbcaf.3da8e8"]],"icon":"font-awesome/fa-backward"},{"id":"eca79ad5.767368","type":"inject","z":"a1a1e96f.e8a11","name":"","topic":"","payload":"{\"type\":\"MUTE\"}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":720,"y":420,"wires":[["db2bbcaf.3da8e8"]]},{"id":"d3200f50.5e8ec8","type":"inject","z":"a1a1e96f.e8a11","name":"","topic":"","payload":"{\"type\":\"UNMUTE\"}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":730,"y":500,"wires":[["db2bbcaf.3da8e8"]]},{"id":"37c3af76.52f97","type":"inject","z":"a1a1e96f.e8a11","name":"vol 20%","topic":"","payload":"{\"type\":\"VOLUME\", \"volume\": 20}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":690,"y":600,"wires":[["db2bbcaf.3da8e8"]]},{"id":"4beb1953.65db9","type":"inject","z":"a1a1e96f.e8a11","name":"","topic":"","payload":"{\"type\":\"GET_VOLUME\"}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":750,"y":720,"wires":[["db2bbcaf.3da8e8"]]},{"id":"c2af7bc7.66a26","type":"inject","z":"a1a1e96f.e8a11","name":"inc vol 5%","topic":"","payload":"{\"type\":\"VOL_INC\", \"step\": 5}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":700,"y":640,"wires":[["db2bbcaf.3da8e8"]]},{"id":"cc25a729.448ca","type":"inject","z":"a1a1e96f.e8a11","name":"vol +","topic":"","payload":"{\"type\":\"VOL_INC\"}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":690,"y":760,"wires":[["db2bbcaf.3da8e8"]]},{"id":"6f38a8fe.f075c8","type":"inject","z":"a1a1e96f.e8a11","name":"dec vol 5%","topic":"","payload":"{\"type\":\"VOL_DEC\", \"step\": 5}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":700,"y":680,"wires":[["db2bbcaf.3da8e8"]]},{"id":"effe7366.e9285","type":"inject","z":"a1a1e96f.e8a11","name":"vol -","topic":"","payload":"{\"type\":\"VOL_DEC\"}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":690,"y":800,"wires":[["db2bbcaf.3da8e8"]]},{"id":"64ea58da.19f0a","type":"inject","z":"a1a1e96f.e8a11","name":"radio FIP","topic":"","payload":"{\"type\":\"MEDIA\",\"media\":{\"url\":\"http://direct.fipradio.fr/live/fip-midfi.mp3\"}}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":140,"y":460,"wires":[["db2bbcaf.3da8e8"]]},{"id":"a21066fc.3e951","type":"inject","z":"a1a1e96f.e8a11","name":"france info","topic":"","payload":"{\"type\":\"MEDIA\",\"media\":{\"url\":\"http://direct.franceinfo.fr/live/franceinfo-midfi.mp3\"}}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":140,"y":500,"wires":[["db2bbcaf.3da8e8"]]},{"id":"cc8cf634.a86548","type":"inject","z":"a1a1e96f.e8a11","name":"Kyoto Living FM","topic":"","payload":"{\"type\":\"MEDIA\",\"media\":{\"url\":\"https://musicbird.leanstream.co/JCB104-MP3\"}}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":300,"wires":[["db2bbcaf.3da8e8"]]},{"id":"ac2e9de0.4dc2d8","type":"inject","z":"a1a1e96f.e8a11","name":"Sakura FM","topic":"","payload":"{\"type\":\"MEDIA\",\"media\":{\"url\":\"https://musicbird.leanstream.co/JCB072-MP3\"}}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":140,"y":340,"wires":[["db2bbcaf.3da8e8"]]},{"id":"fd60b9b8.ecb01","type":"inject","z":"a1a1e96f.e8a11","name":"Be happy ! - Umeda FM","topic":"","payload":"{\"type\":\"MEDIA\",\"media\":{\"url\":\"https://musicbird.leanstream.co/JCB068-MP3\"}}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":180,"y":380,"wires":[["db2bbcaf.3da8e8"]]},{"id":"5f9d73e3.2a622c","type":"inject","z":"a1a1e96f.e8a11","name":"FM West Tokyo 84.2 Nishi Tokyo","topic":"","payload":"{\"type\":\"MEDIA\",\"media\":{\"url\":\"https://musicbird.leanstream.co/JCB031-MP3\"}}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":210,"y":420,"wires":[["db2bbcaf.3da8e8"]]},{"id":"46f860ad.3e5518","type":"inject","z":"a1a1e96f.e8a11","name":"media 1","topic":"","payload":"https://bigs.fr/0.mp3","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":200,"wires":[["db2bbcaf.3da8e8"]]},{"id":"f4b194fd.065d5","type":"inject","z":"a1a1e96f.e8a11","name":"","topic":"","payload":"{\"type\":\"QUEUE_UPDATE\", \"jump\": -1 }","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":455,"y":420,"wires":[["db2bbcaf.3da8e8"]],"icon":"font-awesome/fa-fast-backward","l":false},{"id":"84961349.55e858","type":"inject","z":"a1a1e96f.e8a11","name":"","topic":"","payload":"{\"type\":\"QUEUE_UPDATE\", \"jump\":1 }","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":455,"y":380,"wires":[["db2bbcaf.3da8e8"]],"icon":"font-awesome/fa-fast-forward","l":false},{"id":"10ebae24.e2c452","type":"inject","z":"a1a1e96f.e8a11","name":"play list","topic":"","payload":"{\"type\":\"MEDIA\",\"media\":[{\"url\":\"https://bigs.fr/0.mp3\"},{\"url\":\"https://bigs.fr/1.mp3\"},{\"url\":\"https://bigs.fr/2.mp3\"},{\"url\":\"https://bigs.fr/3.mp3\"},{\"url\":\"https://bigs.fr/4.mp3\"},{\"url\":\"https://bigs.fr/5.mp3\"},{\"url\":\"https://bigs.fr/6.mp3\"},{\"url\":\"https://bigs.fr/7.mp3\"},{\"url\":\"https://bigs.fr/8.mp3\"},{\"url\":\"https://bigs.fr/9.mp3\"},{\"url\":\"https://bigs.fr/10.mp3\"}]}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":80,"wires":[["db2bbcaf.3da8e8"]]},{"id":"ea7e6259.39df3","type":"inject","z":"a1a1e96f.e8a11","name":"FRANCEINFO","topic":"","payload":"FRANCEINFO","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":150,"y":600,"wires":[[]]},{"id":"e83f0588.dd172","type":"inject","z":"a1a1e96f.e8a11","name":"","topic":"","payload":"MUTE","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":950,"y":420,"wires":[["db2bbcaf.3da8e8"]]},{"id":"33c81d1e.d6a052","type":"inject","z":"a1a1e96f.e8a11","name":"","topic":"","payload":"NEXT","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":550,"y":380,"wires":[["db2bbcaf.3da8e8"]]},{"id":"7f42397f.63c1f","type":"inject","z":"a1a1e96f.e8a11","name":"","topic":"","payload":"VOL_INC","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":920,"y":760,"wires":[["db2bbcaf.3da8e8"]]},{"id":"bab2eb4b.69bb58","type":"inject","z":"a1a1e96f.e8a11","name":"","topic":"","payload":"VOL_DEC","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":920,"y":800,"wires":[["db2bbcaf.3da8e8"]]},{"id":"fa59ddaf.c038b8","type":"inject","z":"a1a1e96f.e8a11","name":"","topic":"","payload":"PREV","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":550,"y":420,"wires":[["db2bbcaf.3da8e8"]]},{"id":"943ec499.aaa9d8","type":"inject","z":"a1a1e96f.e8a11","name":"","topic":"","payload":"STOP","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":550,"y":300,"wires":[["db2bbcaf.3da8e8"]]},{"id":"90e55a73.ed4dc8","type":"inject","z":"a1a1e96f.e8a11","name":"","topic":"","payload":"PAUSE","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":550,"y":220,"wires":[["db2bbcaf.3da8e8"]]},{"id":"db2bbcaf.3da8e8","type":"simplecast","z":"a1a1e96f.e8a11","name":"","host":"192.168.2.150","x":930,"y":160,"wires":[["19edf089.1e4677"]]}]

example 1

node-red-contrib-simplecast's People

Contributors

bigsfr avatar

Watchers

 avatar  avatar

Forkers

mwoidt

node-red-contrib-simplecast's Issues

Device timeout & Memory Leaks

First thank you for the node. However, I'm getting the following error which are causing node-red to shut done. Restarting node-red clears the problem but after a few hours it start all over again.

30 Jan 09:32:44 - [error] [simplecast:b85c5eb5.d5e71] Error: Device timeout
30 Jan 09:32:44 - [error] [simplecast:db2bbcaf.3da8e8] Error: Device timeout
30 Jan 09:32:44 - [error] [simplecast:c1681ddc.a67a7] Error: Device timeout
30 Jan 09:32:44 - [error] [simplecast:bbcd9264.b6885] Error: Device timeout
30 Jan 09:32:51 - [error] [simplecast:c1681ddc.a67a7] Error: connect ECONNREFUSED 192.168.109.54:8009
30 Jan 09:32:51 - [error] [simplecast:db2bbcaf.3da8e8] Error: connect ECONNREFUSED 192.168.109.54:8009
30 Jan 09:32:51 - [error] [simplecast:b85c5eb5.d5e71] Error: connect ECONNREFUSED 192.168.109.54:8009
30 Jan 09:32:52 - [error] [simplecast:bbcd9264.b6885] Error: connect ECONNREFUSED 192.168.109.54:8009
30 Jan 09:32:56 - [error] [simplecast:b85c5eb5.d5e71] Error: read ECONNRESET
30 Jan 09:32:56 - [error] [simplecast:bbcd9264.b6885] Error: read ECONNRESET
30 Jan 09:32:57 - [error] [simplecast:db2bbcaf.3da8e8] Error: read ECONNRESET
30 Jan 09:32:57 - [error] [simplecast:c1681ddc.a67a7] Error: read ECONNRESET
(node:18) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 message listeners added. Use emitter.setMaxListeners() to increase limit
(node:18) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 message listeners added. Use emitter.setMaxListeners() to increase limit
(node:18) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 message listeners added. Use emitter.setMaxListeners() to increase limit
(node:18) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 message listeners added. Use emitter.setMaxListeners() to increase limit
30 Jan 09:35:24 - [error] [simplecast:bbcd9264.b6885] Error: read ECONNRESET
30 Jan 09:35:24 - [error] [simplecast:bbcd9264.b6885] Error: read ECONNRESET
30 Jan 09:35:24 - [error] [simplecast:bbcd9264.b6885] Error: read ECONNRESET
30 Jan 09:35:24 - [error] [simplecast:bbcd9264.b6885] Error: read ECONNRESET
30 Jan 09:35:24 - [error] [simplecast:bbcd9264.b6885] Error: read ECONNRESET
30 Jan 09:35:24 - [error] [simplecast:bbcd9264.b6885] Error: read ECONNRESET
30 Jan 09:35:24 - [error] [simplecast:bbcd9264.b6885] Error: read ECONNRESET
30 Jan 09:35:24 - [error] [simplecast:bbcd9264.b6885] Error: read ECONNRESET
30 Jan 09:35:24 - [error] [simplecast:bbcd9264.b6885] Error: read ECONNRESET

STATUS stops playback

thank you for your great work and espacially taking the time to make that nice and clear example flow!

I would like to start streaming a default radio station if the chromecast is idle so I use the {"type":"STATUS"} message. I figured out, that on certain applications (Spotify, Bandcamp,...) the node doen't return anything. If I have a internet radio stream running it works as expected...

EDIT: it happens on Chromecast Audios and Chromecast Video Gen.2 devices...

Lost chromecast connections do not restore

node-red-contrib-simplecast v1.0.8
node-red v1.1.3

Every now and than the simplecast node shows "error" (or sometimes "host unreachable") and will not restore the connection until the flow is restarted.

Additional info:
I have two Chromecasts, one Chromecast-ultra with a wired connection, which does not seem to have the problem as long as it stays connected to ethernet. The other one is a normal Chromecast connected by Wi-Fi which regularly shows this issue (Wi-Fi dropouts?).
When the node is showing "error" or "host unreachable" it is still controllable by google home though, so it's not the Chromecast itself.

off topic?: Also noted that when changing the simplecast node ip address it will still generate errors for the old ip address(es) until node-red is completely restarted (restarting just the flow has no effect).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.