IOT Link - Windows Management using MQTT

Hi, I’m a bit stuck and I can’t find what’s not working.

  • My mqtt broker works and I’m using it for various automations
  • Software installed (in admin), all seems to work
  • MQTT explorer shows lots of messages from my PC
  • But Home Assistant fails to get anything working

In Home Assistant:
image

One example of how I am calling it from HA:

  - platform: mqtt
    name: "My Computer - Current User"
    state_topic: "iotlink/workgroup/w-s4su3841/windows-monitor/stats/system/current-user"
    unit_of_measurement: ''
    icon: mdi:account
    value_template: "{{ value }}"
    availability_topic: "iotlink/workgroup/w-s4su3841/lwt"
    payload_available: "ON"
    payload_not_available: "OFF"
    qos: 1

Any suggestions?

Can’t see anything wrong here. But I do have a few questions.

  1. Why not just use MQTT Discovery?
  2. There is no need to have value_template on this example, because without a template the state is a string of whatever is published to that topic.
1 Like

Thanks. I went down the rabit hole of checking everything and I realized that my mosquito broker in integration in home assistant was… wrong. I used Nodered as a standard so I never thought about checking there. It works now. Thanks!
image

1 Like

Hello. I am still looking a way to open chrome in incognito. I have tried creating a shortcut and editing the shortcut properties, but does not work.

Hi!
Is it possible to unlock the computer from the lock state?
I got the lock command working but I would love to unlock it aswell.

Thanks

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?