Python Plugin: Domoticz-Google-Plugin

Python and python framework

Moderator: leecollings

tjabas
Posts: 564
Joined: Sunday 11 December 2016 13:51
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Domoticz-Google-Plugin

Post by tjabas »

im also looking for another plugin.
there is another plugin called Chromecast status and control plugin, also this one isnt working very good.

it seems like there isnt very much interest in these plugin, that too bad.
Timmiej93
Posts: 64
Joined: Saturday 26 December 2015 0:37
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Domoticz-Google-Plugin

Post by Timmiej93 »

Having tried both this plugin, and Tsjippy's plugin, but it looks like both haven't been updated in 2 years, and both don't work. Tsjippy's plugin also was an absolute pain, since it kept crashing parts of domoticz, even when trying to remove it. This plugin was much better in that regard, but it never worked, it showed an error saying "discoveryCallback: Chromecast object has no attribute host" three times, which is the number of Chromecasts that are online in my home right now.
twoenter
Posts: 76
Joined: Sunday 17 February 2019 15:01
Target OS: NAS (Synology & others)
Domoticz version: 4.10
Contact:

Re: Python Plugin: Domoticz-Google-Plugin

Post by twoenter »

Plugin is working fine. I can send notifications and can control my chromecasts.

I want to directly stream a radio stream from domoticz to the chromecast. In the read me I saw you can use a trigger <url to mp3> command from scripts. Does anybody have a example how to use this?

Thank you
Check my Domoticz tutorials, ESP8266 and Synology blog at https://www.twoenter.nl/blog
twoenter
Posts: 76
Joined: Sunday 17 February 2019 15:01
Target OS: NAS (Synology & others)
Domoticz version: 4.10
Contact:

Re: Python Plugin: Domoticz-Google-Plugin

Post by twoenter »

twoenter wrote: Monday 07 September 2020 21:24 Plugin is working fine. I can send notifications and can control my chromecasts.

I want to directly stream a radio stream from domoticz to the chromecast. In the read me I saw you can use a trigger <url to mp3> command from scripts. Does anybody have a example how to use this?

Thank you
In the plugin code is the trigger function disabled. So it is never going to work without a update.

I found my solution in castnow. Available at github. From a domoticz device it starts a bash script to start streaming to a specific chromecast.
Check my Domoticz tutorials, ESP8266 and Synology blog at https://www.twoenter.nl/blog
rezzalex
Posts: 49
Joined: Thursday 24 September 2020 14:30
Target OS: NAS (Synology & others)
Domoticz version: Beta
Contact:

Re: Python Plugin: Domoticz-Google-Plugin

Post by rezzalex »

heggink wrote: Wednesday 10 April 2019 21:49 Any idea how to resolve
discoveryCallback: 'Chromecast' object has no attribute 'start'
The plugin starts fine, then shows this error and no devices are created.
heggink, I have the same error . How did you resolve this ?
stephanvdplas
Posts: 73
Joined: Wednesday 13 February 2019 18:09
Target OS: Windows
Domoticz version: 2023.1
Location: Netherlands
Contact:

Re: Python Plugin: Domoticz-Google-Plugin

Post by stephanvdplas »

Alas, since a couple of weeks, the plugin doesn't connect to my ChromeCast anymore. I tried reinstalling the plugin, reinstalling the CC, but no luck.

I can see this in the log:

2020-09-24 15:41:09.196 Status: (CC TV Woonkamer) Started.
2020-09-24 15:41:09.956 Status: (CC TV Woonkamer) Entering work loop.
2020-09-24 15:41:09.956 Status: (CC TV Woonkamer) Initialized version 1.21.9, author 'dnpwwo'

No devices are created.

At restart of Domoticz, I see this in the log:

2020-09-24 15:44:26.256 (CC TV Woonkamer) Debug logging mask set to: PYTHON PLUGIN QUEUE IMAGE DEVICE CONNECTION MESSAGE
2020-09-24 15:44:26.256 (CC TV Woonkamer) 'HardwareID':'21'
2020-09-24 15:44:26.256 (CC TV Woonkamer) 'HomeFolder':'C:\Program Files (x86)\Domoticz\plugins\Domoticz-Google-Plugin\'
2020-09-24 15:44:26.256 (CC TV Woonkamer) 'StartupFolder':'C:\Program Files (x86)\Domoticz\'
2020-09-24 15:44:26.256 (CC TV Woonkamer) 'UserDataFolder':'C:\Program Files (x86)\Domoticz\'
2020-09-24 15:44:26.256 (CC TV Woonkamer) 'Database':'C:\Program Files (x86)\Domoticz\domoticz.db'
2020-09-24 15:44:26.256 (CC TV Woonkamer) 'Language':'en'
2020-09-24 15:44:26.256 (CC TV Woonkamer) 'Version':'1.21.9'
2020-09-24 15:44:26.256 (CC TV Woonkamer) 'Author':'dnpwwo'
2020-09-24 15:44:26.256 (CC TV Woonkamer) 'Name':'CC TV Woonkamer'
2020-09-24 15:44:26.256 (CC TV Woonkamer) 'Port':'0'
2020-09-24 15:44:26.256 (CC TV Woonkamer) 'Key':'GoogleDevs'
2020-09-24 15:44:26.256 (CC TV Woonkamer) 'Mode1':'Woonkamer'
2020-09-24 15:44:26.256 (CC TV Woonkamer) 'Mode2':'{|Video|:|Youtube|,|Audio|:|Spotify|}'
2020-09-24 15:44:26.256 (CC TV Woonkamer) 'Mode3':'50'
2020-09-24 15:44:26.256 (CC TV Woonkamer) 'Mode4':'True'
2020-09-24 15:44:26.256 (CC TV Woonkamer) 'Mode5':'True'
2020-09-24 15:44:26.256 (CC TV Woonkamer) 'Mode6':'-1'
2020-09-24 15:44:26.256 (CC TV Woonkamer) 'DomoticzVersion':'2020.2 (build 12394)'
2020-09-24 15:44:26.256 (CC TV Woonkamer) 'DomoticzHash':'d837b5c4e'
2020-09-24 15:44:26.256 (CC TV Woonkamer) 'DomoticzBuildTime':'2020-09-23 22:32:29'
2020-09-24 15:44:26.256 (CC TV Woonkamer) Device count: 0
2020-09-24 15:44:26.256 (CC TV Woonkamer) PyChromeCast Version: 0.7.6
2020-09-24 15:44:26.256 (CC TV Woonkamer) Pushing 'NotifierDirective' on to queue
2020-09-24 15:44:26.267 (CC TV Woonkamer) handleMessage: Entering notification handler
2020-09-24 15:44:26.267 (CC TV Woonkamer) Processing 'NotifierDirective' message
2020-09-24 15:44:26.272 (CC TV Woonkamer) IP Address is: 192.168.x.y
2020-09-24 15:44:26.272 (CC TV Woonkamer) Notifications will use IP Address: 192.168.x.y:16071 to serve audio media.
2020-09-24 15:44:26.272 (CC TV Woonkamer) Pushing 'ProtocolDirective' on to queue
2020-09-24 15:44:26.272 (CC TV Woonkamer) Pushing 'ListenDirective' on to queue
2020-09-24 15:44:26.312 (CC TV Woonkamer) Notifier Name set to: Google_Devices.
2020-09-24 15:44:26.312 (CC TV Woonkamer) Processing 'ProtocolDirective' message
2020-09-24 15:44:26.312 (CC TV Woonkamer) Protocol set to: 'HTTP'.
2020-09-24 15:44:26.312 (CC TV Woonkamer) Processing 'ListenDirective' message
2020-09-24 15:44:26.312 (CC TV Woonkamer) Transport set to: 'TCP/IP', :16071.
2020-09-24 15:44:26.312 (CC TV Woonkamer) Listen directive received, action initiated successfully.

Any idea how to troubleshoot this?
- Running LMS, Domoticz and Dashticz on a windows 11 laptop.
- LMS (11 players) / Hue (26 lights, 2 switches) / Z-wave (14 devices) / Toon (unrooted) / Chromecast
dennis075
Posts: 11
Joined: Saturday 20 January 2018 12:05
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Domoticz-Google-Plugin

Post by dennis075 »

I had the same thing this afternoon but managed to fix this! Seems there is something wrong in the latest versions of some packages.

- Uninstall zeroconf and reinstall with "pip3 install zeroconf==0.25.1"
- Uninstall pychromecast and reinstall with "pip3 install pychromecast==6.0.0"

After restart of domoticz it should work. Let me know if it isn't!
stephanvdplas
Posts: 73
Joined: Wednesday 13 February 2019 18:09
Target OS: Windows
Domoticz version: 2023.1
Location: Netherlands
Contact:

Re: Python Plugin: Domoticz-Google-Plugin

Post by stephanvdplas »

Thank you Dennis! I reinstalled zeroconf and pychromecast with the versions you suggested and it works again! Great!
- Running LMS, Domoticz and Dashticz on a windows 11 laptop.
- LMS (11 players) / Hue (26 lights, 2 switches) / Z-wave (14 devices) / Toon (unrooted) / Chromecast
rezzalex
Posts: 49
Joined: Thursday 24 September 2020 14:30
Target OS: NAS (Synology & others)
Domoticz version: Beta
Contact:

Re: Python Plugin: Domoticz-Google-Plugin

Post by rezzalex »

DAVIZINHO wrote: Friday 03 July 2020 15:09 Hello,
Someone tested it on a docker container?
im trying but not discover any devices, maybe i make something wrong :-(
Hello @DAVIZINHO , I am in the same case : DZ a docker container, I run it on the "host" network, but anyway, I have an error message and no google Cast is discovered...
frankdep
Posts: 12
Joined: Saturday 14 September 2019 10:14
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Domoticz-Google-Plugin

Post by frankdep »

Hi
A solution for the error "discoveryCallback: 'Chromecast' object has no attribute 'host'/'port'"
If you replace in the plugin.py in the discoveryCallback function the : googleDevice.host, googleDevice.port with fix address like "192.168.0.170", 8009 the discovery and creation of devices is not interrupted. BR Frank
frankdep
Posts: 12
Joined: Saturday 14 September 2019 10:14
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Domoticz-Google-Plugin

Post by frankdep »

Since gtts 2.2.1 the notifications are working correctly (within 2 seconds). (install with : sudo pip3 install gtts==2.2.1)
Script commands when using dzVents :
domoticz.notify(subject, message [,priority][,sound][,extra],"Google_Devices",domoticz.NSS_GOOGLE_DEVICES)
e.g. domoticz.notify("","Hello","","","","Google_Devices",domoticz.NSS_GOOGLE_DEVICES)
or domoticz.sendCommand("SendNotification", "#Hello####Google_Devices",domoticz.NSS_GOOGLE_DEVICES)
cvc90
Posts: 1
Joined: Thursday 19 November 2020 16:05
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python Plugin: Domoticz-Google-Plugin

Post by cvc90 »

I just updated the Python version on my Synology nas to version 3.8.2-0150 and reinstalled pychromecast == 6.0.0 and zeroconf == 0.25.1 but now it doesn't work anymore and it gives me the following error "Group 1 is now: ConnectionStatus (status = 'FAILED .. "any new combination of versions of pychromecast and zeroconf that works? Any solutions?

PS: Forgive my English from Google: :lol:
PS2: @Dnpwwo, Why are there no plugin updates?
tezzlicious
Posts: 39
Joined: Saturday 09 April 2016 13:47
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: Python Plugin: Domoticz-Google-Plugin

Post by tezzlicious »

It's a pity this plugin hasn't been updated for a while. Wish I had the knowledge to do so.
geertvercamer
Posts: 84
Joined: Friday 12 May 2017 20:03
Target OS: -
Domoticz version:
Contact:

Re: Python Plugin: Domoticz-Google-Plugin

Post by geertvercamer »

dennis075 wrote: Thursday 24 September 2020 21:30 I had the same thing this afternoon but managed to fix this! Seems there is something wrong in the latest versions of some packages.

- Uninstall zeroconf and reinstall with "pip3 install zeroconf==0.25.1"
- Uninstall pychromecast and reinstall with "pip3 install pychromecast==6.0.0"

After restart of domoticz it should work. Let me know if it isn't!
Hi,

I used this method on virtual devices, on a test pi but now on the new 'production pi' it doesn't work.

I checked installed version with

Code: Select all

pip list
and it reads pychromecast 6.0.0. and zeroconf 0.25.1
Restarted domoticz service, still no luck.
Any more ideas?
Thanks
Nautilus
Posts: 722
Joined: Friday 02 October 2015 12:12
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Finland
Contact:

Re: Python Plugin: Domoticz-Google-Plugin

Post by Nautilus »

Installed the plugin and it seems to be working pretty good. A couple of questions though. THe plugin icons show the media player remote, but it does not seem to be enabled, at least it don't open for me (same as for LMS, Kodi etc.). Should it be enabled? Looking at the code in https://github.com/domoticz/domoticz/bl ... z.js#L1407 it seems like it is not enabled. If we just add the correct HW type there, what else would be needed to be able to control playback etc?

What is the best way to stream a url to a chromecast device? I can see that "Trigger" command is in the readme but how it should be used? Also, looks like it is diabled in the code: https://github.com/dnpwwo/Domoticz-Goog ... in.py#L641
jelleeelco
Posts: 61
Joined: Wednesday 04 January 2017 15:25
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Domoticz-Google-Plugin

Post by jelleeelco »

Question - before I buy new hardware, will this plugin enable me to send a notification to the various devices in the house (2x google hub, 1x google home and 1x google home mini) whenever a switch is flipped in Domoticz? Thinking about buying the Lidl zigbee doorbell and use it with Zigbee2MQTT to connect to Domoticz, then send use the google's as 'doorbell'.

Has anyone tried something like that?
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: Domoticz-Google-Plugin

Post by mark.sellwood »

Yes working today, a quick & dirty script below.

if (devicechanged['Test'] == 'Off') then
commandArray['Office display Status'] = "SendNotification Test Off Script"
end

'Test' is the name of the switch
'Office display Status' is the name of the Home Hub I sent the message to
"SendNotification Test Off Script" Test Off Script is the bit that gets spoken.
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.
jelleeelco
Posts: 61
Joined: Wednesday 04 January 2017 15:25
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Domoticz-Google-Plugin

Post by jelleeelco »

Thanks!!!!!!
I got this working, but it only worked once correctly. Then it cuts off at 'script'.

If I try to change the text, the Google Home does beep but the text doesn't work and I get the error message :

2021-02-02 13:33:44.187 Error: (GoogleHomeIntegration) Invalid web request received, file '/home/pi/domoticz/plugins/Domoticz-Google-Plugin/Messages/2384f082-5d4d-15f4-93e8-59e67792f099.mp3' does not exist

When I want to see what's in that Messages folder, it tells me 'Permission denied'. I updated the permissions, but nothing is in there.

When I try to send the message to more then one Google Home, it breaks (only one, or none play the message).

Is it possible to change the 'test off script' with a mp3 file?
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: Domoticz-Google-Plugin

Post by mark.sellwood »

No problem, I have seen the same happen but couldn't get to the bottom of it.
The script deletes the mp3 file that why you cant see it, I think what happening is that the script calls GTTS that makes the mp3 file, the script then tells the Google devices to play the file then deletes it before its finished playing.
It would be worth checking that all the components are up to date.

I don't know how to make it play a file, I know it can be done as others have done it.
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.
jelleeelco
Posts: 61
Joined: Wednesday 04 January 2017 15:25
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Domoticz-Google-Plugin

Post by jelleeelco »

I found two more interesting observations:

- The Google Mini ALWAYS works....and plays the text correctly ("there is someone at the door, please open the door").
- The Google Home Hub works off and on... but it never completes the sentence, not even the short one "test off script"
- The Google Home Hub generates quite some error messages, but not all the time
- The Google Mini NEVER generates error messages

And, for both devices...

- My Google Home Mini is called 'Mini Study' but that device doesn't show up. It have to use the device 'Mini Study Playing'
- Same for my Google Home hub... It's called 'Studeerkamer2' but I have to use the device 'Studeerkamer2 Playing' as the device 'Studeerkamer2' doesn't exists. In the log when starting Domoticz, it does show that the devices 'Studeerkamer2' and 'Mini Study' are connected, but thus no devices with those names.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest