Page 6 of 11
Re: Python Plugin: Chromecast
Posted: Monday 31 December 2018 11:42
by pele
Now I don't get any error, but the whole thing just freezes.
I have installed the plugin according to the steps provided on github. I am able to successfully query my google devices using the pychromecast lib directly.
I am logging in to domoticz, add hardware and get the following:
And then nothing, the website does not respond, log file (/tmp/domoticz.txt) is not updated after that - nothing. Chrome is notifying me that website does not respond and whether to wait or close it.
Tried restarting domoticz, but after bootstrapping, the effect is the same. `htop` doesn't show any concerning data like high cpu usage by domoticz or anything like that.
The only way to make domoticz work again is to stop it, remove the folder, then start and remove the hardware from GUI. Otherwise I can't even open the hardware page in domoticz.
After one restart I got `Error: Domoticz(pid:5811, tid:5817('PluginMgr')) received fatal signal 11 (Segmentation fault)` when plugin was loaded, but not sure if this was related.
Please advise.
Domoticz ver 4.10304, Build Hash: 30480b21
Python Version: 3.4.2 (default, Sep 26 2018, 07:50:08) [GCC 4.9.2]
Plugin version: 3.1.4
Re: Python Plugin: Chromecast
Posted: Monday 31 December 2018 23:49
by Ewaldharmsen
EddyG wrote: ↑Monday 31 December 2018 9:43
Same here on plugin version 3.1.4. and Domoticz 4.10302
Solved in 3.1.5 Nasty bug to find, but now it should work.
Re: Python Plugin: Chromecast
Posted: Monday 31 December 2018 23:50
by Ewaldharmsen
pele wrote: ↑Monday 31 December 2018 11:42
Now I don't get any error, but the whole thing just freezes.
I have installed the plugin according to the steps provided on github. I am able to successfully query my google devices using the pychromecast lib directly.
I am logging in to domoticz, add hardware and get the following:
And then nothing, the website does not respond, log file (/tmp/domoticz.txt) is not updated after that - nothing. Chrome is notifying me that website does not respond and whether to wait or close it.
Tried restarting domoticz, but after bootstrapping, the effect is the same. `htop` doesn't show any concerning data like high cpu usage by domoticz or anything like that.
The only way to make domoticz work again is to stop it, remove the folder, then start and remove the hardware from GUI. Otherwise I can't even open the hardware page in domoticz.
After one restart I got `Error: Domoticz(pid:5811, tid:5817('PluginMgr')) received fatal signal 11 (Segmentation fault)` when plugin was loaded, but not sure if this was related.
Please advise.
Domoticz ver 4.10304, Build Hash: 30480b21
Python Version: 3.4.2 (default, Sep 26 2018, 07:50:08) [GCC 4.9.2]
Plugin version: 3.1.4
I use Python 3.5.3, can you update and test again?
Re: Python Plugin: Chromecast
Posted: Tuesday 01 January 2019 9:49
by pele
Ewaldharmsen wrote:I use Python 3.5.3, can you update and test again?
Thanks @Ewaldharmsen, it is working with 3.5.3 - worth putting somewhere in readme
Re: Python Plugin: Chromecast
Posted: Tuesday 01 January 2019 16:47
by sincze
Easy setup. It all works, except for the notifications. I guess this is due to the same reason as mentioned here:
http://www.domoticz.com/forum/viewtopic ... 40#p192275
IOT devices -> chromecasts are on separate VLAN and the main LAN (domoticz) is only able to talk to the VLAN. (one-way)
So the VLAN is not able to request the "playback sample file" to play from the main LAN domoticz machine on the specified port.
So I consider this my problem, as this is not a plugin issue. Great job!
Re: Python Plugin: Chromecast
Posted: Tuesday 01 January 2019 21:34
by gerbenvanasselt
Ewaldharmsen wrote: ↑Tuesday 20 November 2018 20:21
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
Hi there Ewald,
I am not into programming yet

But can you give a (script) example on how to fill the text value for speech?
Have looked throughout the forum, but could't find any examples...
Would be great to learn from you.
Gr.
Gerben
Re: Python Plugin: Chromecast
Posted: Tuesday 01 January 2019 22:09
by mark.sellwood
This is a sample LUA script
Code: Select all
commandArray = {}
--
-- Turn the Front Lights on if the Front Door PIR is activated.
if (devicechanged['Front Door PIR'] == 'On') then
commandArray['Front Lights']='On FOR 4'
commandArray['Variable:Lounge Speaker']='Motion detected outside the front'
end
--
return commandArray
"Front Door PIR" is a motion detector
"Front Lights" are the front outside lights
"Lounge Speaker" is the Google Home Mini in the Lounge
When the motion sensor detects motion the outside lights come on & I get a notification.
I hope this points you in the right direction.
Re: Python Plugin: Chromecast
Posted: Wednesday 02 January 2019 17:37
by gerbenvanasselt
mark.sellwood wrote: ↑Tuesday 01 January 2019 22:09
This is a sample LUA script
Code: Select all
commandArray = {}
--
-- Turn the Front Lights on if the Front Door PIR is activated.
if (devicechanged['Front Door PIR'] == 'On') then
commandArray['Front Lights']='On FOR 4'
commandArray['Variable:Lounge Speaker']='Motion detected outside the front'
end
--
return commandArray
"Front Door PIR" is a motion detector
"Front Lights" are the front outside lights
"Lounge Speaker" is the Google Home Mini in the Lounge
When the motion sensor detects motion the outside lights come on & I get a notification.
I hope this points you in the right direction.
Thanks alot that helped me very much! I wrote the scripts with the domo event module. When i use Lua scripts in domo filesystem i get errorcodes like 32512, 512 etc. With the event module it works. Even when i give the right permissions for the files (0777).
Re: Python Plugin: Chromecast
Posted: Wednesday 02 January 2019 21:40
by mark.sellwood
Below is the contents of my script named script_device_PIR.lua
Code: Select all
commandArray = {}
--
-- Turn the Front Lights on if the Front Door PIR is activated.
if (devicechanged['Front Door PIR'] == 'On') then
commandArray['Front Lights']='On FOR 1'
commandArray['Variable:Lounge display']='Motion detected outside the front'
end
--
return commandArray
This works fine for me.
Re: Python Plugin: Chromecast
Posted: Thursday 03 January 2019 21:42
by mark.sellwood
I've been testing 3,1.5 today and its working fine, thanks @Ewaldharmsen
I did see an error when I asked my Mini to play Magic Radio
Code: Select all
2019-01-03 11:39:59.090 (Chromecast) The app of 'Office speaker' has changed to TuneIn Free
2019-01-03 11:39:59.387 (Chromecast) The title of Office speaker has changed to TuneIn
2019-01-03 11:39:59.417 (Chromecast) Update Office speaker: 0 - 'TuneIn'
2019-01-03 11:39:59.091 Error: (Chromecast) Error on line 107 Error is 'TuneIn Free'
2019-01-03 11:40:20.311 (Chromecast) The playing mode of Office speaker has changed to PLAYING
2019-01-03 11:40:20.346 (Chromecast) Update Office speaker: 10 - '10'
2019-01-03 11:40:20.655 (Chromecast) The title of Office speaker has changed to Magic Radio UK
2019-01-03 11:40:20.685 (Chromecast) Update Office speaker: 0 - 'Magic Radio UK'
2019-01-03 11:40:34.911 (Chromecast) Updated volume to 51
This doesn't affect the operation of the plugin.
On a totally separate note is there any way to make the plugin play an audio file?
I can set a variable to say someone at the front door when they ring the bell but it would be nice if I could play a mp3 file "Ding Dong"
Just a nice to have.
Thanks for a great plugin
Re: Python Plugin: Chromecast
Posted: Saturday 05 January 2019 15:09
by EddyG
Ewaldharmsen wrote: ↑Monday 31 December 2018 23:49
EddyG wrote: ↑Monday 31 December 2018 9:43
Same here on plugin version 3.1.4. and Domoticz 4.10302
Solved in 3.1.5 Nasty bug to find, but now it should work.
Tnx, it looks like it is working now.

Re: Python Plugin: Chromecast
Posted: Saturday 05 January 2019 15:55
by EddyG
When I update the plugin on the Hardware page, for instance the directory for message files.
I get these errors.
Code: Select all
2019-01-05 15:50:43.632 Status: (Cast) Disconnected from Keuken
2019-01-05 15:50:43.630 Error: (Cast) Error on line 103 Error is 'NoneType' object has no attribute 'display_name'
2019-01-05 15:50:43.631 Error: (Cast) Status of 'Woonkamer'' is changed to ConnectionStatus(status='DISCONNECTED', address=NetworkAddress(address='192.168.x.xxx', port=8009))
2019-01-05 15:50:48.872 Status: (Cast) Stopping threads.
2019-01-05 15:50:48.872 Status: (Cast) Stopped.
2019-01-05 15:50:48.873 Status: (Cast) Started.
2019-01-05 15:50:48.590 Error: (Cast) Error on line 103 Error is 'NoneType' object has no attribute 'display_name'
2019-01-05 15:50:48.591 Error: (Cast) Status of 'Keuken'' is changed to ConnectionStatus(status='DISCONNECTED', address=NetworkAddress(address='192.168.x.xxx', port=8009))
Re: Python Plugin: Chromecast
Posted: Sunday 06 January 2019 17:13
by EddyG
Sometimes, when I want to cast text from the variable, I get this error.
Code: Select all
2019-01-06 17:11:37.493 Error: (Cast) Error on line 312 Error is 'NoneType' object has no attribute 'display_name'
Re: Python Plugin: Chromecast
Posted: Tuesday 08 January 2019 11:05
by msvds
pele wrote: ↑Monday 31 December 2018 11:42
Now I don't get any error, but the whole thing just freezes.
I have installed the plugin according to the steps provided on github. I am able to successfully query my google devices using the pychromecast lib directly.
I am logging in to domoticz, add hardware and get the following:
And then nothing, the website does not respond, log file (/tmp/domoticz.txt) is not updated after that - nothing. Chrome is notifying me that website does not respond and whether to wait or close it.
Tried restarting domoticz, but after bootstrapping, the effect is the same. `htop` doesn't show any concerning data like high cpu usage by domoticz or anything like that.
The only way to make domoticz work again is to stop it, remove the folder, then start and remove the hardware from GUI. Otherwise I can't even open the hardware page in domoticz.
After one restart I got `Error: Domoticz(pid:5811, tid:5817('PluginMgr')) received fatal signal 11 (Segmentation fault)` when plugin was loaded, but not sure if this was related.
Please advise.
Domoticz ver 4.10304, Build Hash: 30480b21
Python Version: 3.4.2 (default, Sep 26 2018, 07:50:08) [GCC 4.9.2]
Plugin version: 3.1.4
I have the exact same problem as described above. Only I am already runnning python 3.5.3. My Domoticz ver is 4.10329. Plugin version is 3.1.5.
The error I get is:
Status: (Google) Started.
Domoticz(pid:14948, tid:14966('PluginMgr')) received fatal signal 11 (Segmentation fault)
Any ideas?
Re: Python Plugin: Chromecast
Posted: Tuesday 22 January 2019 9:41
by vodor
I installed per instructions.
I get as far as adding the hardware and it says it added to the devices tab. However at this point my domoticz becomes completely unresponsive to the point where I have to stop the service again and only when I "rm -rf" the plugin from CLI can I start my domoticz again.
I upgraded to latest beta V4.10362 with the same result.
Domoticz logs has nothing in it for the device I just added.
Anybody with a similar issue?
Any idea where I can look?
Re: Python Plugin: Chromecast
Posted: Tuesday 22 January 2019 11:19
by Ewaldharmsen
I am now on version domoticz V4.10362, python3 version 3.5.3, plugin version 3.3.0
here all works well. Is this different from your setup?
Re: Python Plugin: Chromecast
Posted: Tuesday 22 January 2019 12:24
by vodor
Python 3.4.2
Plugin Latest. I assume 3.3.0
I will see if I can bump up my python to 3.5.3 and see if that changes anything.
Thanks
Re: Python Plugin: Chromecast
Posted: Tuesday 22 January 2019 22:59
by PeterFleur
I had the same with the hanging of Domoticz while saving and it was because i changed the "Directory for message files:" and did not know if i needed the trailing backslash. I deleted the hardware and the user variables it created and added the hardware again. Now it looks like it works without hanging.
But i have an error every 15 seconds in my logfile:
Error: Chromecast hardware (19) thread seems to have ended unexpectedly
And i'm not able to send a variable to the speaker. I hear it connects but then nothing happens. Which seems to be related to the hardware error.
Peter
Re: Python Plugin: Chromecast
Posted: Wednesday 23 January 2019 10:16
by Ewaldharmsen
PeterFleur wrote: ↑Tuesday 22 January 2019 22:59
I had the same with the hanging of Domoticz while saving and it was because i changed the "Directory for message files:" and did not know if i needed the trailing backslash. I deleted the hardware and the user variables it created and added the hardware again. Now it looks like it works without hanging.
But i have an error every 15 seconds in my logfile:
Error: Chromecast hardware (19) thread seems to have ended unexpectedly
And i'm not able to send a variable to the speaker. I hear it connects but then nothing happens. Which seems to be related to the hardware error.
Peter
I have at least solved the trailing backslash problem in version 3.3.1.
The other problem I can't reproduce.
I have a test rpi, updated it to the latest version, installed the latest beta of Domoticz.
My plugin runs just fine
Re: Python Plugin: Chromecast
Posted: Wednesday 23 January 2019 10:19
by PeterFleur
It looks like I have the problem with all python plugins I install. Is there a way to debug python script? Cause when I start the script by ssh I do not get any output in the ssh of any failures.
Peter
Sent from my SM-G930F using Tapatalk