Python Plugin: Domoticz-Google-Plugin

Python and python framework

Moderator: leecollings

User avatar
Dnpwwo
Posts: 819
Joined: Sunday 23 March 2014 9:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: Python Plugin: Domoticz-Google-Plugin

Post by Dnpwwo »

I plan on releasing an update over the weekend that will support:
  • Increased logging for notifications to help troubleshooting
  • Support for applications other than default set
I haven't noticed that the text is not being updated, I'll have a look at it

Edit: New version released, major change in the way status updating is handled, notifications cleaned up.
The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw
Ihagens
Posts: 5
Joined: Friday 19 February 2016 19:04
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Domoticz-Google-Plugin

Post by Ihagens »

I got the plugin working. no errors and working great now.
However I do not have a selector switch for the apps and don't know how to command or start a video on my google home hub or Chromecasts. IS there a sample script? for example virtual button starts url: youtube.com/**** ?

spoken notifications work great!
kniazio
Posts: 198
Joined: Thursday 06 October 2016 8:14
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.7243
Contact:

Re: Python Plugin: Domoticz-Google-Plugin

Post by kniazio »

Ihagens wrote: Wednesday 24 April 2019 21:58 spoken notifications work great!
Could you show me how these notifications work because I can not do this
Ihagens
Posts: 5
Joined: Friday 19 February 2016 19:04
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Domoticz-Google-Plugin

Post by Ihagens »

kniazio wrote: Wednesday 24 April 2019 22:06
Ihagens wrote: Wednesday 24 April 2019 21:58 spoken notifications work great!
Could you show me how these notifications work because I can not do this
if the plugin is setup correct you set them just as normal notifications.
Schermafbeelding 2019-04-24 om 22.16.58.png
Schermafbeelding 2019-04-24 om 22.16.58.png (369.45 KiB) Viewed 3186 times
kniazio
Posts: 198
Joined: Thursday 06 October 2016 8:14
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.7243
Contact:

Re: Python Plugin: Domoticz-Google-Plugin

Post by kniazio »

That's what I do, and instead of the command I entered, I hear a short tune
logs

Code: Select all

 2019-04-25 10:27:14.918 Status: User: Admin initiated a switch command (4/Hol/On)
2019-04-25 10:27:14.968 Status: Notification: good morning
2019-04-25 10:27:15.095 (RF_Link) Light/Switch (s1)
2019-04-25 10:27:16.268 (Google Home) [Google Home - Kuchnia Status] Update 9(9):'Default Media Receiver'(Screensaver): 0(0)
2019-04-25 10:27:27.263 (Google Home) [Google Home - Kuchnia Status] Update 9(9):'Screensaver'(Default Media Receiver): 0(0)
2019-04-25 10:27:27.251 Error: (Google Home) Notification sent to 'Kuchnia' timed out 
Last edited by kniazio on Thursday 25 April 2019 10:29, edited 1 time in total.
Ihagens
Posts: 5
Joined: Friday 19 February 2016 19:04
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Domoticz-Google-Plugin

Post by Ihagens »

kniazio wrote: Thursday 25 April 2019 6:33 That's what I do, and instead of the command I entered, I hear a short tune
logs

Code: Select all

 2019-04-25 10:27:14.918 Status: User: Admin initiated a switch command (4/Hol/On)
2019-04-25 10:27:14.968 Status: Notification: good morning
2019-04-25 10:27:15.095 (RF_Link) Light/Switch (s1)
2019-04-25 10:27:16.268 (Google Home) [Google Home - Kuchnia Status] Update 9(9):'Default Media Receiver'(Screensaver): 0(0)
2019-04-25 10:27:27.263 (Google Home) [Google Home - Kuchnia Status] Update 9(9):'Screensaver'(Default Media Receiver): 0(0)
2019-04-25 10:27:27.251 Error: (Google Home) Notification sent to 'Kuchnia' timed out 
Did you try to reinstall the plugin and tts? And what server port did you use for the message service?
Last edited by Ihagens on Friday 26 April 2019 7:15, edited 1 time in total.
kniazio
Posts: 198
Joined: Thursday 06 October 2016 8:14
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.7243
Contact:

Re: Python Plugin: Domoticz-Google-Plugin

Post by kniazio »

Yes
I installed everything again

It's weird.
Notifications reach app Domoticz on the phone :)
On Google Home Mini you can only hear a short tune
Ihagens
Posts: 5
Joined: Friday 19 February 2016 19:04
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Domoticz-Google-Plugin

Post by Ihagens »

kniazio wrote: Friday 26 April 2019 6:50 Yes
I installed everything again

It's weird.
Notifications reach app Domoticz on the phone :)
On Google Home Mini you can only hear a short tune
And what server port did you use for the message service?

Try
Voice message port: 8009
kniazio
Posts: 198
Joined: Thursday 06 October 2016 8:14
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.7243
Contact:

Re: Python Plugin: Domoticz-Google-Plugin

Post by kniazio »

Yes
I have port 8009 set
Attachments
google.jpg
google.jpg (109.78 KiB) Viewed 3130 times
User avatar
Dnpwwo
Posts: 819
Joined: Sunday 23 March 2014 9:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: Python Plugin: Domoticz-Google-Plugin

Post by Dnpwwo »

You need to give us a bit more to go on.

Can you do this:
  • set the plugin debug level to Python
  • restart Domoticz
  • wait until Domoticz has connected to the Google device
  • send a notification
  • post the log lines related to the plugin
The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw
kniazio
Posts: 198
Joined: Thursday 06 October 2016 8:14
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.7243
Contact:

Re: Python Plugin: Domoticz-Google-Plugin

Post by kniazio »

Code: Select all

 2019-04-27 06:10:27.449 (Hol) Updating device from 1:'On-2' to have values 1:'On-1'.
2019-04-27 06:10:27.452 Notification sent (Google_Devices) => Success
2019-04-27 06:10:27.456 (Kuchnia) Update 1:'On-1' (Hol)
2019-04-27 06:10:27.456 (Google Home) onNotification: Hol,good morning,good morning,On,0,,/home/pi/domoticz/www/images/Push48_On.png
2019-04-27 06:10:27.457 (Google Home) handleMessage: 'good morning', to be sent to 'Kuchnia'
2019-04-27 06:10:27.450 Status: Notification: good morning
2019-04-27 06:10:28.833 (Google Home) '/home/pi/domoticz/plugins/Domoticz-Google-Plugin/Messages/787f4ead-461b-cdb6-7662-ec863d510114.mp3' created, 4512 bytes
2019-04-27 06:10:28.904 (Google Home) [Google Home - Kuchnia Status] Update 9(9):'Default Media Receiver'(Screensaver): 0(0)
2019-04-27 06:10:30.003 (Google Home) Waiting for player (timeout in 9.99 seconds)
2019-04-27 06:10:30.504 (Google Home) Waiting for player (timeout in 9.49 seconds)
2019-04-27 06:10:31.004 (Google Home) Waiting for player (timeout in 8.99 seconds)
2019-04-27 06:10:31.505 (Google Home) Waiting for player (timeout in 8.49 seconds)
2019-04-27 06:10:32.006 (Google Home) Waiting for player (timeout in 7.99 seconds)
2019-04-27 06:10:32.506 (Google Home) Waiting for player (timeout in 7.49 seconds)
2019-04-27 06:10:32.957 (Kuchnia) Pushing 'onHeartbeatCallback' on to queue
2019-04-27 06:10:32.965 (Kuchnia) Processing 'onHeartbeatCallback' message
2019-04-27 06:10:32.965 (Kuchnia) Calling message handler 'onHeartbeat'.
2019-04-27 06:10:33.007 (Google Home) Waiting for player (timeout in 6.99 seconds)
2019-04-27 06:10:33.508 (Google Home) Waiting for player (timeout in 6.49 seconds)
2019-04-27 06:10:34.009 (Google Home) Waiting for player (timeout in 5.99 seconds)
2019-04-27 06:10:34.510 (Google Home) Waiting for player (timeout in 5.49 seconds)
2019-04-27 06:10:35.010 (Google Home) Waiting for player (timeout in 4.99 seconds)
2019-04-27 06:10:35.511 (Google Home) Waiting for player (timeout in 4.49 seconds)
2019-04-27 06:10:36.012 (Google Home) Waiting for player (timeout in 3.99 seconds)
2019-04-27 06:10:36.513 (Google Home) Waiting for player (timeout in 3.49 seconds)
2019-04-27 06:10:37.013 (Google Home) Waiting for player (timeout in 2.98 seconds)
2019-04-27 06:10:37.514 (Google Home) Waiting for player (timeout in 2.48 seconds)
2019-04-27 06:10:38.015 (Google Home) Waiting for player (timeout in 1.98 seconds)
2019-04-27 06:10:38.516 (Google Home) Waiting for player (timeout in 1.48 seconds)
2019-04-27 06:10:39.016 (Google Home) Waiting for player (timeout in 0.98 seconds)
2019-04-27 06:10:39.517 (Google Home) Waiting for player (timeout in 0.48 seconds)
2019-04-27 06:10:40.037 (Google Home) [Google Home - Kuchnia Status] Update 9(9):'Screensaver'(Default Media Receiver): 0(0)
2019-04-27 06:10:40.021 Error: (Google Home) Notification sent to 'Kuchnia' timed out 
I will just add that the Broadcast notifications from the phone work
example: "broadcast good morning"
After this command from the telephone, the loud speaks this command
User avatar
Dnpwwo
Posts: 819
Joined: Sunday 23 March 2014 9:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: Python Plugin: Domoticz-Google-Plugin

Post by Dnpwwo »

Okay, so the voice message is being created and the google device is being told to play it but it never comes back to Domoticz to get it.

This is usually caused by the IP address being wrong. Is the address you specified in the hardware page the IP of the computer that Domoticz is running on? It should be, also try setting the port to something random to make sure there isn’t a clash.
The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw
kniazio
Posts: 198
Joined: Thursday 06 October 2016 8:14
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.7243
Contact:

Re: Python Plugin: Domoticz-Google-Plugin

Post by kniazio »

It's a shame to admit but the IP address was written for the google speaker :)
Everything works as it should
Thank you very much.
QSKONE
Posts: 38
Joined: Monday 12 February 2018 12:56
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: Python Plugin: Domoticz-Google-Plugin

Post by QSKONE »

Hi , can you help me? I run latest beta and python 3.5.3 and dont know what is wrong.

Code: Select all

Status: (Google Plugin) Started.
Error: (GoogleDevs) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/Domoticz-Google-Plugin/:/usr/lib/python35.zip:/usr/lib/python3.5:/usr/lib/python3.5/plat-arm-linux-gnueabihf:/usr/lib/python3.5/lib-dynload:/usr/local/lib/python3.5/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.5/dist-packages'.
Error: (Google Plugin) Module Import failed, exception: 'ImportError'
Error: (Google Plugin) Module Import failed: ' Name: requests'
Error: (Google Plugin) Error Line details not available.
User avatar
Dnpwwo
Posts: 819
Joined: Sunday 23 March 2014 9:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: Python Plugin: Domoticz-Google-Plugin

Post by Dnpwwo »

@QSKONE,

Looks like you don't have 'requests' installed. Have you tried 'sudo pip3 install requests'?
The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw
QSKONE
Posts: 38
Joined: Monday 12 February 2018 12:56
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: Python Plugin: Domoticz-Google-Plugin

Post by QSKONE »

Plugin works well. Thank you wery much @Dnpwwo .
Belius
Posts: 2
Joined: Thursday 16 May 2019 15:21
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python Plugin: Domoticz-Google-Plugin

Post by Belius »

Hi! Plugin works great. Installed in a Synology NAS. I'm using it with a Google Home Speaker.
Just one question If I configure a Device to send a notification via Google_Devices when activated my Google Home says the message without problems.

I'm using scripts in the Event System and I'm trying to send notifications to Google Home via LUA Scripts (trigger device) in a custom script that work flawless with Telegram Notifications but Google Home notification doesn't works. I'm using this code:
commandArray['SendNotification'] = 'Subject#Text of the message####Google_Devices'
With Telegram this works fine:
commandArray['SendNotification'] = 'Subject#Text of the message####telegram'
@Dnpwwo What can I do to send notifications to my Google Home via Event System? (LUA or Blocky)
Thanks!
User avatar
Dnpwwo
Posts: 819
Joined: Sunday 23 March 2014 9:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: Python Plugin: Domoticz-Google-Plugin

Post by Dnpwwo »

Do something like:

Code: Select all

commandArray['My Device Name'] = "SendNotification Good morning"
and it will say "Good morning"
The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw
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: Domoticz-Google-Plugin

Post by snellejellep »

i get a lot of these errors, does someone know what this means?

Code: Select all

2019-05-16 17:48:04.969 Error: (Chromecasts) Error on line 413 Error is 'BasePlugin' object has no attribute 'ConnectedChromecasts'
raspberry pi | xiaomi vacuum | yeelight | philips hue | zwave | ubiquiti unifi | harmony | sonoff | zigbee2mqtt | https://www.youtube.com/channel/UC2Zidl ... m1OLuNldfQ
Belius
Posts: 2
Joined: Thursday 16 May 2019 15:21
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python Plugin: Domoticz-Google-Plugin

Post by Belius »

Dnpwwo wrote: Thursday 16 May 2019 16:32 Do something like:

Code: Select all

commandArray['My Device Name'] = "SendNotification Good morning"
and it will say "Good morning"
Thanks for the quick reply. Working now!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest