IOT Link - Windows Management using MQTT

I just followed the standard of having it to false as most MQTT libraries does. Also, retaining without user consent can create issues for those who don’t know how to clear or change it.

Just a quick question. Is there anyway of putting a monitor to sleep and wake up?

Have a read through here:

Finally got around to playing with this. Very impressed. The Zoom In Call option is great, is it possible to implement for others. It’s a shame windows doesn’t seem to offer a nice way to get webcam status (maybe I’m wrong, I hope so?). Two thoughts:

  • Might it make sense to separate the battery sensors from the power in the config file. That would provide an easy way to disable the battery sensors on a desktop.
  • It would be good to be able to set system uptime to seconds like you can for the processes.

Also, it seems the last two release dates are in the future ;).

Thanks for the awesome software

1 Like

I am having an issue. I have a PC which I access via RDP. If I am connected to the PC and RDP session is active, the command addon works fine. But, if I x out of RDP (which means all programs and processes are still running), the command addon fails to work with the following error:

[2020-10-02 22:25:17 -04:00][WARNING][IOTLinkAPI.Platform.Windows.WindowsAPI]: WindowsAPI::Run() - No User/Active session found. Returning.
[2020-10-02 22:31:54 -04:00][WARNING][IOTLinkAPI.Platform.Windows.WindowsAPI]: WindowsAPI::Run() - No User/Active session found. Returning.

I can query the PC remotely using pslist utility and it shows both IOTLink Service and agent are running.

IOTLinkService    12784   8  27  694  75996     0:08:30.187     9:10:07.829
IOTLinkAgent       9488   8  13  523  36880     0:00:14.062     8:03:43.959

How to fix this issue?
Thanks,
Arun

I got the audio controls working again with the help of this neat old tool:

https://www.nirsoft.net/utils/nircmd.html

Use it like this:

- service: mqtt.publish
  data:
    topic: "iotlink/workgroup/machinexxx/commands/run"
    payload: '{ "command": "C:\\Users\\JWM\\Tools\\nircmd.exe", "args": "changesysvolume 2000", "path": "C:\\Users\\JWM\\Tools", "user": "JWM", "visible": true, "fallback": true }'

It’s also possible to change audio devices and much more…

2 Likes

Hi. I’ve setup IOT Link on my server and all values are being pushed tot the MQTT Broker. In HA however, not all values come through. CPU and RAM stats do, for example, but hard drive stats don’t. The values are there in the MQTT Broker, but HA just says ‘Unknown’.

Strangely, if I click on an entity, it shows the value in the graph, just not as a value in the current state
image

Thanks for sharing this. I have it working to change my audio devices…sort of. Having a problem escaping double quotes.

This works

- service: mqtt.publish
  data:
    topic: "iotlink/workgroup/pc/commands/run"
    payload: '{ "command": "D:\\nircmd\\nircmd.exe", "args": "nircmd setdefaultsounddevice Speakers 1", "path": "D:\\nircmd", "user": "", "visible": true, "fallback": true }'

However because the other audio device has a space, I need to surround its name with double quotes and it seems to break the json and in return not get processed properly by the nircmd application. See below.

- service: mqtt.publish
  data:
    topic: "iotlink/workgroup/pc/commands/run"
    payload: '{ "command": "D:\\nircmd\\nircmd.exe", "args": "nircmd setdefaultsounddevice "DELL 2715H" 1", "path": "D:\\nircmd", "user": "", "visible": true, "fallback": true }'

I’m far from a YAML expert but do you have any recommendation of how to format the payload to escape the quotes without breaking json.

FYI, I can see that it break the json by using MQTT Explorer. These are the screen shots of the topic after publishing each of the above

Speaker audio device that arrives as json and works:
image

Dell audio device that seems to be converted to a non-json string and doesn’t work:

Any guidance appreciated.

Can you simply change the name of the audio device in windows?

1 Like

Didn’t know that was possible :crazy_face: since I never had a need…till now.
It’s always something simple and obvious that “escapes” me. Lol

Thank you sir !!

Escaping the " character works like this:

"args": "setdefaultsounddevice \"3 - SONY TV\" 1"

@Everyone

Released today version v2.2.2 which fixes LWT being not sent sometimes making sensors unavailable.

Also added tls certificate options for those who wants to use it. If you don’t, then you do not need to redo your configs to include the missing tls part.

Regards,

3 Likes

Is there any way to toggle mute of a microphone.
Same as the mute button on my keyboard.

Not volume mute but microphone mute.
Thanks!

Only just saw this comment today. Unfortunately that was the first way I tried and it did not work. Not an issue anymore since I simply renamed the device as suggested…but I would love to know the correct way to get it working.

@alexslx, my instance of IOT Link doesn’t seem to survive after my pc resumes from sleep. I was hoping your last update would fix this but unfortunately it did not. All my sensors go to “unknown” and do not populate again until I manually restart the service. Thoughts?

1 Like

I there a way to make a MQTT Switch for the screen on/iff command? DOon’t want to use scripts but create a MQTT switch

Does v2.2.2 correct the issue of sensors going to “unknown” after your PC resumes from sleep? I had that issue even on 2.2.1, but I think 2.2.2 fixes it. I just updated so I’ll test for a few days and see if it fixes things.

fyi, I still have that same problem with 2.2.2

1 Like

I’m on 2.2.2 so…no it doesn’t fix it.
I tested a few short periods of sleep and it works fine, but it never works after being asleep overnight. I always have to restart the service.

I can’t say for sure, but I believe that prior to 2.2.2 my sensors would say “unavailable” and after 2.2.2 they now say “unknown”

1 Like

Ah I see. Well I suppose, in the meantime, I’ll continue to use Task scheduler to restart the IOTLink service when the computer wakes from sleep

1 Like