środa, 19 lutego 2020

Control Sony Bravia TV with openHAB 2.5 through Google Home

Here is how i control power on and off my sony bravia tv :)

1. Download two files (print_ircc_codes.sh; send_command.sh) from:
https://github.com/breunigs/bravia-auth-and-remote
and save them in /home/pi folder with attributes 0755.

2. Set your tv like in readme.md:

  • Navigate to: [Settings] → [Network] → [Home Network Setup] → [IP Control]
  • Set [Authentication] to [Normal and Pre-Shared Key]
  • There should be a new menu entry [Pre-Shared Key]. Set it to 0000. If you choose anything else, you need to change the PSK in the send_command.sh script.


3. Run this command to check control codes of your tv.
(of course with your tv ip)
print_ircc_codes.sh 192.168.8.120
4. Now create openhab files openHAB:
(of course edit tv codes)

sony.items
Switch TV "Bravia TV" { ga="Switch" }

sony.sitemap
sitemap default label="Dom"
{
Switch item=TV label="Bravia TV" mappings=[ "ON"="ON", "OFF"="OFF" ]
}

sony.rules
rule "TV ON"
when
Item TV received command ON or
Item TV changed from OFF to ON
then
executeCommandLine("/home/pi/send_command.sh 192.168.8.120 AAAAAQAAAAEAAAAuAw== sony")
end

rule "TV OFF"
when
Item TV received command OFF or
Item TV changed from ON to OFF
then
executeCommandLine("/home/pi/send_command.sh 192.168.8.120 AAAAAQAAAAEAAAAvAw== sony")
end

Brak komentarzy:

Prześlij komentarz