Python Plugin: Chromecast Topic is solved

Python and python framework

Moderator: leecollings

Post Reply
Ewaldharmsen
Posts: 130
Joined: Tuesday 07 February 2017 15:00
Target OS: Linux
Domoticz version:
Contact:

Python Plugin: Chromecast

Post by Ewaldharmsen »

I created a plugin to retrieve Chromecasts statuses and control the Chromecasts from Domoticz.
See https://github.com/Tsjippy/ChromecastPlugin/
User avatar
DewGew
Posts: 579
Joined: Thursday 21 April 2016 12:01
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.10618
Location: Sweden
Contact:

Re: Python Plugin: Chromecast

Post by DewGew »

How do I use the message function?
Raspberry Pi 3 | domoticz | Aeon Labs Z-Stick GEN5 | RFlink gateway
NanoPi NEO-air | REGO6XX interface | Machinon theme | Homebridge | Domoticz Google Assistant | ideAlarm
Ewaldharmsen
Posts: 130
Joined: Tuesday 07 February 2017 15:00
Target OS: Linux
Domoticz version:
Contact:

Re: Python Plugin: Chromecast

Post by Ewaldharmsen »

Just add a value to the created variabele and the text will be spoken.
I use it voor voice messages and fill the variable from a lua script
ErikAtSpijk
Posts: 16
Joined: Sunday 11 March 2018 22:03
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10717
Contact:

Re: Python Plugin: Chromecast

Post by ErikAtSpijk »

Great, I've been trying to get pychromecast working for some time now, without succes as I struggled with the depeneces.

I do use the latest stable version of domoticz. Any idea why you need the latest domoticz beta to use this plug in? Do you have plans to allow the latest stable version?
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 »

Some errors in log

2018-11-20 22:18:36.499 Error: (Chromecast status) 'onStart' failed 'ConnectionError'.
2018-11-20 22:18:36.499 Error: (Chromecast status) ----> Line 275 in '/home/pi/domoticz/plugins/ChromecastPlugin/plugin.py', function onStart
2018-11-20 22:18:36.499 Error: (Chromecast status) ----> Line 180 in '/home/pi/domoticz/plugins/ChromecastPlugin/plugin.py', function onStart
2018-11-20 22:18:36.499 Error: (Chromecast status) ----> Line 312 in '/home/pi/domoticz/plugins/ChromecastPlugin/plugin.py', function createDevices
2018-11-20 22:18:36.499 Error: (Chromecast status) ----> Line 75 in '/home/pi/domoticz/plugins/ChromecastPlugin/requests/api.py', function get
2018-11-20 22:18:36.499 Error: (Chromecast status) ----> Line 60 in '/home/pi/domoticz/plugins/ChromecastPlugin/requests/api.py', function request
2018-11-20 22:18:36.499 Error: (Chromecast status) ----> Line 533 in '/home/pi/domoticz/plugins/ChromecastPlugin/requests/sessions.py', function request
2018-11-20 22:18:36.499 Error: (Chromecast status) ----> Line 646 in '/home/pi/domoticz/plugins/ChromecastPlugin/requests/sessions.py', function send
2018-11-20 22:18:36.499 Error: (Chromecast status) ----> Line 516 in '/home/pi/domoticz/plugins/ChromecastPlugin/requests/adapters.py', function send
2018-11-20 22:18:46.049 Error: (Chromecast status) Error on line 210 Error is list index out of range
2018-11-20 22:18:46.049 Error: (Chromecast status) Error on line 210 Error is list index out of range
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 »

great plugin but i have a couple of questions/bugs:
- when i try to edit the hardware settings under hardware in domoticz my domoticz will hang until i give a service restart and then all the changes i made are gone.
- what are the language codes to, in my case, set it to dutch?
- how can i let my chromecast speak the text i put in the variable, that is nowhere to be found in the readme on github unfortunately...
- why does the selector go to other if i stop casting netflix or youtube? i would rather have a option in the selector called off that is selected when nothing is playing
raspberry pi | xiaomi vacuum | yeelight | philips hue | zwave | ubiquiti unifi | harmony | sonoff | zigbee2mqtt | https://www.youtube.com/channel/UC2Zidl ... m1OLuNldfQ
User avatar
EdwinK
Posts: 1820
Joined: Sunday 22 January 2017 21:46
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Python Plugin: Chromecast

Post by EdwinK »

snellejellep wrote: Wednesday 21 November 2018 9:19 great plugin but i have a couple of questions/bugs:
- when i try to edit the hardware settings under hardware in domoticz my domoticz will hang until i give a service restart and then all the changes i made are gone.
Same here. I would like this plugin, but for now it's not working for me.
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
Ewaldharmsen
Posts: 130
Joined: Tuesday 07 February 2017 15:00
Target OS: Linux
Domoticz version:
Contact:

Re: Python Plugin: Chromecast

Post by Ewaldharmsen »

ErikAtSpijk wrote: Tuesday 20 November 2018 21:12 Great, I've been trying to get pychromecast working for some time now, without succes as I struggled with the depeneces.

I do use the latest stable version of domoticz. Any idea why you need the latest domoticz beta to use this plug in? Do you have plans to allow the latest stable version?
No, in the latest stable Domoticz just hangs on this:
(cc) Entering work loop.
2018-11-21 09:37:47.474 Status: (cc) Initialized version 1.0.0, author 'Tsjippy'
2018-11-21 09:37:47.692 Status: Python EventSystem: Initalizing event module.
2018-11-21 09:37:47.693 Status: EventSystem: Started
2018-11-21 09:37:47.693 Status: EventSystem: Queue thread started...
Ewaldharmsen
Posts: 130
Joined: Tuesday 07 February 2017 15:00
Target OS: Linux
Domoticz version:
Contact:

Re: Python Plugin: Chromecast

Post by Ewaldharmsen »

snellejellep wrote: Wednesday 21 November 2018 9:19 great plugin but i have a couple of questions/bugs:
- when i try to edit the hardware settings under hardware in domoticz my domoticz will hang until i give a service restart and then all the changes i made are gone.
- what are the language codes to, in my case, set it to dutch?
- how can i let my chromecast speak the text i put in the variable, that is nowhere to be found in the readme on github unfortunately...
- why does the selector go to other if i stop casting netflix or youtube? i would rather have a option in the selector called off that is selected when nothing is playing
1) Yes this is because I use a listener to achieve the changed status of the Chromecasts, but Domoticz python plugins cannot handle that for now.
In order to change any hardware settings you have to disable the hardware, restart domoticz, change the hardware, then re-enable it.
2) See http://www.lingoes.net/en/translator/langcode.htm In your (and mine) case it is nl-NL
3) Just type in the message in the variable with the Chromecasts name
4) I will look into this.
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 »

Hi, i've this issue:

Code: Select all

 2018-11-21 10:02:59.836 Error: (Chomecast) 'onStart' failed 'ConnectionError'.
2018-11-21 10:02:59.836 Error: (Chomecast) ----> Line 275 in '/home/xxx/domoticz/plugins/ChromecastPlugin/plugin.py', function onStart
2018-11-21 10:02:59.836 Error: (Chomecast) ----> Line 180 in '/home/xxx/domoticz/plugins/ChromecastPlugin/plugin.py', function onStart
2018-11-21 10:02:59.836 Error: (Chomecast) ----> Line 312 in '/home/xxx/domoticz/plugins/ChromecastPlugin/plugin.py', function createDevices
2018-11-21 10:02:59.836 Error: (Chomecast) ----> Line 75 in '/home/xxx/domoticz/plugins/ChromecastPlugin/requests/api.py', function get
2018-11-21 10:02:59.836 Error: (Chomecast) ----> Line 60 in '/home/xxx/domoticz/plugins/ChromecastPlugin/requests/api.py', function request
2018-11-21 10:02:59.836 Error: (Chomecast) ----> Line 533 in '/home/xxx/domoticz/plugins/ChromecastPlugin/requests/sessions.py', function request
2018-11-21 10:02:59.836 Error: (Chomecast) ----> Line 646 in '/home/xxx/domoticz/plugins/ChromecastPlugin/requests/sessions.py', function send
2018-11-21 10:02:59.836 Error: (Chomecast) ----> Line 516 in '/home/xxx/domoticz/plugins/ChromecastPlugin/requests/adapters.py', function send 
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
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 »

EdwinK wrote: Wednesday 21 November 2018 9:33
snellejellep wrote: Wednesday 21 November 2018 9:19 great plugin but i have a couple of questions/bugs:
- when i try to edit the hardware settings under hardware in domoticz my domoticz will hang until i give a service restart and then all the changes i made are gone.
Same here. I would like this plugin, but for now it's not working for me.
same another problem for me
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 released version 1.1.0, with a better readme, and 2 potential warnings:
1) When you do not have accept new hardware enabled
2) When you have a username and password, but you local ip is not in the exclusions list.

In both cases the plugin will not work.
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 »

Ewaldharmsen wrote:I have released version 1.1.0, with a better readme, and 2 potential warnings:
1) When you do not have accept new hardware enabled
2) When you have a username and password, but you local ip is not in the exclusions list.

In both cases the plugin will not work.
I will test when i get home
raspberry pi | xiaomi vacuum | yeelight | philips hue | zwave | ubiquiti unifi | harmony | sonoff | zigbee2mqtt | https://www.youtube.com/channel/UC2Zidl ... m1OLuNldfQ
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 »

tested it and saw the off when nothing is playing implemented but that now gives the problem, at least for me, that the switch is updated to the currently playing app but in the same second turned back to off, that is not how it is supposed to work i think
raspberry pi | xiaomi vacuum | yeelight | philips hue | zwave | ubiquiti unifi | harmony | sonoff | zigbee2mqtt | https://www.youtube.com/channel/UC2Zidl ... m1OLuNldfQ
User avatar
sincze
Posts: 1300
Joined: Monday 02 June 2014 22:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: Netherlands / Breda Area
Contact:

Re: Python Plugin: Chromecast

Post by sincze »

Excellent work.
For now stream/py2chromecast is running stable so I might wait a bit longer before switching completely over in production.
Pass2php
LAN: RFLink, P1, OTGW, MySensors
USB: RFXCom, ZWave, Sonoff 3
MQTT: ZIgbee2MQTT,
ZWAVE: Zwave-JS-UI
WIFI: Mi-light, Tasmota, Xiaomi Shelly
Solar: Omnik, PVOutput
Video: Kodi, Harmony HUB, Chromecast
Sensors: You name it I got 1.
TheCondor
Posts: 78
Joined: Thursday 18 June 2015 10:32
Target OS: Linux
Domoticz version:
Contact:

Re: Python Plugin: Chromecast

Post by TheCondor »

Marvelous! Let the home talk to You is awesome !!! Thanks

Just the garbage remainder Is incredible itself :mrgreen:
User avatar
DewGew
Posts: 579
Joined: Thursday 21 April 2016 12:01
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.10618
Location: Sweden
Contact:

Re: Python Plugin: Chromecast

Post by DewGew »

I suggest when nothing is casting. The text device "title" shows "Not Casting" or similar.
Raspberry Pi 3 | domoticz | Aeon Labs Z-Stick GEN5 | RFlink gateway
NanoPi NEO-air | REGO6XX interface | Machinon theme | Homebridge | Domoticz Google Assistant | ideAlarm
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 »

I think I have done everything right . But non of my Chromecasts is added, neither variables.. what am I missing?

Regards, Hans
Ewaldharmsen
Posts: 130
Joined: Tuesday 07 February 2017 15:00
Target OS: Linux
Domoticz version:
Contact:

Re: Python Plugin: Chromecast

Post by Ewaldharmsen »

Did you use the latest version?

I think it should show a warning in the log, you are sure new devices are accepted?
You have to change that in settings
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,

Yes I am on the latest Beta. 4.10224
and Yes i have "allow new hardware" enabled

Regards, Hans
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests