[SOLVED]Unified Remote integration possible?

Hey guys,

I ve been using unified remote on my android device (client) to control my pc (Server) for a long time. It seems to have a lot of functionality and great capabilities to control things on a windows pc.

My main goal is to set up a switch in HA that would control my pc volume (0-100%), then expose it to alexa through emulated hue and control the volume from alexa. Similarly for media keys (next/prev/play/pause).

Would it be possible to integrate such functionality inside HA? Probably with shell commands?
Has anyone seen or done anything similar? Or perhaps with another server application?

Thanks in advance

1 Like

I’m also interested in the exact same thing except for the Alexa part! 1+

Yeah, the alexa part is just an added functionality :slight_smile:
The main thing is to make switches within HA that would send commands to my PC’s Unified Remote Server, probably by utilizing its API

I found this post because I was searching, to see if anyone had a similar idea already; a Unified Remote server running on a PC could be the basis of a Home Assistant component. Either as a media_player or a different category (windows_computer).

That would allow HA to very nicely control a Windows PC, through simple web APIs.

Maybe I need to look into developing components… seeing it hasn’t been done yet

I just faced a similar problem. I want to turn off my PC’s monitor when I watch a movie and I’ve been using the android app for that. Unfortunately there’s no console client for Unified Remote. But they have a web interface. I spent some sime looking at the messages sent and wrote a small python script that triggers the “monitor off” command. If you want to trigger different things, like changing volume, I suggest you turn on chrome’s network monitor, trigger the command via the web interface and copy the last payload sent to http://localhost:9510/client/request into the script as the last payload.

#!/usr/bin/python3
import requests
import json
import uuid


base_url = 'http://192.168.1.107:9510/client/'

# establish connection
response = requests.get(base_url + 'connect')
conn_id = response.json()['id']

headers = {
    'UR-Connection-ID': conn_id,
}

new_guid = str(uuid.uuid4())
my_guid = str(uuid.uuid4())
source_guid = "web-" + my_guid
password = new_guid
payload = {'Action':0,'Request':0,'Version':10,'Password':password,'Platform':'web','Source':source_guid}
response = requests.post(base_url+'request', headers=headers, data=json.dumps(payload))

payload = {"Capabilities":{"Actions":True,"Sync":True,"Grid":True,"Fast":False,"Loading":True,"Encryption2":True},"Action":1,"Request":1,"Source":source_guid}
response = requests.post(base_url+'request', headers=headers, data=json.dumps(payload))

# trigger remote action
payload = {"ID":"Unified.Monitor","Action":7,"Request":7,"Run":{"Name":"turn_off"},"Source":source_guid}
response = requests.post(base_url+'request', headers=headers, data=json.dumps(payload))

I would be happy to pay someone to make a solid Unified Remote integration.
Seems like perfect choice for HA with it’s API and extensive features.

Hell, I would try to make it myself, if I had the skills…

1 Like

I used to use Unified Remote and did a few scripts to integrate with HA (mostly service calls). But later I found that i could do the same and with some advantages using HAdashboard.

Can you please explain? How can a new dashboard allow me to control a Windows PC through HA?
I’ve checked HAdashboard documentation and there was no mention on that.
What am I missing?

I thought you want the other way around… i.e. using the unified remote to control HA.

I came from the future to just say that I DID A INTEGRATION with unified remote and HA. It already works but is not documented yet (I will working on it in the next days). When I completely finish it (some code refactoring and a how to use complete guide) I will create a topic here to explain a little more about. The cool part is that you don’t need any weird methods to do this, like pay for an mobile app to trigger the remotes and use tasker (another paid app) to automate.

3 Likes

Hello man from the future!
This sounds great, looking forward to see it in action.

1 Like

Ok guys, there it is:

3 Likes

:clap:
Will check and come back with comments Davi,
Thanks a lot for this.

Edit: Excuse my igonrance, is this the equivalent of manually adding the files to your hass.io installation?

1 Like

Yes it is, but very soon I’ll be adding on HACS to easy installation.

2 Likes

Works great!

I was a little confused with declaring the remotes and then calling them as services but that was due to me rushing through your documentation.

Thanks again.

(btw, is there a way to call remotes, not previously defined in remotes.yml, through services? for testing purposes?)

It is pretty easy, just follow the example file that already comes with integration, and read this section to find the remote info and add it with a desired friendly name to device file.

For now, is not possible to call remotes without declare it first, I really did not think about that, but I can add this in the next version.

This is great - thanks for your hard work. Works perfectly and suits my usage very well (using my main PC to run VLC to my TV). I use unified remote to control things like the mouse/keyboard, but now I can automate things like switching monitors/dimming lights/pausing VLC when a noisy train passes by :smiley:

1 Like

Dude, that’s so nice, I very appreciate your feedback, but wait… how the hell your HA knows when a train is passing? LOL

1 Like

Haha, I live right next to a train line which has noisy freight trains. I have a couple of arduino’s around the home and can trigger (mqtt) things based on noise levels.

2 Likes

Enough home automation for today :rofl:

1 Like