Python plugin: Sony Bravia TV
Moderator: leecollings
-
- Posts: 137
- Joined: Thursday 01 January 2015 9:10
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Contact:
Re: Python plugin: Sony Bravia TV
I have the same issue. A restart kills the buienradar plugin.
Verzonden vanaf mijn iPad met Tapatalk
Verzonden vanaf mijn iPad met Tapatalk
- G3rard
- Posts: 669
- Joined: Wednesday 04 March 2015 22:15
- Target OS: -
- Domoticz version: No
- Location: The Netherlands
- Contact:
Re: Python plugin: Sony Bravia TV
Good you have found this. But where you using dzVents with some active scripts? Because on my Pi3 dzVents is not disabled, but also not in use and I don't have errors when restarting Domoticz.
Not using Domoticz anymore
-
- Posts: 137
- Joined: Thursday 01 January 2015 9:10
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Contact:
Re: Python plugin: Sony Bravia TV
I use dzVents scripts and the domoticz-buienradar plugin.
Verzonden vanaf mijn iPad met Tapatalk
Verzonden vanaf mijn iPad met Tapatalk
-
- Posts: 36
- Joined: Wednesday 07 December 2016 19:13
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Python plugin: Sony Bravia TV
I use dzVents 1.1.2 with some scripts but on the embedded version in domoticz 2.2.0 i have no scripts running but if enable it and you use also plugins on restart crash for segmentation fault.
-
- Posts: 612
- Joined: Wednesday 07 August 2013 19:09
- Target OS: -
- Domoticz version:
- Location: UK
- Contact:
Re: Python plugin: Sony Bravia TV
G3rard,
Great plugin and been working great when watching normal TV. I export the volume switch to Homebridge so I can say "Hey Siri, set the Living Room TV to 30% and it does it. Then I'd like to turn the tv on and off using the same switch rather than mute. Don't mind changing the code within the plugin.py as I am probably then only one who would want to do this.
I have changed the code to turn the tv off however the on won't work as it never sends the On command as the TV is off. How do I go about changing that.. So far this is what I have done (Android TV)
Thanks in advance
Great plugin and been working great when watching normal TV. I export the volume switch to Homebridge so I can say "Hey Siri, set the Living Room TV to 30% and it does it. Then I'd like to turn the tv on and off using the same switch rather than mute. Don't mind changing the code within the plugin.py as I am probably then only one who would want to do this.
I have changed the code to turn the tv off however the on won't work as it never sends the On command as the TV is off. How do I go about changing that.. So far this is what I have done (Android TV)
Code: Select all
if Unit == 2: # TV volume
if action == 'Set':
self.tvVolume = str(Level)
_tv.set_volume_level(self.tvVolume)
elif action == "Off":
_tv.turn_off()
UpdateDevice(2, 0, str(self.tvVolume))
elif action == "On":
_tv.turn_on_command()
UpdateDevice(2, 1, str(self.tvVolume))
- G3rard
- Posts: 669
- Joined: Wednesday 04 March 2015 22:15
- Target OS: -
- Domoticz version: No
- Location: The Netherlands
- Contact:
Re: Python plugin: Sony Bravia TV
@simon_rb, the code checks if the TV is off and in that case only respons to unit 1 which is the TV power switch.
So your on command for unit 2 is never found.
If you add the following code after 'if self.powerOn == False:' and before 'else:' in the onCommand function then it should work.
And I would change the code from your post to:
So your on command for unit 2 is never found.
If you add the following code after 'if self.powerOn == False:' and before 'else:' in the onCommand function then it should work.
Code: Select all
if Unit == 2: # Use TV volume for switching on
if action == "On":
_tv.turn_on_command()
self.tvPlaying = "TV starting" # Show that the TV is starting, as booting the TV takes some time
self.SyncDevices()
Code: Select all
if Unit == 2: # TV volume and switching off
if action == 'Set':
self.tvVolume = str(Level)
_tv.set_volume_level(self.tvVolume)
elif action == "Off":
_tv.turn_off()
self.tvPlaying = "Off"
self.SyncDevices()
Not using Domoticz anymore
-
- Posts: 612
- Joined: Wednesday 07 August 2013 19:09
- Target OS: -
- Domoticz version:
- Location: UK
- Contact:
Re: Python plugin: Sony Bravia TV
Thats amazing, thanks!G3rard wrote: ↑Tuesday 15 August 2017 23:57 @simon_rb, the code checks if the TV is off and in that case only respons to unit 1 which is the TV power switch.
So your on command for unit 2 is never found.
If you add the following code after 'if self.powerOn == False:' and before 'else:' in the onCommand function then it should work.And I would change the code from your post to:Code: Select all
if Unit == 2: # Use TV volume for switching on if action == "On": _tv.turn_on_command() self.tvPlaying = "TV starting" # Show that the TV is starting, as booting the TV takes some time self.SyncDevices()
Code: Select all
if Unit == 2: # TV volume and switching off if action == 'Set': self.tvVolume = str(Level) _tv.set_volume_level(self.tvVolume) elif action == "Off": _tv.turn_off() self.tvPlaying = "Off" self.SyncDevices()
I added the code above and I am getting various different errors and plugin won't load. It is 99.9% I am putting them in wrong. Being cheeky could I ask for a plugin.py file with the changes in? If not I shall continue to try and figure out where I have gone wrong!

- G3rard
- Posts: 669
- Joined: Wednesday 04 March 2015 22:15
- Target OS: -
- Domoticz version: No
- Location: The Netherlands
- Contact:
Re: Python plugin: Sony Bravia TV
No problem, will have a look at it.
Your errors are probably caused by using tabs as indents? Or were there other errors in the log?
Your errors are probably caused by using tabs as indents? Or were there other errors in the log?
Not using Domoticz anymore
-
- Posts: 612
- Joined: Wednesday 07 August 2013 19:09
- Target OS: -
- Domoticz version:
- Location: UK
- Contact:
Re: Python plugin: Sony Bravia TV
I have this working now, if anyone wants the amended .py file I'll post it here
Thanks for your help G3rard
Thanks for your help G3rard
-
- Posts: 34
- Joined: Friday 19 August 2016 5:39
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Python plugin: Sony Bravia TV
hi,
has crashing issues on RPi resolved yet?
has crashing issues on RPi resolved yet?
-
- Posts: 612
- Joined: Wednesday 07 August 2013 19:09
- Target OS: -
- Domoticz version:
- Location: UK
- Contact:
Re: Python plugin: Sony Bravia TV
Mine hasn't crashed at all since using it. There was an issue with one of the example .py's in the example folder under plugins (think it's the PIR one). I deleted that anyways and it's been fine and not experienced a single crash. I'm on a raspberry pi 3 which is running Domoticz, an Open VPN, Logitech Media Server, SQL library for all the kodi's around the house, FTP server for IP Camera motion detection in domoticz, homebridge including nest for the thermostat. There are loads more I have the Rapsberry pi doing and not a single crash
- G3rard
- Posts: 669
- Joined: Wednesday 04 March 2015 22:15
- Target OS: -
- Domoticz version: No
- Location: The Netherlands
- Contact:
Re: Python plugin: Sony Bravia TV
It's the file script_device_PIRsmarter.py in the scripts/python folder. That file is causing crashes. So if't is in your folder you can delete it.simon_rb wrote: ↑Saturday 19 August 2017 21:20Mine hasn't crashed at all since using it. There was an issue with one of the example .py's in the example folder under plugins (think it's the PIR one). I deleted that anyways and it's been fine and not experienced a single crash. I'm on a raspberry pi 3 which is running Domoticz, an Open VPN, Logitech Media Server, SQL library for all the kodi's around the house, FTP server for IP Camera motion detection in domoticz, homebridge including nest for the thermostat. There are loads more I have the Rapsberry pi doing and not a single crash![]()
In the latest beta version this file is removed by the system, check this https://github.com/domoticz/domoticz/co ... 3681f73ab3 for more information.
For me also no crashed on my Pi3 after I have removed that file.
Not using Domoticz anymore
- lmet
- Posts: 23
- Joined: Wednesday 19 July 2017 22:35
- Target OS: Raspberry Pi / ODroid
- Domoticz version: v4.9700
- Location: France
- Contact:
Re: Python plugin: Sony Bravia TV
Hi,
For me no crash since removing "script_device_PIRsmarter.py" but many many errors in log :
For me no crash since removing "script_device_PIRsmarter.py" but many many errors in log :
Code: Select all
2017-08-20 19:02:17.231 Error: (Bravia) No data received from TV, probably it has just been turned off (time data '' does not match format '%Y-Success-0T%H:%M:
- G3rard
- Posts: 669
- Joined: Wednesday 04 March 2015 22:15
- Target OS: -
- Domoticz version: No
- Location: The Netherlands
- Contact:
Re: Python plugin: Sony Bravia TV
Can you install the latest version from Github and try that?lmet wrote: ↑Monday 21 August 2017 1:54 Hi,
For me no crash since removing "script_device_PIRsmarter.py" but many many errors in log :Code: Select all
2017-08-20 19:02:17.231 Error: (Bravia) No data received from TV, probably it has just been turned off (time data '' does not match format '%Y-Success-0T%H:%M:
If it still gives errors please set Debug to True and send me the log output so I can have a look.
Not using Domoticz anymore
-
- Posts: 612
- Joined: Wednesday 07 August 2013 19:09
- Target OS: -
- Domoticz version:
- Location: UK
- Contact:
Re: Python plugin: Sony Bravia TV
G3rard, buy yourself a new Sony TV (Android one).You deserve it 

- G3rard
- Posts: 669
- Joined: Wednesday 04 March 2015 22:15
- Target OS: -
- Domoticz version: No
- Location: The Netherlands
- Contact:
Re: Python plugin: Sony Bravia TV
@simon_rb, will tell it to the wife
But I am quite happy with my non-Android TV combined with a nVidia Shield

But I am quite happy with my non-Android TV combined with a nVidia Shield

Not using Domoticz anymore
-
- Posts: 45
- Joined: Thursday 09 February 2017 18:31
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Contact:
Re: Python plugin: Sony Bravia TV
v1.2 works fine with KDL-60W605B
Thanks.
Thanks.
Re: Python plugin: Sony Bravia TV
Could not find Hardware Type "Sony Bravia TV" on last beta V3.8367
- G3rard
- Posts: 669
- Joined: Wednesday 04 March 2015 22:15
- Target OS: -
- Domoticz version: No
- Location: The Netherlands
- Contact:
Re: Python plugin: Sony Bravia TV
The Python plugins are disabled in the latest Domoticz beta versions.
Use the stable version if you want to have Python plugins working.
Use the stable version if you want to have Python plugins working.
Not using Domoticz anymore
Who is online
Users browsing this forum: No registered users and 1 guest