IOT Link - Windows Management using MQTT

Hi, I haven’t found a software solution but this will work: ESPHome Ducky - USB Keystroke-Injection

Can you please share the 2 scripts ? Thanks in advance !

I see a lot of comments about sensors going ‘Unavailable’ and I don’t know for certain whether this resolves it but I don’t seem to have any issues anymore since I changed the cleanSession: true option to false in the configuration file of the iotlink service. I’m curious if others find positive results with this.

Also I should mention that I have my pc set to hibernate automatically when I fall asleep as well as a task to restart the service every time that happens, so the running time of this being successful has never been tested to more than ~18h. To have it restart after hibernation one would need a batch script with

SC stop iotlink
Timeout 5 /nobreak
SC start iotlink

And have the script run with task scheduler as explained here

IOT Link - v2.2.2
Windows 10 Pro 20H2 19042.1466

Tell me how to take out the Windows volume level sensor? In IOTLink I don’t see this volume level sensor, where is it? I specified different media options in the config, but there is no volume level in the topics.

It mentions the Media sensor, where is it? Where should I point it?

Here I specified Media, but I don’t see the media topic in the topics
image

image

Audio monitoring was removed in 2.2.0 due to a memory leak in the library used. See the release notes on v2.2.0 · IOT Link / IOT Link Service · GitLab
You’d have to use the version before that and use some scripts to restart the service to deal with the memory leak - which is a hack and a half.
It would make more sense to switch over to hass workstation service. It has various volume sensors, full media control, and can detect if webcam and mic are in use and by which process: GitHub - sleevezipper/hass-workstation-service: Provide useful sensors and services from your workstation to Home Assistant.
It also has an example on how to set up a media player entity to control your pc: hass-workstation-service/Commands.md at 7fd20a4fc5718fcd5960e318ab81186b073af82d · sleevezipper/hass-workstation-service · GitHub

3 Likes

+1 on the Hass workstation service. I switched over to it during the holidays and have been very happy. There is also a custom component that builds upon sleevezipper’s great work. I don’t need the notifications, etc so I use the original but the component looks fantastic and the developer is very active…even has a discord channel for support and testing.

3 Likes

Nice! Had not seen the hass agent yet but looks good. Know what I’ll be doing this weekend :slight_smile:

@alexslx

For the life of mine, i cannot find the releases -page in gitlab. Please assisti? :slight_smile:

found it…under deployment

Sure. I use these in combination with FreePBX and IoTLink to mute/unmute my phone depending on whether or not I’m on the phone. But you could easily adapt them to do all sorts.

C:\volmax.exe

IniRead, OutputVar, C:\Users\%A_UserName%\volume.ini, volume, key
SoundSet, %OutputVar%
IniRead, OutputVar, C:\Users\%A_UserName%\volume.ini, volume, key
If (OutputVar==0)   
SoundSet, 100
Else 
SoundSet, %OutputVar%

c:\Volmin.exe

SoundGet, master_volume
IniWrite, %master_volume%, C:\Users\%A_UserName%\volume.ini, volume, key
SoundSet, Mute

Listener

if (!A_IsAdmin)
{
    Run % "*RunAs " DllCall("GetCommandLine", "Str")
    ExitApp
}


#NoEnv
#Persistent
#SingleInstance Force
DetectHiddenWindows, On
SetTimer Check,2000
flag:=0
Return

Check:
SoundGet, master_volume
If (master_volume<=0) {  
			If (flag == 0) {
			Gui, Font, cBlack
			Gui, +LastFound +AlwaysOnTop +Caption +ToolWindow -SysMenu
			Gui, Font, cBlack 
			Gui, Font, s34
			Gui, Add, Button, Default   gMute,  UNMUTE?
			Gui, Color, EEAA99
			Gui +LastFound  
			WinSet, TransColor, EEAA99
			Gui, Show, x1000 y55, ,
			Gui -Caption 
		    flag:=1
 }			
 		}
If (master_volume>=10) {  
    Gui, Destroy
	flag:=0
 		}		
Return


Mute:
	Run, "C:\volmax.exe"
	Gui, Destroy
	flag:=0
Return

I just stumbled upon this and would like to try it but I am stuck here Download the provided Installer for your system from the Releases tab.. What Releases tab? Where??

https://iotlink.gitlab.io/downloads.html

but I would strongly suggest you give HASS workstation service a go instead as that is actively being developed whereas the last update on iotlink is 2 1.5 years old now and there are known bugs you will need to work around.

2 Likes

Thank you! That’s pretty slick!

Interesting project. How is it working out for you a year later? Profitable?

I use this to very handy application to start my PC in ‘gaming mode’. Ideally I would be able to run a .exe file (some keystrokes compiled with autoit) on the windows logon screen to switch users, but that doesn’t seem to work.

Is IOT link able to run .exe files on the logon screen and am I doing something wrong, or is it a limitation of IOT link or Windows?

This might also be an alternative?

1 Like

Hi all! I have IOTLink running and connected to my HASS instance but I’m having problems getting the commands integration to run a windows program. I’ve been testing with just running notepad remotely with this configuration:

        ´tap_action: 
          action: call-service
          service: mqtt.publish
          service_data:
            topic: "iotlink/masfunke/isakbox/commands/run"
            payload: '{ "command": "C:\\Windows\\System32\\notepad.exe", "args": "", "path": "C:\\Users\\Nacho\\Desktop", "user": "", "visible": true, "fallback": true }'

which is coupled to a button in lovelace. I can see in the windows machine the MQTT message arriving and the spinning wheel in Windows starts but notepad never opens. I assume it is something with how I write the command and its arguments but I have tried double //, single and all possible combinations without any luck. Anyone has an example of running an arbitrary command via IOTLink? Or any tips on what i wrong?

Thanks!
/Nacho

Has anyone been able to use TTS? Could you share an example? Thanks!

hi all
how can completely uninstall/remove iotlink from my pc and HA?

Hi guys! just started learing about IoT Link. I was able to execute a bat file using the code below but it works only if connected via rdp…any ideas?

Thanks

service: mqtt.publish
data:
  topic: iotlink/workgroup/win-mapv2tue7m7/commands/run
  payload: >-
    { "command": "C:\\windows\\AION.bat", "path": "C:\\windows", "user": system "",
    "visible": false, "fallback": true }