Python plugin: Sony Bravia TV

Python and python framework
Post Reply
vgr2
Posts: 89
Joined: Monday 29 August 2016 12:02
Target OS: -
Domoticz version:
Contact:

Re: Python plugin: Sony Bravia [ready for test]

Post by vgr2 » Monday 08 May 2017 23:45

Sorry is not working, I did the replace and the Hardware update but nothing changed.

vgr2
Posts: 89
Joined: Monday 29 August 2016 12:02
Target OS: -
Domoticz version:
Contact:

Re: Python plugin: Sony Bravia [ready for test]

Post by vgr2 » Tuesday 09 May 2017 10:48

Now is working with your latest plugin.py

User avatar
G3rard
Posts: 826
Joined: Wednesday 04 March 2015 23:15
Target OS: Linux
Domoticz version: V3.8153
Location: The Netherlands
Contact:

Re: Python plugin: Sony Bravia [ready for test]

Post by G3rard » Tuesday 09 May 2017 23:40

That's good news :)
What TV model do you have? Then I can add it to the list of supported TV's on Github.
Ubuntu Server 14.04 | Domoticz v3.8153 | RFXtrx433E | Z-Wave Aeotec Z-Stick S2
Frontpage | Sonos PHP | Dark th3me | Sony Bravia Python plugin | Sonos Python plugin

assenzuid
Posts: 103
Joined: Friday 13 November 2015 10:11
Target OS: Raspberry Pi
Domoticz version: Beta
Location: The Netherlands
Contact:

Re: Python plugin: Sony Bravia [ready for test]

Post by assenzuid » Friday 26 May 2017 10:46

Unfortunately it isn't working on a HX850 serie (2012)

Remote control is supported, but not with an Network pre-shared key.
http://docs.esupport.sony.com/imanual/N ... emote.html

User avatar
G3rard
Posts: 826
Joined: Wednesday 04 March 2015 23:15
Target OS: Linux
Domoticz version: V3.8153
Location: The Netherlands
Contact:

Re: Python plugin: Sony Bravia [ready for test]

Post by G3rard » Friday 26 May 2017 23:44

There are some posts in this topic where the plugin is working with a cookie and not the PSK. Maybe you can have a look at that and try if it works with your TV.
Ubuntu Server 14.04 | Domoticz v3.8153 | RFXtrx433E | Z-Wave Aeotec Z-Stick S2
Frontpage | Sonos PHP | Dark th3me | Sony Bravia Python plugin | Sonos Python plugin

vgr2
Posts: 89
Joined: Monday 29 August 2016 12:02
Target OS: -
Domoticz version:
Contact:

Re: Python plugin: Sony Bravia TV

Post by vgr2 » Thursday 01 June 2017 20:19

Hi, how can i fix the Python issue for the Sony TV's? It's not running anymore with latest beta..

User avatar
G3rard
Posts: 826
Joined: Wednesday 04 March 2015 23:15
Target OS: Linux
Domoticz version: V3.8153
Location: The Netherlands
Contact:

Re: Python plugin: Sony Bravia TV

Post by G3rard » Friday 02 June 2017 0:22

I will make a new version of the plugin which will work with the latest beta and post it here.
Ubuntu Server 14.04 | Domoticz v3.8153 | RFXtrx433E | Z-Wave Aeotec Z-Stick S2
Frontpage | Sonos PHP | Dark th3me | Sony Bravia Python plugin | Sonos Python plugin

vgr2
Posts: 89
Joined: Monday 29 August 2016 12:02
Target OS: -
Domoticz version:
Contact:

Re: Python plugin: Sony Bravia TV

Post by vgr2 » Monday 05 June 2017 8:30

Hi, did you found some time to make the change? I use this plugin very often....

User avatar
G3rard
Posts: 826
Joined: Wednesday 04 March 2015 23:15
Target OS: Linux
Domoticz version: V3.8153
Location: The Netherlands
Contact:

Re: Python plugin: Sony Bravia TV

Post by G3rard » Monday 05 June 2017 10:31

@vgr2, I have not yet installed the latest Domoticz version, but according to the documentation the attached plugin should work.
plugin.zip
(4.57 KiB) Downloaded 29 times
Are you able to use Python plugins with your Domoticz version? I have read some posts that you need to compile Domoticz to enable Python.
Or is this fixed in the latest beta versions?

Let me know if this version works for you.
Last edited by G3rard on Monday 05 June 2017 14:10, edited 1 time in total.
Ubuntu Server 14.04 | Domoticz v3.8153 | RFXtrx433E | Z-Wave Aeotec Z-Stick S2
Frontpage | Sonos PHP | Dark th3me | Sony Bravia Python plugin | Sonos Python plugin

User avatar
Dnpwwo
Posts: 627
Joined: Sunday 23 March 2014 10:00
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: Python plugin: Sony Bravia TV

Post by Dnpwwo » Monday 05 June 2017 11:41

@G3rard,

I think you will need to remove the following lines as well:

Code: Select all

def onConnect(Status, Description):
    _plugin.onConnect(Status, Description)

def onMessage(Data, Status, Extra):
    _plugin.onMessage(Data, Status, Extra)

def onDisconnect():
    _plugin.onDisconnect()
otherwise the Plugin Framework will think those call backs are supported. Your base plugin does not have those functions defined so Python will get upset.
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

User avatar
G3rard
Posts: 826
Joined: Wednesday 04 March 2015 23:15
Target OS: Linux
Domoticz version: V3.8153
Location: The Netherlands
Contact:

Re: Python plugin: Sony Bravia TV

Post by G3rard » Monday 05 June 2017 14:10

@Dnpwwo,
You're right, overlooked that part.
Updated the version in my previous post with the new one.
Ubuntu Server 14.04 | Domoticz v3.8153 | RFXtrx433E | Z-Wave Aeotec Z-Stick S2
Frontpage | Sonos PHP | Dark th3me | Sony Bravia Python plugin | Sonos Python plugin

vgr2
Posts: 89
Joined: Monday 29 August 2016 12:02
Target OS: -
Domoticz version:
Contact:

Re: Python plugin: Sony Bravia TV

Post by vgr2 » Tuesday 06 June 2017 18:27

Thanks, now I can see Python issue on my beta version. I think I have to wait for the fix...

vgr2
Posts: 89
Joined: Monday 29 August 2016 12:02
Target OS: -
Domoticz version:
Contact:

Re: Python plugin: Sony Bravia TV

Post by vgr2 » Thursday 08 June 2017 21:48

Hi can you please check your scripts. With latest beta and the Python fix your script crashed my domoticz. If I disable the Sony Python's it's ok...

User avatar
G3rard
Posts: 826
Joined: Wednesday 04 March 2015 23:15
Target OS: Linux
Domoticz version: V3.8153
Location: The Netherlands
Contact:

Re: Python plugin: Sony Bravia TV

Post by G3rard » Thursday 08 June 2017 22:38

Do you have any other Python plugins which work with your beta?
I saw in another topic that the Kodi plugin also has issues.

Will install the latest beta somewhere in the next days and see if I can fix it.
Ubuntu Server 14.04 | Domoticz v3.8153 | RFXtrx433E | Z-Wave Aeotec Z-Stick S2
Frontpage | Sonos PHP | Dark th3me | Sony Bravia Python plugin | Sonos Python plugin

vgr2
Posts: 89
Joined: Monday 29 August 2016 12:02
Target OS: -
Domoticz version:
Contact:

Re: Python plugin: Sony Bravia TV

Post by vgr2 » Friday 16 June 2017 11:17

Hi G3rard, any updates on the topic?

User avatar
G3rard
Posts: 826
Joined: Wednesday 04 March 2015 23:15
Target OS: Linux
Domoticz version: V3.8153
Location: The Netherlands
Contact:

Python plugin: Sony Bravia TV

Post by G3rard » Saturday 17 June 2017 9:56

Not yet, I am waiting on a Domoticz release which is more stable regarding the Python plugins. I see some issues with other plugins in other posts, but work is in progress to fix this.
Furthermore I am on holidays right now :-)

Did you try if other plugins are working fine with your Domoticz version?
Ubuntu Server 14.04 | Domoticz v3.8153 | RFXtrx433E | Z-Wave Aeotec Z-Stick S2
Frontpage | Sonos PHP | Dark th3me | Sony Bravia Python plugin | Sonos Python plugin

DJBenson
Posts: 12
Joined: Wednesday 19 October 2016 19:26
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python plugin: Sony Bravia TV

Post by DJBenson » Thursday 22 June 2017 22:29

Just dropping by to let you know that with a slight modification (uncommenting one line in bravia.py) the script works flawlessly with my 2015 Android KD-55SD8505 set.

Code: Select all

    def turn_on_command(self):
        """Turn the media player on using command. Only confirmed working on Android, can be used when WOL is not available."""
        if self.get_power_status() != 'active':
            self.send_req_ircc(self.get_command_code('TvPower')) <= Uncomment this line
            self.bravia_req_json("sony/system", self._jdata_build("setPowerStatus", {"status": "true"}))
For completeness (and not entirely necessary I guess) I commented out the WOL code;

Code: Select all

    def turn_on(self):
        """Turn the media player on using WOL."""
        #self._wakeonlan()
        #self.send_req_ircc(self.get_command_code('TvPower'))
Thanks for this plugin - I will make use of it to turn the damn TV off when people are not watching it :lol:

User avatar
G3rard
Posts: 826
Joined: Wednesday 04 March 2015 23:15
Target OS: Linux
Domoticz version: V3.8153
Location: The Netherlands
Contact:

Re: Python plugin: Sony Bravia TV

Post by G3rard » Wednesday 28 June 2017 23:43

@DJBenson, thanks for your post!
I guess you are using 'Android' as PSK? In that case it's indeed not necessary to comment out the WOL code because then the turn_on_command function will be used and not the turn_on function.

I will add your TV model to the supported list on Github.

Edit: updated the bravia.py on Github with your change for the turn_on_command function.
Ubuntu Server 14.04 | Domoticz v3.8153 | RFXtrx433E | Z-Wave Aeotec Z-Stick S2
Frontpage | Sonos PHP | Dark th3me | Sony Bravia Python plugin | Sonos Python plugin

User avatar
G3rard
Posts: 826
Joined: Wednesday 04 March 2015 23:15
Target OS: Linux
Domoticz version: V3.8153
Location: The Netherlands
Contact:

Re: Python plugin: Sony Bravia TV

Post by G3rard » Friday 30 June 2017 11:04

vgr2 wrote:Hi G3rard, any updates on the topic?
I have installed Domoticz v3.8025 and the plugin is working fine.

I have updated the code on Github. The plugin will work with the old and new versions of Domoticz regarding the Python framework.

When you have any issues with the plugin on the latest Domoticz beta versions (with the new Python framework), then disable all other Python plugins and see if there are still issues. The Sony Bravia plugin is running without any problems on my v3.8025 version, which has no other Python plugins enabled.

I have updated the version of the plugin to 1.0.
The only thing I would still like is showing notifications on the TV, but unfortunately that's not possible with the API. So if anyone has an idea how to achieve this :)
Ubuntu Server 14.04 | Domoticz v3.8153 | RFXtrx433E | Z-Wave Aeotec Z-Stick S2
Frontpage | Sonos PHP | Dark th3me | Sony Bravia Python plugin | Sonos Python plugin

vgr2
Posts: 89
Joined: Monday 29 August 2016 12:02
Target OS: -
Domoticz version:
Contact:

Re: Python plugin: Sony Bravia TV

Post by vgr2 » Friday 30 June 2017 21:57

Sorry is not working on my side. I did the update and domoticz stops working after unascertained time. But my latest version is V3.8015. Could not get V3.8025. I have no problems with other plugins.., only when I enable the Sony plugin....

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests