Looking to port over the Cast-Web app from ST. Got the 3 pieces installed with the normal minor changes needed.
When running the app, it finds my devices but doesn't populate the dropdown box to select any of them. @rayzurbock has had the same problem in another thread (here).
Hoping to get some brilliant minds to take a look at the code and figure out how to populate the drop down.
All I can offer at this time is to find the code section that's supposed to populate the enum input, add some debug logging to catch the raw data being sent, then figure out why it's not updating the input element.
Specifically look at the data in state.devicesMap and how and if that structure is being created correctly within the parse method.
@mike.maxwell The best I can figure is that the options dropdown doesn't like to take a map straight from the state (maybe due to the deserialization process). Recreating it solves the issue.
Other hubitat patches to make the rest work are in the repo above. I didn't touch the group sync app code though.
Thank you, @jp0550! The drop down list now populates. I can select a speaker and move on to the next screen. Looks like there is now a problem when it's trying to create the device.
cast-web-api [dev:1237](http://192.168.86.77/logs#dev1237)2018-07-14 16:17:32.982:errorgroovy.lang.MissingMethodException: No signature of method: dev1531596300248324077442.addChildDevice() is applicable for argument types: (java.lang.String, java.lang.String, java.lang.String, java.lang.Long, java.util.LinkedHashMap) values: [vervallsweg, cast-web-device, 521219da99bcca58d2dd1e52dc0f5806, ...] on line 146 (updated)
If I go into the cast-web-api driver and look at line 146....this is what I see.
Thanks. This resolved my issue with adding my Google Home devices.
PlayText and Speak functions still did not work for me.
I was getting the following error in Hubitat for the device when I tried these functions: errorgroovy.lang.MissingMethodException: No signature of method: dev15316173436921026341192.textToSpeech() is applicable for argument types: (java.lang.String, java.lang.Boolean) values: [Testing, true] on line 418 (speak)
Line 418 in cast-web-device was the following: return playTrack( textToSpeech(phrase, true).uri, 0, 0, true )
I modified to: return playTrack( textToSpeech(phrase).uri, 0, 0, true )
Since I already have Google Assistant Relay working, I found this a bit more involved then I needed.
If anyone is looking for an alternate choice, I instead downloaded the latest nightly for MacOS VLC Player 3.0.4 which is able to Cast and have the HTTP web interface active at the same time.
NOTE: To get this working, I found it was necessary to first disable the HTTP web interface then quit and restart VLC Player. Once it's running again, set the cast device, and then go into the preferences and re-enable HTTP web interface.
Works great, and I now have both my door chime and a verbal announcement of the door that has been opened.
[Edit} I forgot to include something I did previously, and for some time couldn't get this working again. There's an important step after re-starting VLC Player, selecting the Cast device, and then re-enabling HTTP. You then must then go to the VLC menu, choose "Add Interface" and select "Web". It should then work to play a track from Hubitat.
If I'm listening to a Google Music radio station and an announcement happens...How do I get it to continue playing the radio station after the announcement?
Hi putnamjwp,
thanks for porting this over to Hubitat. Installed the app & drivers from your repo but can't seem to get the dropdown populated with my cast devices.
My cast-web-api node server is working fine - I used it before for cast-web-api on ST
The Hubitat app doesn't even hit the node server - not for Test API connection and neither for Discover Devices
I'm not sure if you received a notification for my first post a few days ago because I initially used the wrong recipient.
I'd be glad if you could give me a hint what might be wrong if Cast web - service manager doesn't list any devices, even though cast-web-api actually found the devices:
I don't have this installed anymore so I'm not sure off the top of my head. The big thing about it not populating before was this code below which should be in the repo now:
For the chromecast fans out there, I finally got some time to poke at our chromecast integration again.
What I have so far is play/pause/stop/set volume, mute/unmute.
The only other possible rev 1 inclusion would be speak (ie TTS), however I have no time to dig into play track, restore/resume types of functionality at this time.
So if I add speak, and you have something already running and you send a speak command, it will not be restored.