[RELEASE] cast-web v1.2.1 - Chromecast Integration (EDGE Driver discussion begins in post 1668)

Hi there, thanks for publishing your docker image… this is the first time I’ve used docker, could you please tell me the commands to run/build/start the docker container with the IP and Port parameters and using the host network option?

I’ve been trying to figure it out for a few hours now with no joy.

Thanks in advance!

Adam

Format of my command if I use it in Dockerfile:
CMD [“node”,"/cast-web-api/castWebApi.js","–hostname=10.0.1.198", “–port=3003”]
Format of my command if instead of using it in Dockerfile I configure it when creating docker image in QNAP:
node /cast-web-api/castWebApi.js --hostname=10.0.1.198 --port=3003

If I remember correctly latest Dockerfile I published on docker hub does not have the command in it so anyone can use it.

Thanks for getting back to me, unfortunately I am none the wiser… I’m assuming there is a specific command to get the container running first? Please assume you are explaining it to an idiot. Thank you!

I run docker from QNAP container station UI. You might want to google “How to run docker on” with the name of your operating system

Dear, I love this!, and I thinks it’s will be better if the musics in my Synology NAS can be played, instead of the each mp3 URL?

1 Like

That didn’t work for me for some reason on my pi3. I ended up with this:

@reboot sleep 30s; /usr/bin/sudo -u pi -H forever start --minUptime 10000 --spinSleepTime 10000 -c node /home/pi/cast-web-api/castWebApi.js --hostname=192.168.x.x

Apparently I did something that made it require higher permissions.

1 Like

Thanks for this. This whole setup is WORLDS beyond what I was doing previously. Will be watching this closely. I also use webcore a lot.

Also the “Speak text and resume” vs “Speak text and restore” from my understanding

“resume” was supposed to pause currently playing track and restart it.

“restore” was supposed to change volume to new volume and restore to whatever the previous volume was.

However the “Speak track and resume” also has a “volume” option (this is in webcore) does this do both?

So I did some testing with this in webcore this:

set level 10
set variable {orig} to [DEVICE : level]
Speak text “test” and resume (with a volume of 50)
set level to {orig}

Also the “speak text and resume” with a volume setting actually does set the NEW volume and it does not revert back to previous volume.

I went onto my PI3 and watched the log from script to see what was happening in real time withe webcore.

Request to: /setDeviceVolume?address=192.168.x.85:8009&volume=0.1
Request to: /setDeviceVolume?address=192.168.x.85:8009&volume=0.5
Request to: /setMediaPlayback?address=192.168.x.85:8009&mediaType=audio/m…yadayada
Request to: /setDeviceVolume?address=192.168.x.85:8009&volume=0.1

That’s setting the original volume at 10, then changing the volume with the “speak text and resume” at volume 50 then setting back the original volume.

Then realizing the GH isn’t reporting back constantly to ST. It’s on the delay you set in the smartapp for each GH. So lesson learned. As long as things don’t move too fast I can query in webcore for info from the DH. AKA volume. So don’t expect to set the volume and then immediately query the volume in webcore.

Hi, a little new to ST / Home Automation so sorry in advance if this is a dumb question. What do I need to meet the “permanent API on my network” requirement? Is this just a PC with node.js running or perhaps an emulator running ST app on that PC? If you can let me know I would appreciate it. Planning to do this through an always on home PC by the way.

Thank in advance for your help.

1 Like

Yes it’s just a computer that runs a node.js application. Didn’t just want to say ‘need a computer’ because it can be literally anything that runs Linux or any modern os. I installed it on a receiver and in my second home on my router.
Windows installation should also be quite simple.

What do you mean by that? Something like a playlist from your NAS’ music library?

Thanks :slight_smile:

According to your undersranding. That’s exactly it, it’s not properly documented what these functions are supposed to do. Also Samsung doesn’t use them anymore that’s why I guess they don’t even bother fixing them, neither do I. Sometimes all of these methods have a mysterious third value, just a couple of months back I realized the third value is the duration. This is also not documented and somehow leftover.

If independent developers are still around after the great Q1 update, I might try to fix them.

Or if you trigger any action (click a button) in the device handler.

Sad but true for the whole DTH :joy:

The hole API thing is just a workaround for stuff that ST isn’t capable of doing right now. It’s basically just a stupid translator. I don’t feel like upgrading the API to a proper one with like session management, updates, etc. because I’m not sure it’s worth it.

Has anything changed recently? I had everything up and running, but had to delete the SmartApp and devices due to an issue with one of the cast groups. Now, when I run discovery, I get a “refresh” error.

Any ideas? Nothing jumping out at me on the live logs.

Ok great, so I have everything up and running on my Windows system with a small learning curve in programming. Curious if there is any way to install this to an old Android Kitkat 4.4.2 I have laying around. I looked into it and seems like Termux is an easy solution but can’t be run on pre 5.0 android devices. I have found a few linux emulators but they don’t have the packages to install node.js, etc… I am no programmer so this is a bit over my head. Any help is appreciated.

I ended up figuring this out. So I thought I’d post in case anyone else ran into this.

The response from the getDevices call was returning a malformed object (missing some key value pairs) in the JSON. In my case, it was for my Vizio display. Rather than mess around with the with node API, I just took it offline while I did the discovery and it worked.

Maybe this one works on 4.4.2? https://play.google.com/store/apps/details?id=io.tempage.dorynode

@vervallsweg Will these objects cause issues during the healthcheck (I removed the good ones to reduce confusion)?

[
  {
    "deviceName": "ec8248721fb73ccc7903b5bc9edc18b4",
    "deviceAddress": "192.168.150.156",
    "devicePort": 8009
  },
  {
    "deviceAddress": "192.168.150.156",
    "devicePort": 9000
  }
]

My Vizio TV seems to be reporting that for its Chromecast capabilities so when I took it offline temporarily, everything else worked.

I don’t remember on top of my head how the matching is done. I’ll look into it though. Someone opened a pull request to solve the issue your having on the API side. Honestly I just never expected that the OEM implementation could be that off.
I’m close to releasing v0.2, so that should be fixed in the update.

3 Likes

Sweet! Looking forward to the new release! Thanks!

Well what you have created here works. And works better than all the other solutions that send Chromecasts TTS audio. You have created a way for 1 to use true announcements and 2 to utilize the built in grouping function and 3 volume control (especially through webcore)! First thing I implemented was to change the volume on my Google Home’s based on time of day and location of that particular GH. I have one upstairs near my children’s bedroom that now get’s turned completely down at night so there is no fear of an announcement or a random wakeup making noise.

And while something like this is interesting:

What you have here is much more useful/powerful as far as groupings, individual GH assignment and webcore integration. Hell I bought a PI3 just for this project.

4 Likes