Page 5 of 11

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

Posted: Monday 08 May 2017 23:45
by vgr2
Sorry is not working, I did the replace and the Hardware update but nothing changed.

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

Posted: Tuesday 09 May 2017 10:48
by vgr2
Now is working with your latest plugin.py

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

Posted: Tuesday 09 May 2017 23:40
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.

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

Posted: Friday 26 May 2017 10:46
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

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

Posted: Friday 26 May 2017 23:44
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.

Re: Python plugin: Sony Bravia TV

Posted: Thursday 01 June 2017 20:19
by vgr2
Hi, how can i fix the Python issue for the Sony TV's? It's not running anymore with latest beta..

Re: Python plugin: Sony Bravia TV

Posted: Friday 02 June 2017 0:22
by G3rard
I will make a new version of the plugin which will work with the latest beta and post it here.

Re: Python plugin: Sony Bravia TV

Posted: Monday 05 June 2017 8:30
by vgr2
Hi, did you found some time to make the change? I use this plugin very often....

Re: Python plugin: Sony Bravia TV

Posted: Monday 05 June 2017 10:31
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.

Re: Python plugin: Sony Bravia TV

Posted: Monday 05 June 2017 11:41
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.

Re: Python plugin: Sony Bravia TV

Posted: Monday 05 June 2017 14:10
by G3rard
@Dnpwwo,
You're right, overlooked that part.
Updated the version in my previous post with the new one.

Re: Python plugin: Sony Bravia TV

Posted: Tuesday 06 June 2017 18:27
by vgr2
Thanks, now I can see Python issue on my beta version. I think I have to wait for the fix...

Re: Python plugin: Sony Bravia TV

Posted: Thursday 08 June 2017 21:48
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...

Re: Python plugin: Sony Bravia TV

Posted: Thursday 08 June 2017 22:38
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.

Re: Python plugin: Sony Bravia TV

Posted: Friday 16 June 2017 11:17
by vgr2
Hi G3rard, any updates on the topic?

Python plugin: Sony Bravia TV

Posted: Saturday 17 June 2017 9:56
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?

Re: Python plugin: Sony Bravia TV

Posted: Thursday 22 June 2017 22:29
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:

Re: Python plugin: Sony Bravia TV

Posted: Wednesday 28 June 2017 23:43
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.

Re: Python plugin: Sony Bravia TV

Posted: Friday 30 June 2017 11:04
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 :)

Re: Python plugin: Sony Bravia TV

Posted: Friday 30 June 2017 21:57
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....