Integration: emulated_roku - Sofabaton compatibility

Ok, that’s exactly what i am doing but…
You have not changed app1, app2, etc… in init.rb → hence in the sofabaton app the keys are named app1, app2, …

When you edit init.rb, you can name it like you would, and also (most important) add more than 10x “app” names :slight_smile:

Wow, that’s is really a good use case :sweat_smile:
Can I still change this?
Or should I delete the device and add a new one?
Thanks

Sadly, changing/adding apps after adding the device to the sofabaton hub is currently not possible.
You should take note of everything you want to archive, change it in init.rb, delete and re-add the device again.

Don’t forget to re-add the device/keys (Apps) to your activitys afterwards.

Thanks for your help.
I will try to do this :wink:

1 Like

Just got a new X1S as my harmony elite finally broke :frowning:

Setting up emulated Roku worked first time, and I can use the app_id’s to launch scenes and control covers. Pretty cool and much easier than I expected.

Where is this init.rb file you guys are talking about? It’s that accessible if using HA emulated Roku integration? Or do I need to use the python library?

Has anyone had a crack at using binary sensors to track the current state of the sofabaton activity? With the API turned on you could feed the activity starts and stops back to emulated Roku, and then use these to launch and stop activities so HA is always cognisant of the sofabaton state. Seems messy though

Edit: it’s actually much easier than that to track current state.

  1. Create toggle sensors for each activity
  2. Use event monitoring to listen to Roku remote commands (I am using last few apps)
  3. Add emulated Roku device to all activities, selecting no power or input changes
  4. Add each command to the start up and shut down sequences (it’s a toggle so only need one per activity).

There is always a chance it gets out of sync so potentially need to add macros etc to be able to fix this when broken.

I wanted state monitoring to replicate the way I used my harmony remote, but now I have it I am not sure I need it… Next I’ll try make a conditional card on living room dashboard to make us if it.

The init.py is in the emulated_roku folder from the github repo: GitHub - martonperei/emulated_roku

When you clone/download the project you can edit the file to add more than 10x “apps” keys and also give them names like “Scene bright living room”, …
See discussion from here on: Integration: emulated_roku - Sofabaton compatibility - #27 by pOpY

After that run “python3 example.py” and add the device to the sofabaton app.
When you done this, the app is reading the defined virtuall “app” keys and adding them to the roku device in the sofabaton app.
Then you have to change the IP address of the device in app to HA and add emulated roku device in HA.

Ps.: i also don’t need activity tracking for now. I am just using virtual “apps” for triggering scenes/automations. That’s enougth for me.

I understand some of that, but on HAOS I didn’t pull a repo. Emulated Roku is one of the built in integrations, and I can’t find anything anywhere on my filesystem relating to it using FileBrowser

Got you.
You have Todo this on another machine/PC.
Afterwards, change the IP in the Sofabaton app to the one from your HA installation.

Ok great I think I understand. Have just had a go and I can see the new emulated roku device on my sofabaton app after starting example.py, but after adding it the app shortcuts are not shown at all. Does this look correct?

APPS_TEMPLATE = """<apps>
    <app id="1" version="1.0.0">Vacuum Kitchen</app>
    <app id="2" version="1.0.0">Vacuum Living Room</app>
    <app id="3" version="1.0.0">Vacuum Living Areas</app>
    <app id="4" version="1.0.0">Vacuum Bin Area</app>
    <app id="5" version="1.0.0">Vacuum Bedrooms</app>
    <app id="6" version="1.0.0">Emulated App 6</app>
    <app id="7" version="1.0.0">Emulated App 7</app>
    <app id="8" version="1.0.0">Emulated App 8</app>
    <app id="9" version="1.0.0">Emulated App 9</app>
    <app id="10" version="1.0.0">Emulated App 10</app>
</apps>

This is what shows up after I have edited init.py, no Emulated app keys on the remote. Is that expected? Are they there, and will work as expected just are not visible?

Edit: Obviously this can’t be correct as if I can’t see those buttons on the sofabaton, then how can I use them to initiate scenes/commands…

Hey there :wave:
I’ve got trouble connecting to my emulated instance either on Windows or MacOS or HAss.
I’ve tried the advertise.py but mostly example.py
I used pfSense to capture packets and I can confirm the presence if multicast packets from the machine running the emulator:
15:22:34.048549 IP 192.168.100.29.1900 > 239.255.255.250.1900: UDP, length 186
Also the web server is responsive with a correct XML output.
I’m using the Sofabaton X1S app version 3.4.1 on iOS. I don’t have an android device.
Any help is appreciated!

Did you deactivate your firewall?
emulated roku opens a webserver for the apps to be parsed.

Maybe that’s the issue.

Yes, you have to see your defined “apps” in the sofabaton app.

Sorry i just have a windows PC and android devices. Cant help any further here.
Did your Mac has a firewall? Maybe deactivate it during the discovery.

You have to use “example.py” and NOT “advertise.py”!

Thanks for the quick replies. Yes, I’ve disabled the firewall on the windows machine to make sure. Also, since the webserver is accessible on the network, this is clearly working.
The only part I don’t have control over is the app on iOS, I don’t have a clue why it’s not discovering the system :disappointed:

Ok, than it seems to be an incompatibly between the emulated Roku and Mac.

Do you have any chance to get/borrow an Android device and try it there? Maybe after you have added the device to the sofabaton hub with the android device, you can use it with your Mac device?

Unfortunately I will have to find another way. No one in sight with an Android device that I know.
This is my iPhone btw, not a MacOS issue. I can see the XML on my Mac without issues.
It’s just too bad :confused: There must be differences in the apps between iOS and Android.

Hi pOpy, I tried it all again after re-pulling from git and now it is working :slight_smile:

Have 18 custom aps linked now and it all works, bit of a mess setting up the automations on the back end with that many though… Tried to use an existing blueprint to make things easier but can’t get it to work so far - link.

Yeah, sadly it seems an iOS sofabaton app issue.
Try to reach out to the support, maybe they can help.

Nice that it also works for you.
I have answered you in the linked thread with my automation (which covers all emulated roku key presses from two rooms/remotes).
Hope this helps.

pOpY

Good shout thanks!

Their support pointed me back to this thread :sweat_smile: