Python plugin: Sony Bravia TV
Moderator: leecollings
-
- Posts: 8
- Joined: Sunday 23 April 2017 10:07
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Python plugin: Sony Bravia [ready for test]
Wow, it works now ... for all who have problems, the Problem was the opera browser, at the Computer it don't works with a old Version of Firefox, too - now i have used Firefox on Android and it works - nice plugin - thanks
- 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]
That's good to hearSchuko80 wrote:Wow, it works now ... for all who have problems, the Problem was the opera browser, at the Computer it don't works with a old Version of Firefox, too - now i have used Firefox on Android and it works - nice plugin - thanks
Not using Domoticz anymore
- 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]
Can you also share localtest.py? Maybe I can help with the response part.markcame wrote: i have try to use localtest.py but i get response "[]" and i'm not able to read the real response, i think that actually the renew happens because the old cookie loses it's validity.
Not using Domoticz anymore
- 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]
Have done some testing with my KDL-32EX720 and only IRCC commands are supported. So it's not possible to turn the TV on.DarkFoxDK wrote:I've got a Sony Bravia KDL-46EX724, which is a couple of generations older than the ones supported by the plugin, however, it still does support IRCC codes, so I wonder what would be needed for at least partial support?
Also it's not possible to show what is being played.
So the only thing possible is to make a very simple version, where you can use a selector switch or the remote control to do some basic controls (volume, channel, HDMI input etc).
That would mean I have to make a new plugin for this kind of TV's. I can try to find some time to do that, but it has a low priority.
What IRCC functions do you want to control from Domoticz with this plugin?
And maybe we can use some info from this site.
Last edited by G3rard on Tuesday 02 May 2017 0:11, edited 1 time in total.
Not using Domoticz anymore
- 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]
Already did some testing?EBOOZ wrote:This is awesome! I'll test the script this weekend
Not using Domoticz anymore
-
- Posts: 26
- Joined: Saturday 02 January 2016 2:22
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Contact:
Re: Python plugin: Sony Bravia [ready for test]
Unless you really feel like it, I wouldn't bother. I can just as easily use my current script with virtual switches and on/off actions.G3rard wrote:Have done some testing with my KDL-32EX720 and only IRCC commands are supported. So it's not possible to turn the TV on.DarkFoxDK wrote:I've got a Sony Bravia KDL-46EX724, which is a couple of generations older than the ones supported by the plugin, however, it still does support IRCC codes, so I wonder what would be needed for at least partial support?
Also it's not possible to show what is being played.
So the only thing possible is to make a very simple version, where you can use a selector switch or the remote control to do some basic controls (volume, channel, HDMI input etc).
That would mean I have to make a new plugin for this kind of TV's. I can try to find some time to do that, but it has a low priority.
What IRCC functions do you want to control from Domoticz with this plugin?
- 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]
Are you able to switch the TV on with your script (using the wakeonlan part)? Then things are getting more interestingDarkFoxDK wrote:Unless you really feel like it, I wouldn't bother. I can just as easily use my current script with virtual switches and on/off actions.
Not using Domoticz anymore
-
- Posts: 26
- Joined: Saturday 02 January 2016 2:22
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Contact:
Re: Python plugin: Sony Bravia [ready for test]
Sadly not.G3rard wrote:Are you able to switch the TV on with your script (using the wakeonlan part)? Then things are getting more interestingDarkFoxDK wrote:Unless you really feel like it, I wouldn't bother. I can just as easily use my current script with virtual switches and on/off actions.
-
- Posts: 36
- Joined: Wednesday 07 December 2016 19:13
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Python plugin: Sony Bravia [ready for test]
on localtest.py i sinply added :G3rard wrote:Can you also share localtest.py? Maybe I can help with the response part.markcame wrote: i have try to use localtest.py but i get response "[]" and i'm not able to read the real response, i think that actually the renew happens because the old cookie loses it's validity.
Code: Select all
x.connect("0000" , "prova","prova1")
Code: Select all
x.connect("3074" , "prova","prova1")
Code: Select all
pi@raspberrypi:~/domoticz/plugins/sony$ python3 localtest.py
Traceback (most recent call last):
File "localtest.py", line 25, in <module>
x.connect("3074" , "prova","prova1")
File "/home/pi/domoticz/plugins/sony/bravia.py", line 104, in connect
Domoticz.Debug(json.dumps(response.json()))
AttributeError: 'bytes' object has no attribute 'json'
- 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]
@markcame, yeah that is exactly the line I mentioned in an earlier post, which isn't changed and still depending on the requests module, where the other parts of the code are changed to use the urllib module (requests module is not working with the Python plugin).
Can you change
to
and maybe comment out the next line starting with self._cookies because that is also still using the requests module part.
Can you change
Code: Select all
Domoticz.Debug(json.dumps(response.json()))
Code: Select all
Domoticz.Debug(response)
Not using Domoticz anymore
-
- Posts: 36
- Joined: Wednesday 07 December 2016 19:13
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Python plugin: Sony Bravia [ready for test]
changing gime meG3rard wrote:@markcame, yeah that is exactly the line I mentioned in an earlier post, which isn't changed and still depending on the requests module, where the other parts of the code are changed to use the urllib module (requests module is not working with the Python plugin).
Can you changetoCode: Select all
Domoticz.Debug(json.dumps(response.json()))
and maybe comment out the next line starting with self._cookies because that is also still using the requests module part.Code: Select all
Domoticz.Debug(response)
Code: Select all
pi@raspberrypi:~/domoticz/plugins/sony$ python3 localtest.py
b'{"id":1,"result":[]}'
- 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]
Just released a new version on https://github.com/gerard33/sony-bravia.
* Added remote control --> you can now use the remote control in Domoticz (next to the TV icon in the Status device), this can among others be used for volume up and down (will also work when you have an amplifier connected)
* Added channel number in playing information --> shows the channel number which is playing
* Some code cleanup
* Added remote control --> you can now use the remote control in Domoticz (next to the TV icon in the Status device), this can among others be used for volume up and down (will also work when you have an amplifier connected)
* Added channel number in playing information --> shows the channel number which is playing
* Some code cleanup
Not using Domoticz anymore
Re: Python plugin: Sony Bravia [ready for test]
I could see the remote control, but how should it be work? I could not see any response if i try it... do i have to do updates before
- 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]
Update to the latest version of the plugin and then restart Domoticz.
Not using Domoticz anymore
Re: Python plugin: Sony Bravia [ready for test]
ok I will try it. Will it be also possible (for you) to have an connection to the integrated TV camaera?
- 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]
Nope, the TV camera is not part of the interface I am using for the plugin.
Not using Domoticz anymore
Re: Python plugin: Sony Bravia [ready for test]
Remote control is working with latest version. Will it be possible to add the TV/Radio button to RC?
- 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]
Yeah that's possible.
In plugin.py replace the following line
with
Then select the TV in the Hardware menu and press Update.
After that pressing the CH button can be used for TV/Radio.
You can of course change any of the other keys you would like to use for this.
In plugin.py replace the following line
Code: Select all
elif Command == "Channels": _tv.send_req_ircc("AAAAAQAAAAEAAAA6Aw==") # Display
Code: Select all
elif Command == "Channels": _tv.send_req_ircc("AAAAAgAAABoAAABXAw==") # Tv_Radio
After that pressing the CH button can be used for TV/Radio.
You can of course change any of the other keys you would like to use for this.
Not using Domoticz anymore
Re: Python plugin: Sony Bravia [ready for test]
Could not find the line
elif Command == "Channels": _tv.send_req_ircc("AAAAAQAAAAEAAAA6Aw==") # Display
in my plugin.py the line Looks like
elif Command == "Channels": _tv.send_req_ircc("AAAAAgAAABoAAABhAw==") # PopUpMenu
elif Command == "Channels": _tv.send_req_ircc("AAAAAQAAAAEAAAA6Aw==") # Display
in my plugin.py the line Looks like
elif Command == "Channels": _tv.send_req_ircc("AAAAAgAAABoAAABhAw==") # PopUpMenu
- 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]
You're right, I already have an updated version where the CH button is representing the Info button of the TV remote.
But the line with Channels and ending with #PopUpMenu is the one you can replace.
But the line with Channels and ending with #PopUpMenu is the one you can replace.
Not using Domoticz anymore
Who is online
Users browsing this forum: No registered users and 1 guest