Python plugin: Sony Bravia TV

Python and python framework

Moderator: leecollings

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

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

Post by vgr2 »

Sorry is not working, I did the replace and the Hardware update but nothing changed.
vgr2
Posts: 71
Joined: Monday 29 August 2016 12:02
Target OS: -
Domoticz version:
Contact:

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

Post by vgr2 »

Now is working with your latest plugin.py
User avatar
G3rard
Posts: 669
Joined: Wednesday 04 March 2015 22:15
Target OS: -
Domoticz version: No
Location: The Netherlands
Contact:

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

Post by G3rard »

That's good news :)
What TV model do you have? Then I can add it to the list of supported TV's on Github.
Not using Domoticz anymore
assenzuid
Posts: 135
Joined: Friday 13 November 2015 9:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: The Netherlands, Emmen Area
Contact:

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

Post by assenzuid »

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: 669
Joined: Wednesday 04 March 2015 22:15
Target OS: -
Domoticz version: No
Location: The Netherlands
Contact:

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

Post by G3rard »

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.
Not using Domoticz anymore
vgr2
Posts: 71
Joined: Monday 29 August 2016 12:02
Target OS: -
Domoticz version:
Contact:

Re: Python plugin: Sony Bravia TV

Post by vgr2 »

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: 669
Joined: Wednesday 04 March 2015 22:15
Target OS: -
Domoticz version: No
Location: The Netherlands
Contact:

Re: Python plugin: Sony Bravia TV

Post by G3rard »

I will make a new version of the plugin which will work with the latest beta and post it here.
Not using Domoticz anymore
vgr2
Posts: 71
Joined: Monday 29 August 2016 12:02
Target OS: -
Domoticz version:
Contact:

Re: Python plugin: Sony Bravia TV

Post by vgr2 »

Hi, did you found some time to make the change? I use this plugin very often....
User avatar
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

Post by G3rard »

@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 72 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.
Not using Domoticz anymore
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: Sony Bravia TV

Post by Dnpwwo »

@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: 669
Joined: Wednesday 04 March 2015 22:15
Target OS: -
Domoticz version: No
Location: The Netherlands
Contact:

Re: Python plugin: Sony Bravia TV

Post by G3rard »

@Dnpwwo,
You're right, overlooked that part.
Updated the version in my previous post with the new one.
Not using Domoticz anymore
vgr2
Posts: 71
Joined: Monday 29 August 2016 12:02
Target OS: -
Domoticz version:
Contact:

Re: Python plugin: Sony Bravia TV

Post by vgr2 »

Thanks, now I can see Python issue on my beta version. I think I have to wait for the fix...
vgr2
Posts: 71
Joined: Monday 29 August 2016 12:02
Target OS: -
Domoticz version:
Contact:

Re: Python plugin: Sony Bravia TV

Post by vgr2 »

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: 669
Joined: Wednesday 04 March 2015 22:15
Target OS: -
Domoticz version: No
Location: The Netherlands
Contact:

Re: Python plugin: Sony Bravia TV

Post by G3rard »

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.
Not using Domoticz anymore
vgr2
Posts: 71
Joined: Monday 29 August 2016 12:02
Target OS: -
Domoticz version:
Contact:

Re: Python plugin: Sony Bravia TV

Post by vgr2 »

Hi G3rard, any updates on the topic?
User avatar
G3rard
Posts: 669
Joined: Wednesday 04 March 2015 22:15
Target OS: -
Domoticz version: No
Location: The Netherlands
Contact:

Python plugin: Sony Bravia TV

Post by G3rard »

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?
Not using Domoticz anymore
DJBenson
Posts: 20
Joined: Wednesday 19 October 2016 19:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python plugin: Sony Bravia TV

Post by DJBenson »

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: 669
Joined: Wednesday 04 March 2015 22:15
Target OS: -
Domoticz version: No
Location: The Netherlands
Contact:

Re: Python plugin: Sony Bravia TV

Post by G3rard »

@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.
Not using Domoticz anymore
User avatar
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

Post by G3rard »

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 :)
Not using Domoticz anymore
vgr2
Posts: 71
Joined: Monday 29 August 2016 12:02
Target OS: -
Domoticz version:
Contact:

Re: Python plugin: Sony Bravia TV

Post by vgr2 »

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 1 guest