IOT Link - Windows Management using MQTT

IOT Link

IOT Link is a full featured service for connecting devices with IOT enabled services using MQTT.

Features

  • Windows System Control: Shutdown, Reboot, Suspend, Hibernate, Lock, Logoff, Volume Control, and much more.
  • Windows Monitoring: Sends the current CPU Usage, RAM Usage, Total and Available RAM, Battery Information through MQTT.
  • Widely customizable: More systems and informations can be monitored and controlled via development of future Addons.
  • Easy to use: Easy Installer provided and Minimal initial configuration required.
  • Fully Integrated: Working as a Windows Service to provide reliable data as soon as the windows boot up, without having to wait for a windows user logon.
  • Open source software: Both IOT Link API and Engine are open-source. Developers are welcome to send Merge Requests or develop their own addons.

Requirements

  • Windows 10 with administrator rights.
  • .NET Framework 4.7.2
  • Minimal understanding of YAML files.
  • Observations:
    • It might work with other Windows version, however it has been developed and tested only on Windows 10 (Update 1803+).
    • Please if you have it fully working on other Windows versions, inform it commenting on the following Issue: Working Windows Versions.

Installation

  • Download the provided Installer for your system from the Downloads tab.
  • Execute the downloaded installer ( Run as administrator ).
  • At the Start Menu you’ll have a folder named IOT Link .
  • Click on Open Configuration File and change your desired configurations. See Configuration for more information.
  • Save it. The Service will automatically reload the configuration file.
  • Enjoy.

Integrating

  • You can integrate IOT Link with other systems via MQTT .
  • You can see an example of integration with Home Assistant.
  • More integrations will be documented later.

Troubleshooting

Developers

Support & Contribute

Screenshot (IOTLink with Home-Assistant Integrated)

48 Likes

Hi! I just started using it and tested the commands and work great! But I can’t get the CPU, RAM, and Battery stats. Do you know what might it be?

1 Like

Same Here. I cant get the CPU, RAM, and Battery Stats to work.

Hi alexslx,
Just downloaded it and works perfectly! Nicely done! :ok_hand:
Is it possible to track temperature and GPU also?

And do you make a MacOS version for the IoT Link as well?

@pg.sylvestre and @federicodieleke

Are you using Windows 10? Can you check the logs? Any errors will be displayed there. You can check it using the shortcut placed under your start menu.

Also there is a page dedicated to try to troubleshoot the problems:

If there is nothing under the logs, It might be something in your Home Assistant configuration? You can post it here if you need help.

@Rasser
It is not possible to track temperatures yet, specially because there is no standard APIs :frowning:

I don’t have MacOS hardware but its open-source so if someone want to join and extend functions to MacOS they are more than welcome to do so!

Got it working on my main battlestation, thanks for the great work!

I think the windows service isn’t running:

 [WORKGROUP\SURFACE][2019-06-12 14:35:51 -03:00][DEBUG][IOTLink.Engine.AddonManager]: Addon configuration loaded: Windows Monitor
[WORKGROUP\SURFACE][2019-06-12 14:35:51 -03:00][DEBUG][IOTLink.Loaders.AssemblyLoader]: Found AddonScript!
[WORKGROUP\SURFACE][2019-06-12 14:35:54 -03:00][INFO][IOTLink.Engine.AddonManager]: System monitor is disabled.
[WORKGROUP\SURFACE][2019-06-12 14:35:54 -03:00][INFO][IOTLink.Engine.AddonManager]: Loading addon: windowsmonitor

While the addon it’s enabled:

enabled: true
id: WindowsMonitor
name: Windows Monitor
file: WindowsMonitor.dll
minApiVersion: 
maxApiVersion:

Are you using Windows 10? Can you check the logs? Any errors will be displayed there. You can check it using the shortcut placed under your start menu.

Also there is a page dedicated to try to troubleshoot the problems:

  • Yes, Windows 10.
  • I checked the troubleshooting, reinstalled everything with admin privileges, the service is running and the commands work.
  • The HA config it’s copied from the docs, and I double checked everything.

I’m trying to create a script to run steam but it doesn’t launch. What have I done wrong?

PC_run_app:
  alias: "PC - Run App"
  sequence:
    - service: mqtt.publish
      data_template:
        topic: "iotlink/workgroup/pc/commands/run"
        payload: { "command": "C:\\Program Files (x86)\\Steam\\Steam.exe", "args": "", "path": "C:\\Program Files (x86)\\Steam\\", "user": "User" }

I can also confirm the same issue here with Windows Monitor and have performed all the suggestions. This is a clean first time install on Windows 10. I went ahead and disabled System Commands to keep output clean and here’s my log when I start the service:

[IA-VMS02][2019-06-12 15:18:09 -04:00][INFO][IOTLink.IOTLinkService]: Windows Service is started.
[IA-VMS02][2019-06-12 15:18:09 -04:00][INFO][IOTLink.Engine.MQTT.MQTTClient]: Trying to connect to broker: tcp://192.168.100.63:1883 (Try: 1)
[IA-VMS02][2019-06-12 15:18:10 -04:00][INFO][IOTLink.Engine.MQTT.MQTTClient]: MQTT Connected
[IA-VMS02][2019-06-12 15:18:10 -04:00][DEBUG][IOTLink.Engine.AddonManager]: Loading 2 external addons
[IA-VMS02][2019-06-12 15:18:10 -04:00][DEBUG][IOTLink.Engine.AddonManager]: Addon configuration loaded: System Commands
[IA-VMS02][2019-06-12 15:18:10 -04:00][DEBUG][IOTLink.Engine.AddonManager]: Addon configuration loaded: Windows Monitor
[IA-VMS02][2019-06-12 15:18:10 -04:00][DEBUG][IOTLink.Loaders.AssemblyLoader]: Found AddonScript!
[IA-VMS02][2019-06-12 15:18:11 -04:00][INFO][IOTLink.Engine.AddonManager]: System monitor is disabled.
[IA-VMS02][2019-06-12 15:18:11 -04:00][INFO][IOTLink.Engine.AddonManager]: Loading addon: windowsmonitor
[IA-VMS02][2019-06-12 15:18:11 -04:00][DEBUG][IOTLink.Engine.MQTT.MQTTClient]: Subscribing to iotlink/ia-vms02/#
[IA-VMS02][2019-06-12 15:18:11 -04:00][INFO][MQTTnet.Client.MqttClient]: Connection successful
[IA-VMS02][2019-06-12 15:18:11 -04:00][DEBUG][IOTLink.Engine.MQTT.MQTTClient]: MQTT Message Received - Topic: iotlink/ia-vms02/lwt

All I am getting in MQTT is:
iotlink/ia-vms02/lwt: ON

Thanks

As other wrote… Successfully connected to Mosquitto MQTT Server running on Hass.io. Both addons are enabled, but log states Monitor is disabled. I can mute/un-mute, so commands works. Monitor doesn’t send anything.

[WORKGROUP\XXX-PC][2019-06-12 22:40:39 +02:00][INFO][IOTLink.Engine.MQTT.MQTTClient]: Trying to connect to broker: tcp://192.168.XX.XX:1883 (Try: 1)
[WORKGROUP\XXX-PC][2019-06-12 22:40:40 +02:00][INFO][IOTLink.Engine.MQTT.MQTTClient]:   MQTT Connected
[WORKGROUP\XXX-PC][2019-06-12 22:40:44 +02:00][INFO][IOTLink.Engine.AddonManager]: System monitor is disabled.
[WORKGROUP\XXX-PC][2019-06-12 22:40:44 +02:00][INFO][IOTLink.Engine.AddonManager]: Loading addon: windowsmonitor
[WORKGROUP\XXX-PC][2019-06-12 22:40:44 +02:00][INFO][MQTTnet.Client.MqttClient]: Connection successful

While looking at the addon source code I notice the reference to config.yaml which does not exist for Windows Monitor. I was about to log on GitLab project but found it already referenced --> https://gitlab.com/iotlink/iotlink/issues/19. After creating the config.yaml it works! Awesome project!

Hey guys,

I’m not able to fix the installer with the config file until this weekend. You can grab the file from the issue posted above.

Also the HDD monitoring wasn’t released with the 1.0.1 version but will be on 1.1.0 with other new features you will like. A little wait worth it.

I really hope you enjoying this and I’m really thankful for all reports and ideas.

I’m getting socket error when connecting from PC, any ideas? I have MQTT on Synology Docker instance, HA is connecting fine.

I was also seeing the Socket error when trying to run the Windows Monitor. Since I added the config.yaml the error went away. Have you added the config.yaml? See the previous post.

This worked! thanks!!

Hi,

I’ve just released the IOT Link v1.1.0 which include many fixes and new features as below:

  • NEW! Windows Monitor: Information about HDD (Usage, Total Space, Free Space, etc.)
  • NEW! Windows Monitor: Information about idle time (Per user session).
  • NEW! Windows Monitor: Information about computer displays (including screenshots!).
  • NEW! Windows Monitor: Each monitor (HDD, CPU, etc) can be configured or disabled separated.
  • Fixed extra unused folders bundled with the installer.
  • Fixed some issues permisson issues with the run command.
  • Fixed missing configuration file.

I’ll be updating the documentation tomorrow with the new topics, bu you can install this version as right now.

Edit: v1.1.1 Released with several bug fixes from v1.1.0 - Use this

2 Likes

just got everything setup and it’s working good.

great project!

[WINDOWS_10_VM][2019-06-18 08:23:34 +03:00][INFO][IOTLinkAgent.Agent.WSClient.WebSocketClient]: Waiting 60 seconds before trying again…
[WINDOWS_10_VM][2019-06-18 08:24:34 +03:00][INFO][IOTLinkAgent.Agent.WSClient.WebSocketClient]: Waiting 60 seconds before trying again…
[WINDOWS_10_VM][2019-06-18 08:25:34 +03:00][INFO][IOTLinkAgent.Agent.WSClient.WebSocketClient]: Waiting 60 seconds before trying again…
[WINDOWS_10_VM][2019-06-18 08:26:34 +03:00][INFO][IOTLinkAgent.Agent.WSClient.WebSocketClient]: Waiting 60 seconds before trying again…
[WINDOWS_10_VM][2019-06-18 08:27:34 +03:00][INFO][IOTLinkAgent.Agent.WSClient.WebSocketClient]: Waiting 60 seconds before trying again…
[WINDOWS_10_VM][2019-06-18 08:28:34 +03:00][INFO][IOTLinkAgent.Agent.WSClient.WebSocketClient]: Waiting 60 seconds before trying again…
[WINDOWS_10_VM][2019-06-18 08:29:34 +03:00][INFO][IOTLinkAgent.Agent.WSClient.WebSocketClient]: Waiting 60 seconds before trying again…
[WINDOWS_10_VM][2019-06-18 08:30:34 +03:00][INFO][IOTLinkAgent.Agent.WSClient.WebSocketClient]: Waiting 60 seconds before trying again…
[WINDOWS_10_VM][2019-06-18 08:31:34 +03:00][INFO][IOTLinkAgent.Agent.WSClient.WebSocketClient]: Waiting 60 seconds before trying again…
[WINDOWS_10_VM][2019-06-18 08:32:34 +03:00][INFO][IOTLinkAgent.Agent.WSClient.WebSocketClient]: Waiting 60 seconds before trying again…
[WINDOWS_10_VM][2019-06-18 08:33:34 +03:00][INFO][IOTLinkAgent.Agent.WSClient.WebSocketClient]: Waiting 60 seconds before trying again…
[WINDOWS_10_VM][2019-06-18 08:34:34 +03:00][INFO][IOTLinkAgent.Agent.WSClient.WebSocketClient]: Waiting 60 seconds before trying again…
[WINDOWS_10_VM][2019-06-18 08:35:34 +03:00][INFO][IOTLinkAgent.Agent.WSClient.WebSocketClient]: Waiting 60 seconds before trying again…
[WINDOWS_10_VM][2019-06-18 08:36:34 +03:00][INFO][IOTLinkAgent.Agent.WSClient.WebSocketClient]: Waiting 60 seconds before trying again…
[WINDOWS_10_VM][2019-06-18 08:37:34 +03:00][INFO][IOTLinkAgent.Agent.WSClient.WebSocketClient]: Waiting 60 seconds before trying again…
[WINDOWS_10_VM][2019-06-18 08:38:34 +03:00][INFO][IOTLinkAgent.Agent.WSClient.WebSocketClient]: Waiting 60 seconds before trying again…
[WINDOWS_10_VM][2019-06-18 08:39:34 +03:00][INFO][IOTLinkAgent.Agent.WSClient.WebSocketClient]: Waiting 60 seconds before trying again…

I look at the iot log file and I get the following errors - does that mean that it was connected to mqtt?

@Abeksis

May you try the v1.1.3 version released today? I’ve changed a bit of reconneting code.

Release 1.1.3

  • Fixed MQTT and WebSocket reconnecting handlers causing the server not sending information periodically.

Hello!

Version 1.1.3 solved these connections problems for me.

Give it a try!

1 Like