Integration: emulated_roku - Sofabaton compatibility

Maybe your python version is incompatible (to new).
Try to use an older one.

Thanks for the suggestion. Python 3.10.0rc2 ended up working after I reinstalled aiohttp (pip install aiohttp) and running example.py again.

The addition to Sofabaton worked but no events are firing in HA unfortunately. I see “Emulated App 1-10” in the app. I changed the IP over to my HA IP, which is discovered automatically when I went to change the IP, but still nothing. When I go back to the one on Windows I do see the button presses so I don’t think it is an app or firewall/wifi client segregation.

INFO:aiohttp.access:192.168.123.85 [07/Dec/2024:23:40:13 -0500] "POST /keypress/VolumeMute HTTP/1.1" 200 112 "-" "-"
INFO:aiohttp.access:192.168.123.85 [07/Dec/2024:23:40:13 -0500] "POST /keypress/VolumeUp HTTP/1.1" 200 112 "-" "-"
INFO:aiohttp.access:192.168.123.85 [07/Dec/2024:23:40:14 -0500] "POST /keypress/VolumeMute HTTP/1.1" 200 112 "-" "-"
INFO:aiohttp.access:192.168.123.85 [07/Dec/2024:23:40:14 -0500] "POST /keypress/VolumeDown HTTP/1.1" 200 112 "-" "-"
INFO:aiohttp.access:192.168.123.85 [07/Dec/2024:23:40:20 -0500] "POST /launch/4 HTTP/1.1" 200 112 "-" "-"
INFO:aiohttp.access:192.168.123.85 [07/Dec/2024:23:40:21 -0500] "POST /launch/6 HTTP/1.1" 200 112 "-" "-"
INFO:aiohttp.access:192.168.123.85 [07/Dec/2024:23:40:21 -0500] "POST /launch/8 HTTP/1.1" 200 112 "-" "-"
INFO:aiohttp.access:192.168.123.85 [07/Dec/2024:23:40:22 -0500] "POST /launch/6 HTTP/1.1" 200 112 "-" "-"
INFO:aiohttp.access:192.168.123.85 [07/Dec/2024:23:40:22 -0500] "POST /launch/6 HTTP/1.1" 200 112 "-" "-"

Guys, anybody have a solution to get more than one emulated roku working with this remote? I can get 2 emulated rokus added to my remote, but when I try to listen for commands with the second instance selected, HA sees key presses with “source_name” as the first instance, so it doesn’t work… My guess it’s because sofabaton detects both instances with the same IP and can’t differ by port… Any tips?

I had two hubs+sofabaton’s working which where in two different rooms.
The trick is to customize emulated apps in file “init.py”.
You can add/change the custom apps template “APPS_TEMPLATE”.
Give them names like, ex.:

Living room:

  • LR ceiling light
  • LR Ambilight
  • LR scene xy
  • …

Bed room:

  • BR ceiling light
  • BR Ambilight
  • BR scene xy
  • …

You can expand the array. I had ~40 apps.

After that add the device to every hub and change the ip to HA’s ip in the app.
Edit the activity’s (prefered keys) → add the “room” keys to it.
Now when you press the buttons on the different remotes, you can differentiate between the rooms (and buttons).

Hope this is what you want :slight_smile: