Python Plugin: Chromecast Topic is solved

Python and python framework

Moderator: leecollings

DutchHans
Posts: 229
Joined: Friday 03 April 2015 20:44
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Germany (near dutch border)
Contact:

Re: Python Plugin: Chromecast

Post by DutchHans »

Got it working... This is just brilliant!
5 Google Homes... fantastic...

One question...
Is it also possible to determine which Chromecast is active?.. i mean.. if I ask in the livingroom if the dishwasher is ready...that the Chromecast from the livingroom answers.. and when I ask the same question in the bedroom..that the Chromecast in the bedroom answers

Hans
snellejellep
Posts: 241
Joined: Tuesday 16 May 2017 13:05
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: The Neterlands
Contact:

Re: Python Plugin: Chromecast

Post by snellejellep »

It is working now but i forgot one of the dependencies that came with the update.

Note: it now does not turn to other when i stop playing but it stays on the app it was playing, is that intended behaviour or somthing you are figuring out because i would like my stuff to turn on when i start casting amd turn off when i stop but right now i do not get the off report.
raspberry pi | xiaomi vacuum | yeelight | philips hue | zwave | ubiquiti unifi | harmony | sonoff | zigbee2mqtt | https://www.youtube.com/channel/UC2Zidl ... m1OLuNldfQ
assenzuid
Posts: 135
Joined: Friday 13 November 2015 9:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: The Netherlands, Emmen Area
Contact:

Re: Python Plugin: Chromecast

Post by assenzuid »

Updated to the latest plugin.py.

Now i get this error message

Code: Select all

(Chromecast status) You have set a password, but have not excluded your local ip. Please do so, then restart domoticz
I have filled my local network under Local Networks in Domoticz setting page.
dextm80
Posts: 117
Joined: Tuesday 24 October 2017 18:32
Target OS: Linux
Domoticz version: 4.10159
Contact:

Re: Python Plugin: Chromecast

Post by dextm80 »

Code: Select all

2018-11-22 21:49:09.116 Error: (Chomecast) Error on line 233 Error is list index out of range 
????
Domoticz on AsRock j3455-ITX 8gb ram - Aeotec ZWave Usb Stick - RFLink 433Mhz
1x Fibaro Wall Plug
1x Fibaro Motion Sensor
x NeoCoolcam Wall Plug
Netatmo Weather Station - Netatmo Thermostat
Philips Hue Bridge
Ewaldharmsen
Posts: 130
Joined: Tuesday 07 February 2017 15:00
Target OS: Linux
Domoticz version:
Contact:

Re: Python Plugin: Chromecast

Post by Ewaldharmsen »

I have just published version 1.1.5. Please check again
toutazimuth
Posts: 16
Joined: Tuesday 29 September 2015 19:20
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python Plugin: Chromecast

Post by toutazimuth »

Ewaldharmsen wrote: Friday 23 November 2018 8:29 I have just published version 1.1.5. Please check again
Rasberry Pi
Domoticz beta V4.10224

Ewaldharmsen, thank you for the work done
Network error for me.
Should I change network addresses and port in the plugin (my Domoticz adress is not 127.0.0.1) ?

Code: Select all

2018-11-23 11:17:06.298 Error: (chrome) Error on line 355 Error is HTTPConnectionPool(host='127.0.0.1', port=8080): Max retries exceeded with url: /json.htm?type=command&param=saveuservariable&vname=TVcuisine&vtype=2&vvalue= (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x672c3bf0>: Failed to establish a new connection: [Errno 111] Connection refused',))
2018-11-23 11:17:06.298 Error: (chrome) 'onStart' failed 'UnboundLocalError':'local variable 'result' referenced before assignment'.
2018-11-23 11:17:06.298 Error: (chrome) ----> Line 317 in '/home/pi/domoticz/plugins/ChromecastPlugin/plugin.py', function onStart
2018-11-23 11:17:06.298 Error: (chrome) ----> Line 210 in '/home/pi/domoticz/plugins/ChromecastPlugin/plugin.py', function onStart
2018-11-23 11:17:06.298 Error: (chrome) ----> Line 359 in '/home/pi/domoticz/plugins/ChromecastPlugin/plugin.py', function createDevices
2018-11-23 11:17:15.815 Error: (chrome) Error on line 244 Error is list index out of range
Ewaldharmsen
Posts: 130
Joined: Tuesday 07 February 2017 15:00
Target OS: Linux
Domoticz version:
Contact:

Re: Python Plugin: Chromecast

Post by Ewaldharmsen »

toutazimuth wrote: Friday 23 November 2018 11:22
Ewaldharmsen wrote: Friday 23 November 2018 8:29 I have just published version 1.1.5. Please check again
Rasberry Pi
Domoticz beta V4.10224

Ewaldharmsen, thank you for the work done
Network error for me.
Should I change network addresses and port in the plugin (my Domoticz adress is not 127.0.0.1) ?

Code: Select all

2018-11-23 11:17:06.298 Error: (chrome) Error on line 355 Error is HTTPConnectionPool(host='127.0.0.1', port=8080): Max retries exceeded with url: /json.htm?type=command&param=saveuservariable&vname=TVcuisine&vtype=2&vvalue= (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x672c3bf0>: Failed to establish a new connection: [Errno 111] Connection refused',))
2018-11-23 11:17:06.298 Error: (chrome) 'onStart' failed 'UnboundLocalError':'local variable 'result' referenced before assignment'.
2018-11-23 11:17:06.298 Error: (chrome) ----> Line 317 in '/home/pi/domoticz/plugins/ChromecastPlugin/plugin.py', function onStart
2018-11-23 11:17:06.298 Error: (chrome) ----> Line 210 in '/home/pi/domoticz/plugins/ChromecastPlugin/plugin.py', function onStart
2018-11-23 11:17:06.298 Error: (chrome) ----> Line 359 in '/home/pi/domoticz/plugins/ChromecastPlugin/plugin.py', function createDevices
2018-11-23 11:17:15.815 Error: (chrome) Error on line 244 Error is list index out of range


Wow I didn't even know that was possible, but fixed in version 1.1.6
Last edited by Ewaldharmsen on Friday 23 November 2018 13:42, edited 1 time in total.
DutchHans
Posts: 229
Joined: Friday 03 April 2015 20:44
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Germany (near dutch border)
Contact:

Re: Python Plugin: Chromecast

Post by DutchHans »

What do you mean?...
Ewaldharmsen wrote: Friday 23 November 2018 12:06 Wow I didn't even know that was possible, but fixed in version 1.1.6
DutchHans
Posts: 229
Joined: Friday 03 April 2015 20:44
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Germany (near dutch border)
Contact:

Re: Python Plugin: Chromecast

Post by DutchHans »

Hi Ewald,

Just installed the latest version 1.16 and from all Google Minis(5) I got the same Error:

2018-11-23 19:12:43.241 Error: (CC) Error on line 244 Error is list index out of range
2018-11-23 19:12:43.241 Error: (CC) Error on line 244 Error is list index out of range
2018-11-23 19:12:43.241 Error: (CC) Error on line 244 Error is list index out of range
2018-11-23 19:12:43.241 Error: (CC) Error on line 244 Error is list index out of range
2018-11-23 19:12:43.241 Error: (CC) Error on line 244 Error is list index out of range

every 10 seconds.

And.. its not speaking the variable string anymore....

any Ideas?

Regards, Hans
dextm80
Posts: 117
Joined: Tuesday 24 October 2017 18:32
Target OS: Linux
Domoticz version: 4.10159
Contact:

Re: Python Plugin: Chromecast

Post by dextm80 »

DutchHans wrote: Friday 23 November 2018 19:15 Hi Ewald,

Just installed the latest version 1.16 and from all Google Minis(5) I got the same Error:

2018-11-23 19:12:43.241 Error: (CC) Error on line 244 Error is list index out of range
2018-11-23 19:12:43.241 Error: (CC) Error on line 244 Error is list index out of range
2018-11-23 19:12:43.241 Error: (CC) Error on line 244 Error is list index out of range
2018-11-23 19:12:43.241 Error: (CC) Error on line 244 Error is list index out of range
2018-11-23 19:12:43.241 Error: (CC) Error on line 244 Error is list index out of range

every 10 seconds.

And.. its not speaking the variable string anymore....

any Ideas?

Regards, Hans

Code: Select all

2018-11-23 22:06:07.404 Error: (Chomecast) Error on line 244 Error is list index out of range 
same error here


and before this error:

Code: Select all

 2018-11-24 17:53:10.644 Status: (Chomecast) Connected to Chromecast
2018-11-24 17:53:10.725 Error: (Chomecast) Error on line 355 Error is Expecting value: line 1 column 1 (char 0)
2018-11-24 17:53:10.726 Error: (Chomecast) 'onStart' failed 'UnboundLocalError':'local variable 'result' referenced before assignment'.
2018-11-24 17:53:10.726 Error: (Chomecast) ----> Line 317 in '/home/x/domoticz/plugins/ChromecastPlugin/plugin.py', function onStart
2018-11-24 17:53:10.726 Error: (Chomecast) ----> Line 210 in '/home/x/domoticz/plugins/ChromecastPlugin/plugin.py', function onStart
2018-11-24 17:53:10.726 Error: (Chomecast) ----> Line 359 in '/home/x/domoticz/plugins/ChromecastPlugin/plugin.py', function createDevices 
Domoticz on AsRock j3455-ITX 8gb ram - Aeotec ZWave Usb Stick - RFLink 433Mhz
1x Fibaro Wall Plug
1x Fibaro Motion Sensor
x NeoCoolcam Wall Plug
Netatmo Weather Station - Netatmo Thermostat
Philips Hue Bridge
Ewaldharmsen
Posts: 130
Joined: Tuesday 07 February 2017 15:00
Target OS: Linux
Domoticz version:
Contact:

Re: Python Plugin: Chromecast

Post by Ewaldharmsen »

dextm80 wrote: Friday 23 November 2018 22:07
DutchHans wrote: Friday 23 November 2018 19:15 Hi Ewald,

Just installed the latest version 1.16 and from all Google Minis(5) I got the same Error:

2018-11-23 19:12:43.241 Error: (CC) Error on line 244 Error is list index out of range
2018-11-23 19:12:43.241 Error: (CC) Error on line 244 Error is list index out of range
2018-11-23 19:12:43.241 Error: (CC) Error on line 244 Error is list index out of range
2018-11-23 19:12:43.241 Error: (CC) Error on line 244 Error is list index out of range
2018-11-23 19:12:43.241 Error: (CC) Error on line 244 Error is list index out of range

every 10 seconds.

And.. its not speaking the variable string anymore....

any Ideas?

Regards, Hans

Code: Select all

2018-11-23 22:06:07.404 Error: (Chomecast) Error on line 244 Error is list index out of range 
same error here


and before this error:

Code: Select all

 2018-11-24 17:53:10.644 Status: (Chomecast) Connected to Chromecast
2018-11-24 17:53:10.725 Error: (Chomecast) Error on line 355 Error is Expecting value: line 1 column 1 (char 0)
2018-11-24 17:53:10.726 Error: (Chomecast) 'onStart' failed 'UnboundLocalError':'local variable 'result' referenced before assignment'.
2018-11-24 17:53:10.726 Error: (Chomecast) ----> Line 317 in '/home/x/domoticz/plugins/ChromecastPlugin/plugin.py', function onStart
2018-11-24 17:53:10.726 Error: (Chomecast) ----> Line 210 in '/home/x/domoticz/plugins/ChromecastPlugin/plugin.py', function onStart
2018-11-24 17:53:10.726 Error: (Chomecast) ----> Line 359 in '/home/x/domoticz/plugins/ChromecastPlugin/plugin.py', function createDevices 
Check you hardware, I have added an extra field which nerds to be filled.Somehow the default foes not work on upgrade
dextm80
Posts: 117
Joined: Tuesday 24 October 2017 18:32
Target OS: Linux
Domoticz version: 4.10159
Contact:

Re: Python Plugin: Chromecast

Post by dextm80 »


Check you hardware, I have added an extra field which nerds to be filled.Somehow the default foes not work on upgrade
which fields?

Firefox_Screenshot_2018-11-24T18-00-13.849Z.png
Firefox_Screenshot_2018-11-24T18-00-13.849Z.png (10.28 KiB) Viewed 1973 times
Domoticz on AsRock j3455-ITX 8gb ram - Aeotec ZWave Usb Stick - RFLink 433Mhz
1x Fibaro Wall Plug
1x Fibaro Motion Sensor
x NeoCoolcam Wall Plug
Netatmo Weather Station - Netatmo Thermostat
Philips Hue Bridge
assenzuid
Posts: 135
Joined: Friday 13 November 2015 9:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: The Netherlands, Emmen Area
Contact:

Re: Python Plugin: Chromecast

Post by assenzuid »

Updated to the latest version

Code: Select all

2018-11-24 21:36:44.327 Error: (Chromecast status) Error on line 355 Error is Invalid URL '/json.htm?type=command&param=saveuservariable&vname=Chromecast Video&vtype=2&vvalue=': No schema supplied. Perhaps you meant http:///json.htm?type=command&param=saveuservariable&vname=Chromecast Video&vtype=2&vvalue=?
2018-11-24 21:36:44.327 Error: (Chromecast status) 'onStart' failed 'UnboundLocalError':'local variable 'result' referenced before assignment'.
2018-11-24 21:36:44.327 Error: (Chromecast status) ----> Line 317 in '/home/pi/domoticz/plugins/ChromecastPlugin/plugin.py', function onStart
2018-11-24 21:36:44.327 Error: (Chromecast status) ----> Line 210 in '/home/pi/domoticz/plugins/ChromecastPlugin/plugin.py', function onStart
2018-11-24 21:36:44.327 Error: (Chromecast status) ----> Line 359 in '/home/pi/domoticz/plugins/ChromecastPlugin/plugin.py', function createDevices
mark.sellwood
Posts: 101
Joined: Tuesday 04 March 2014 10:33
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Surrey, UK
Contact:

Re: Python Plugin: Chromecast

Post by mark.sellwood »

A new field has been added "Domoticz url and port:" you need to fill this in. ie http://xxx.xxx.xxx.xxx:8080
3 x Pi, 1 Master, 2 Slaves, 1x Aeotec Z-Stick S2, 4xSP103 PIR, 5xPowerNode 1, 1xSmart Energy Switch Gen5, 4xFGSS101 Smoke Sensor, 2xFGD212, 9xFGS212 , 7xFGS221/2, 1xAD142 , 1xTKB TZ68E , 2xAeotec Multi Sensor, 3 x NodOn CRC-3-1-00.
dextm80
Posts: 117
Joined: Tuesday 24 October 2017 18:32
Target OS: Linux
Domoticz version: 4.10159
Contact:

Re: Python Plugin: Chromecast

Post by dextm80 »

mark.sellwood wrote: Saturday 24 November 2018 23:07 A new field has been added "Domoticz url and port:" you need to fill this in. ie http://xxx.xxx.xxx.xxx:8080
Yes, already did it but errors still remains
Last edited by dextm80 on Sunday 25 November 2018 8:52, edited 1 time in total.
Domoticz on AsRock j3455-ITX 8gb ram - Aeotec ZWave Usb Stick - RFLink 433Mhz
1x Fibaro Wall Plug
1x Fibaro Motion Sensor
x NeoCoolcam Wall Plug
Netatmo Weather Station - Netatmo Thermostat
Philips Hue Bridge
maxtrash
Posts: 106
Joined: Tuesday 06 August 2013 1:31
Target OS: -
Domoticz version:
Contact:

Re: Python Plugin: Chromecast

Post by maxtrash »

nice plugin, happy with it!
One thing I wonder though: can't get the talking to work. After entering the text in the variable I heard the regular ding but no spoken text. The plugin did tell me name of the song being played though it is functioning.
Any idea how I could debug this?
bramski
Posts: 45
Joined: Thursday 20 July 2017 16:26
Target OS: -
Domoticz version:
Contact:

Re: Python Plugin: Chromecast

Post by bramski »

Thanks for the plugin. I was also struggling to get it up and running.

For everyone having the list index errors please try the following.

- Ssh into your domoticz instance
- Execute `curl http://127.0.0.1:8080/json.htm`

When you get a 401 unauthorized, this is your problem. This means your domoticz instance cannot access the API without a username/password.
You can set this up in "Setup" -> "Local networks". Make sure you add 127.0.0.* there.
Try again using the the curl command. If you get a JSON response you can re-enable the chromecast plugin and it should start creating devices.
dextm80
Posts: 117
Joined: Tuesday 24 October 2017 18:32
Target OS: Linux
Domoticz version: 4.10159
Contact:

Re: Python Plugin: Chromecast

Post by dextm80 »

bramski wrote: Sunday 25 November 2018 10:09 Thanks for the plugin. I was also struggling to get it up and running.

For everyone having the list index errors please try the following.

- Ssh into your domoticz instance
- Execute `curl http://127.0.0.1:8080/json.htm`

When you get a 401 unauthorized, this is your problem. This means your domoticz instance cannot access the API without a username/password.
You can set this up in "Setup" -> "Local networks". Make sure you add 127.0.0.* there.
Try again using the the curl command. If you get a JSON response you can re-enable the chromecast plugin and it should start creating devices.
for me not resolve problem, thanks
Domoticz on AsRock j3455-ITX 8gb ram - Aeotec ZWave Usb Stick - RFLink 433Mhz
1x Fibaro Wall Plug
1x Fibaro Motion Sensor
x NeoCoolcam Wall Plug
Netatmo Weather Station - Netatmo Thermostat
Philips Hue Bridge
bramski
Posts: 45
Joined: Thursday 20 July 2017 16:26
Target OS: -
Domoticz version:
Contact:

Re: Python Plugin: Chromecast

Post by bramski »

dextm80 wrote: Sunday 25 November 2018 10:32
bramski wrote: Sunday 25 November 2018 10:09 Thanks for the plugin. I was also struggling to get it up and running.

For everyone having the list index errors please try the following.

- Ssh into your domoticz instance
- Execute `curl http://127.0.0.1:8080/json.htm`

When you get a 401 unauthorized, this is your problem. This means your domoticz instance cannot access the API without a username/password.
You can set this up in "Setup" -> "Local networks". Make sure you add 127.0.0.* there.
Try again using the the curl command. If you get a JSON response you can re-enable the chromecast plugin and it should start creating devices.
for me not resolve problem, thanks
What is the output of the curl command?
dextm80
Posts: 117
Joined: Tuesday 24 October 2017 18:32
Target OS: Linux
Domoticz version: 4.10159
Contact:

Re: Python Plugin: Chromecast

Post by dextm80 »

bramski wrote: Sunday 25 November 2018 10:34
dextm80 wrote: Sunday 25 November 2018 10:32
bramski wrote: Sunday 25 November 2018 10:09 Thanks for the plugin. I was also struggling to get it up and running.

For everyone having the list index errors please try the following.

- Ssh into your domoticz instance
- Execute `curl http://127.0.0.1:8080/json.htm`

When you get a 401 unauthorized, this is your problem. This means your domoticz instance cannot access the API without a username/password.
You can set this up in "Setup" -> "Local networks". Make sure you add 127.0.0.* there.
Try again using the the curl command. If you get a JSON response you can re-enable the chromecast plugin and it should start creating devices.
for me not resolve problem, thanks
What is the output of the curl command?

Code: Select all

{
   "status" : "ERR"
}

i use my domoticz ip and port
Domoticz on AsRock j3455-ITX 8gb ram - Aeotec ZWave Usb Stick - RFLink 433Mhz
1x Fibaro Wall Plug
1x Fibaro Motion Sensor
x NeoCoolcam Wall Plug
Netatmo Weather Station - Netatmo Thermostat
Philips Hue Bridge
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests