Integracja radia internetowego Oakcastle

Czy ktoś wie jak zintegrować radio internetowe Oakcastle? Mogę nim sterować przy pomocy AirMusic Contol wydaną przez MediaYou. Znalazłem trochę materiałów na githubie:

https://gist.github.com/hsiboy/5662ee465979550452cf0470ff144353

https://github.com/kayrus/iradio

Tylko za bardzo nie wiem jak to ugryźć, integracja powinna być podobna do Silicon Frontier. Wiem też że inne radia używają tej apki - jak np. popularna w PL Auna czy Sharp.

Trochę więcej informacji znalazłem na githubie:

https://github.com/RobinMeis/AirMusic/tree/master/docs

https://github.com/vitasrutek/special-octo-waffle

https://github.com/edberoi/python-airmusicapi

W ostatnim linku jest nawet jakieś api na pythonie - jak to dodać do HA?

Edycja 9.02.22:
Na raspberry pi 4 zainstalowałem tests.py from https://github.com/edberoi/python-airmusicapi

Mam dwa radia tego typu, info z pierwszego:

Device Name: Radio �azienka
{
“SW_Ver”: “AT9THFCR-i724h-i713**ad-i725a-(DB:20211111)”,
“wifi_info”: {
“status”: “connected”,
“MAC”: “0C8C243E5CE0”,
“SSID”: “DOM3”,
“Signal”: “76”,
“Encryption”: “WPA2/AES”,
“IP”: “192.168.0.141”,
“Subnet”: “255.255.255.0”,
“Gateway”: “192.168.0.1”,
“DNS1”: “192.168.0.91”,
“DNS2”: null
}
}
Current volume = 3
Current mute = False
Hotkeylist: 5 out of 5:
75_256, Muzo.fm, file
75_770, Antyradio 94 FM Warszawa, file
75_4, Rock Radio, file
75_0, Double Q 101 WWQQ FM 101.3, file
75_0, Radio TOK FM, file
Verify navigation through menus to reach a station to play.
List: 10 out of 10:
87 Local Radio → content
51 my mediaU → content
52 Internet Radio → content
2 Media Center → content
5 FM → content
91 DAB/DAB+ → content
3 Information Center → content
47 AUX → content
104 Bluetooth → content
6 Configuration → content
List: 6 out of 6:
75 My Favorite → content
71 Radio Station/Music → content
87 Local Radio → content
154 Sleep Radio → content
59 History → content
4 Service → content
List: 8 out of 8:
75_0 Muzo.fm → file
75_1 Antyradio 94 FM Warszawa → file
75_2 Rock Radio → file
75_3 Double Q 101 WWQQ FM 101.3 → file
75_4 Radio TOK FM → file
75_5 Radio Nowy Å�wiat → file
75_6 Rádio Anténa Rock → file
75_7 Empty → emptyfile
Press CTRL-C to interrupt.
Vol sid Status
3 1 Connecting …
3 1 Connecting …
3 1 Connecting …
3 1 Connecting …
3 1 Connecting …
3 1 Connecting …
3 1 Connecting …
3 1 Connecting …
3 1 Connecting …
3 1 Connecting …
^CGoing to play the radio station at hotkey 1.
Press CTRL-C to interrupt.
Vol sid Status
3 1 Connecting …
3 1 Connecting …
3 1 Connecting …
3 2 Buffering 25%
3 6 Playing
3 6 Playing
3 6 Playing

Drugie radio:

Device Name: Oakcastle IR100
{
“SW_Ver”: “5SADNB33-jb21h-jb21**a*-jb21a-(DB:20220114)”,
“wifi_info”: {
“status”: “connected”,
“MAC”: “74EE2A365265”,
“SSID”: “DOM3”,
“Signal”: “82”,
“Encryption”: “WPA2/AES”,
“IP”: “192.168.0.142”,
“Subnet”: “255.255.255.0”,
“Gateway”: “192.168.0.1”,
“DNS1”: “192.168.0.91”,
“DNS2”: null
}
}
Current volume = 10
Current mute = False
Hotkeylist: 5 out of 5:
75_0, Muzo.fm, file
75_1, Antyradio FM, file
75_2, Rock Radio, file
75_3, EskaROCK, file
75_4, Radio Nowy Swiat, file
Verify navigation through menus to reach a station to play.
List: 7 out of 7:
87 Local Radio → content
52 Internet Radio → content
2 Media Center → content
136 Spotify Connect → content
3 Information Center → content
104 Bluetooth → content
6 Configuration → content
List: 5 out of 5:
75 My Favorite → content
71 Radio Station/Music → content
154 Sleep Radio → content
59 History → content
4 Service → content
List: 10 out of 10:
75_0 Muzo.fm → file
75_1 Antyradio FM → file
75_2 Rock Radio → file
75_3 EskaROCK → file
75_4 Radio Nowy Swiat → file
75_5 ANTENA ROCK → file
75_6 Zlote → file
75_7 MELO- → file
75_8 TOK FM → file
75_9 Empty → emptyfile
Press CTRL-C to interrupt.
Vol sid Status
10 1 Connecting …
10 2 Buffering 25%
10 6 Playing
10 6 Playing
10 6 Playing
10 6 Playing
10 6 Playing
^CGoing to play the radio station at hotkey 1.
Press CTRL-C to interrupt.
Vol sid Status
10 6 Playing
10 1 Connecting …
10 3 Buffering 50%
10 6 Playing
10 6 Playing

Jeśli uruchomię ten skrypt Antyradio będzie odtwarzane:

import json
import logging
import time
from airmusicapi import airmusic

IPADDR = ‘192.168.0.142’ # Change this to the IP-address or hostname of your device.
TIMEOUT = 5 # in seconds. In most cases 1 second is sufficient.

def main():

am_obj = airmusic(IPADDR, TIMEOUT)
am_obj.log_level = logging.DEBUG
am_obj.init(language="en")

hotkeylist = am_obj.get_hotkeylist()

am_obj.enter_menu(75)
am_obj.play_station('75_1')

am_obj.play_hotkey(1)

if name == ‘main’:
main()

Kontrola po ip działa idealnie, reszta komend jest w init.py i teraz pytanie jak to dalej zintegrować z HA?

Jeśli te twoje radyjka są na chipsecie Frontier Silicon: Venice 6 lub Venice X (nie wiem na jakim są faktycznie, ale sam sugerowałeś tego producenta), to chyba warto na początek spróbować tej integracji

sprawdzałeś ją?

Te radia nie są na czipach Frontier Silicon tylko Magic Systech - miałem wcześniej radio Medion na Frontier Silicon ale często gubiło zasięg wi-fi a ostatecznie poszło z dymkiem :smiley: Wspomniana integracja z tymi radiami nie działa.

Dlatego szukam rozwiązania z radiami robionymi przez Majority - świetny dźwięk, można bez problemu dodawać własne stacje radiowe, na minus słaba apka do sterowania radiem - dlatego chce to spiąć z HA i jej się pozbyć :wink: jest api na pythonie, działają komendy i wszystko jest w miarę opisane, tylko jak to wrzucić do HA aby dało się zrobić fajne sterowanie przez lovelace i media player.

Edycja:
Po pewnym kombinowaniu w końcu użyłem shell_command aby zrobić sterowanie radia z poziomu HA:

shell_command:
  kuchnia_on_off: "curl -H 'Authorization: Basic c3UzZzRnbzZzazc6amkzOTQ1NHh1L14=' http://192.168.0.142/Sendkey?key=7"
  kuchnia_vol_up: "curl -H 'Authorization: Basic c3UzZzRnbzZzazc6amkzOTQ1NHh1L14=' http://192.168.0.142/Sendkey?key=9"
  kuchnia_mute: "curl -H 'Authorization: Basic c3UzZzRnbzZzazc6amkzOTQ1NHh1L14=' http://192.168.0.142/Sendkey?key=8"
  kuchnia_vol_down: "curl -H 'Authorization: Basic c3UzZzRnbzZzazc6amkzOTQ1NHh1L14=' http://192.168.0.142/Sendkey?key=10"
  kuchnia_up: "curl -H 'Authorization: Basic c3UzZzRnbzZzazc6amkzOTQ1NHh1L14=' http://192.168.0.142/Sendkey?key=2"
  kuchnia_down: "curl -H 'Authorization: Basic c3UzZzRnbzZzazc6amkzOTQ1NHh1L14=' http://192.168.0.142/Sendkey?key=3"
  kuchnia_1: "curl -H 'Authorization: Basic c3UzZzRnbzZzazc6amkzOTQ1NHh1L14=' http://192.168.0.142/Sendkey?key=115"
  kuchnia_2: "curl -H 'Authorization: Basic c3UzZzRnbzZzazc6amkzOTQ1NHh1L14=' http://192.168.0.142/Sendkey?key=116"
  kuchnia_3: "curl -H 'Authorization: Basic c3UzZzRnbzZzazc6amkzOTQ1NHh1L14=' http://192.168.0.142/Sendkey?key=117"
  kuchnia_4: "curl -H 'Authorization: Basic c3UzZzRnbzZzazc6amkzOTQ1NHh1L14=' http://192.168.0.142/Sendkey?key=118"
  kuchnia_5: "curl -H 'Authorization: Basic c3UzZzRnbzZzazc6amkzOTQ1NHh1L14=' http://192.168.0.142/Sendkey?key=119"
  kuchnia_6: "curl -H 'Authorization: Basic c3UzZzRnbzZzazc6amkzOTQ1NHh1L14=' http://192.168.0.142/Sendkey?key=120"
  kuchnia_7: "curl -H 'Authorization: Basic c3UzZzRnbzZzazc6amkzOTQ1NHh1L14=' http://192.168.0.142/Sendkey?key=121"
  kuchnia_8: "curl -H 'Authorization: Basic c3UzZzRnbzZzazc6amkzOTQ1NHh1L14=' http://192.168.0.142/Sendkey?key=122"
  kuchnia_9: "curl -H 'Authorization: Basic c3UzZzRnbzZzazc6amkzOTQ1NHh1L14=' http://192.168.0.142/Sendkey?key=123"

I karta z przyciskami do sterowania:

type: grid
cards:
  - show_name: true
    show_icon: true
    type: button
    name: Radio Kuchnia
    tap_action:
      action: call-service
      service: shell_command.kuchnia_on_off
      service_data: {}
      target: {}
    icon: mdi:power
    show_state: true
    hold_action:
      action: none
  - show_name: true
    show_icon: true
    type: button
    tap_action:
      action: call-service
      service: shell_command.kuchnia_up
      service_data: {}
      target: {}
    entity: ''
    icon: mdi:arrow-up-bold
  - show_name: true
    show_icon: true
    type: button
    tap_action:
      action: call-service
      service: shell_command.kuchnia_down
      service_data: {}
      target: {}
    icon: mdi:arrow-down-bold
  - show_name: true
    show_icon: true
    type: button
    tap_action:
      action: call-service
      service: shell_command.kuchnia_vol_up
      service_data: {}
      target: {}
    icon: mdi:volume-plus
    show_state: true
    hold_action:
      action: none
  - show_name: true
    show_icon: true
    type: button
    tap_action:
      action: call-service
      service: shell_command.kuchnia_vol_down
      service_data: {}
      target: {}
    icon: mdi:volume-minus
    show_state: true
    hold_action:
      action: none
  - show_name: true
    show_icon: true
    type: button
    tap_action:
      action: call-service
      service: shell_command.kuchnia_mute
      service_data: {}
      target: {}
    icon: mdi:volume-mute
  - show_name: true
    show_icon: true
    type: button
    tap_action:
      action: call-service
      service: shell_command.kuchnia_1
      service_data: {}
      target: {}
    icon: mdi:numeric-1
    name: Muzo.fm
  - show_name: true
    show_icon: true
    type: button
    tap_action:
      action: call-service
      service: shell_command.kuchnia_2
      service_data: {}
      target: {}
    name: Antyradio
    icon: mdi:numeric-2
  - show_name: true
    show_icon: true
    type: button
    tap_action:
      action: call-service
      service: shell_command.kuchnia_3
      service_data: {}
      target: {}
    icon: mdi:numeric-3
    name: RockRadio
  - show_name: true
    show_icon: true
    type: button
    tap_action:
      action: call-service
      service: shell_command.kuchnia_4
      service_data: {}
      target: {}
    icon: mdi:numeric-4
    name: EskaRock
  - show_name: true
    show_icon: true
    type: button
    tap_action:
      action: call-service
      service: shell_command.kuchnia_5
      service_data: {}
      target: {}
    icon: mdi:numeric-5
    name: Radio Nowy Świat
  - show_name: true
    show_icon: true
    type: button
    tap_action:
      action: call-service
      service: shell_command.kuchnia_6
      service_data: {}
      target: {}
    icon: mdi:numeric-6
    name: Antena Rock
  - show_name: true
    show_icon: true
    type: button
    tap_action:
      action: call-service
      service: shell_command.kuchnia_7
      service_data: {}
      target: {}
    icon: mdi:numeric-7
    name: Złote Przeboje
  - show_name: true
    show_icon: true
    type: button
    tap_action:
      action: call-service
      service: shell_command.kuchnia_8
      service_data: {}
      target: {}
    icon: mdi:numeric-8
    name: MeloRadio
  - show_name: true
    show_icon: true
    type: button
    tap_action:
      action: call-service
      service: shell_command.kuchnia_9
      service_data: {}
      target: {}
    icon: mdi:numeric-9
    name: Tok FM