IOT Link - Windows Management using MQTT

Wish I could help further but it looks like you need to continue down the standard troubleshooting steps. Remove as much peripheral hardware and disable as much memory resident software as possible till you find the culprit. Also make sure you have updated your hardware drivers and maybe even your bios.

Beyond that, I have nothing else to recommend. Good luck.

Little late to the game but see this post

Hello everyone! I started this week in the world of smart home and discovered this amazing home assistance tool and when creating a dashboard I found this Iotlink solution to restart / shutdown computers, but I confess that I read this topic from start to finish in 2 days and I couldn’t put it to work. the connection of the home assistant to the windows pc running iotlink.
I confess that I don’t know anything about programming, the only thing I did on windows was to install Iotlink and change the configuration.yaml

my configuration.yaml

and log of iotlink:

[WORKGROUP\DESKTOP-4D3NER9][2021-04-14 14:59:46 -03:00][INFO][IOTLink.IOTLinkService]: Windows Service is started.
[WORKGROUP\DESKTOP-4D3NER9][2021-04-14 14:59:46 -03:00][INFO][IOTLinkService.Service.MQTT.MQTTClientManager]: MQTTClientManager::Stop() - Finishing MQTT
[WORKGROUP\DESKTOP-4D3NER9][2021-04-14 14:59:46 -03:00][INFO][IOTLinkService.Service.MQTT.MQTTClientManager]: MQTTClientManager::Start() - Initilizing MQTT
[WORKGROUP\DESKTOP-4D3NER9][2021-04-14 14:59:46 -03:00][INFO][IOTLinkService.Service.MQTT.MQTTClient]: MQTTClient::Connect() - Trying to connect to broker: tcp://192.168.1.137:1883.
[WORKGROUP\DESKTOP-4D3NER9][2021-04-14 14:59:46 -03:00][SYSTEM][IOTLinkService.Service.MQTT.MQTTClient]: ALL YOUR MQTT TOPICS WILL START WITH iotlink/workgroup/desktop-4d3ner9/
[WORKGROUP\DESKTOP-4D3NER9][2021-04-14 14:59:47 -03:00][INFO][IOTLinkService.Service.MQTT.MQTTClient]: MQTTClient::OnDisconnectedHandler() - MQTT Disconnected
[WORKGROUP\DESKTOP-4D3NER9][2021-04-14 14:59:47 -03:00][INFO][IOTLinkAddon.Service.CommandsService]: Addon Commands has subscribed to topic commands/shutdown (Accepts Global: True)
[WORKGROUP\DESKTOP-4D3NER9][2021-04-14 14:59:47 -03:00][INFO][IOTLinkAddon.Service.CommandsService]: Addon Commands has subscribed to topic commands/reboot (Accepts Global: True)
[WORKGROUP\DESKTOP-4D3NER9][2021-04-14 14:59:47 -03:00][INFO][IOTLinkAddon.Service.CommandsService]: Addon Commands has subscribed to topic commands/logoff (Accepts Global: True)
[WORKGROUP\DESKTOP-4D3NER9][2021-04-14 14:59:47 -03:00][INFO][IOTLinkAddon.Service.CommandsService]: Addon Commands has subscribed to topic commands/lock (Accepts Global: True)
[WORKGROUP\DESKTOP-4D3NER9][2021-04-14 14:59:47 -03:00][INFO][IOTLinkAddon.Service.CommandsService]: Addon Commands has subscribed to topic commands/hibernate (Accepts Global: True)
[WORKGROUP\DESKTOP-4D3NER9][2021-04-14 14:59:47 -03:00][INFO][IOTLinkAddon.Service.CommandsService]: Addon Commands has subscribed to topic commands/suspend (Accepts Global: True)
[WORKGROUP\DESKTOP-4D3NER9][2021-04-14 14:59:47 -03:00][INFO][IOTLinkAddon.Service.CommandsService]: Addon Commands has subscribed to topic commands/run (Accepts Global: True)
[WORKGROUP\DESKTOP-4D3NER9][2021-04-14 14:59:47 -03:00][INFO][IOTLinkAddon.Service.CommandsService]: Addon Commands has subscribed to topic commands/displays/on (Accepts Global: True)
[WORKGROUP\DESKTOP-4D3NER9][2021-04-14 14:59:47 -03:00][INFO][IOTLinkAddon.Service.CommandsService]: Addon Commands has subscribed to topic commands/displays/off (Accepts Global: True)
[WORKGROUP\DESKTOP-4D3NER9][2021-04-14 14:59:47 -03:00][INFO][IOTLinkAddon.Service.CommandsService]: Addon Commands has subscribed to topic commands/notify (Accepts Global: True)
[WORKGROUP\DESKTOP-4D3NER9][2021-04-14 14:59:47 -03:00][INFO][IOTLinkAddon.Service.CommandsService]: Addon Commands has subscribed to topic commands/send-keys (Accepts Global: True)
[WORKGROUP\DESKTOP-4D3NER9][2021-04-14 14:59:47 -03:00][INFO][IOTLinkAddon.Service.CommandsService]: Addon Commands has subscribed to topic commands/media/playpause (Accepts Global: True)
[WORKGROUP\DESKTOP-4D3NER9][2021-04-14 14:59:47 -03:00][INFO][IOTLinkAddon.Service.CommandsService]: Addon Commands has subscribed to topic commands/media/stop (Accepts Global: True)
[WORKGROUP\DESKTOP-4D3NER9][2021-04-14 14:59:47 -03:00][INFO][IOTLinkAddon.Service.CommandsService]: Addon Commands has subscribed to topic commands/media/next (Accepts Global: True)
[WORKGROUP\DESKTOP-4D3NER9][2021-04-14 14:59:47 -03:00][INFO][IOTLinkAddon.Service.CommandsService]: Addon Commands has subscribed to topic commands/media/previous (Accepts Global: True)
[WORKGROUP\DESKTOP-4D3NER9][2021-04-14 14:59:47 -03:00][INFO][IOTLinkService.Service.Engine.ServiceAddonManager]: Loading addon: commands
[WORKGROUP\DESKTOP-4D3NER9][2021-04-14 14:59:57 -03:00][INFO][IOTLinkService.Service.MQTT.MQTTClient]: MQTTClient::OnDisconnectedHandler() - MQTT Disconnected
[WORKGROUP\DESKTOP-4D3NER9][2021-04-14 14:59:57 -03:00][ERROR][IOTLinkService.Service.MQTT.MQTTClientManager]

if anyone can help me I thank you very much! the sensors even work on the dashboard, if I put a cpu card it works normally, but what I need most is the function to restart / shutdown the pc remotely and it doesn’t work.

I have a script in Home Assistant to reboot my PC. It’s as follows (OSPREY is the name of my PC):

script:
  osprey_reboot:
    alias: "OSPREY - Reboot"
    sequence:
      - service: mqtt.publish
        data:
          topic: "iotlink/workgroup/osprey/commands/reboot"
          payload: ""

Hope that helps. Also, here is the link to all the commands.

Hi. I’m new into Home Assistant, because I want to use the IOT Link MQTTT solution to start a program from a Windows 10 pc into my local network. I try to get the MQTTT solution running, but i have no idea what I’m doing. :laughing: What I’ve done so far:

  1. Installing Home Assistant on my Synology NAS.
  2. Installing IOT Link on the Windows 10 machine I want to control / get information from.
  3. Tried to configurate the “configuration file” like:
    Configuration · Wiki · IOT Link / IOT Link Service · GitLab
########################################################################
# IOT Link - Engine Configuration File
########################################################################
# See https://gitlab.com/iotlink/iotlink/wikis/Configuration for details
########################################################################
mqtt:
  ########################################################################
  # Credentials Settings
  ########################################################################
  credentials:
    username: User
    password: Test123
  ########################################################################
  # TCP Connection Settings
  ########################################################################
  tcp:
    enabled: true
    hostname: 192.168.188.75 #my windows 10 machine i want to control
    port: 1883
    secure: false
    tlsConfig:
        allowUntrustedCertificates: false
        ignoreCertificateChainErrors: false
        ignoreCertificateRevocationErrors: false
        caCertificate:
        clientCertificate:
        clientCertificatePassword:
  ########################################################################
  # WebSocket Connection Settings
  ########################################################################
  websocket:
    enabled: false
    uri: 
    secure: false
    tlsConfig:
        allowUntrustedCertificates: false
        ignoreCertificateChainErrors: false
        ignoreCertificateRevocationErrors: false
        caCertificate:
        clientCertificate:
        clientCertificatePassword:
  ########################################################################
  # Message Settings
  ########################################################################
  messages:
    qos: 1
    retain: false
  ########################################################################
  # LWT Message Settings
  ########################################################################
  lwt:
    enabled: true
    qos: 1
    retain: true
    connectMsg: "ON"
    disconnectMsg: "OFF"
  ########################################################################
  # Discovery Settings
  ########################################################################
  discovery:
    enabled: true
    topicPrefix: homeassistant
    domainPrefix: false
  ########################################################################
  # General MQTT Settings
  ########################################################################
  clientId: INTEL-NUC #my windows 10 machine i want to control
  prefix: IOTLink
  globalPrefix: IOTLink/all
  cleanSession: true
  autoReconnectDelay: 10
  keepAlivePeriod: 60
  maxPendingMessages: 100

########################################################################
# Logging Configuration
########################################################################
logging:
  enabled: true
  ########################################################################
  # Level
  ########################################################################
  # Define the level of logging information that will be stored on logs.
  ########################################################################
  # 0 (Disabled)
  # 1 (Critical), 2 (Error), 3 (Warning)
  # 4 (Info), 5 (Verbose), 6 (Debug)
  # 7 (Debug Within Loops), 8 (Trace)
  # 9 (Trace Within Loops), 10 (Data Dumping)
  ########################################################################
  # Type: Integer
  # Default: 4 (Info)
  ########################################################################
  level: 4

########################################################################
# General Addon Configuration
########################################################################
addons:
  enabled: true
  1. Home Assistant → Configuration → Add Integration → MQTTT:
Server: 192.168.188.75
Port: 1883
User: User
Password: Test123

Checkbox "Enable Discovery" -> activated.
  1. Home Assistant tries to connect, but it can’t get a connection! :upside_down_face:

Is my “workflow” correct? Thank you very much!

Greeting!

Your config file is wrong. Your tcp settings should have the IP address of your MQTT server. Not the PC you want to control.

Ok, thank you. Stupid question: Is Home Assisant my MQTT Server or do I need a third application?

Thanks!

You need to set up your own MQTT broker/server. The Addon Store (Supervisor > Add-on Store) has Mosquitto Broker which is an open source MQTT server. Should be easer to setup. I use the same software but manually set it up years ago.

1 Like

Thank you very much! I’ve installed Mosquitto as a standalone docker container, because the menu item “Supervisior” isn’t available in the Home Assistant docker installation on Synology. (Even if there are some workarounds how to add this for the Synology users.)

:+1:t3:

1 Like

The only thing that keeps the pc in constant sleep/hibernate mode is disabling all these 3 check boxes, but we need these boxes to be checked in order to wake the pc.

Finally figured why my pc will not stay asleep or hibernate after telling it to sleep or hibernate. It is the NIC card. The above gave me a clue to swap out for another. Now, it goes to sleep and I can wake it with the IOT Link add-on. A bit of a disappointment with the faulty NIC card since it had 3 port usb built-in.

Hi there,

I’m using iotlink at the moment and I’ve managed to set my audio to play for a certain application, on a certain device.
For example to have only spotify to play on my headphones.

As iotlink doesn’t support a lot of audio controll, I was looking into getting the audio volume of my workstation. At the moment I was trying tho achieve this by running a command.
Only I can’t seem to get a return value for this command?

Is this possible?
This is what I use to controll the audio playback

    - service: mqtt.publish
      data:
        topic: "iotlink/workgroup/ws-s01/commands/run"
        payload: '{ "command": "C:\\xxx\\ToolsIT\\SoundVolumeView.exe", "args": "/SetAppDefault \"NVIDIA High Definition Audio\\Device\\DELL U2515H\\Render\" 0 \"chrome.exe\"", "path": "C:\\xxx\\ToolsIT\\", "user": "",  "visible": false, "fallback": true }'

C:\\xxx\\ToolsIT\\SoundVolumeView.exe /GetPercent "NVIDIA High Definition Audio\Device\DELL U2515H\Render"

This is what I’d like to use to retreive the audio level from a certain device, or the overall volume.

Thanks
Pieter

Hi,

I have some erros while loading ProcessMonitor and WindowsMonitor addons:

[ERROR][IOTLinkService.Service.Engine.ServiceAddonManager]: Error while loading addon ProcessMonitor: System.Runtime.InteropServices.COMException (0xC0000BBF): Exception de HRESULT : 0xC0000BBF
   à System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
   à System.Management.ManagementEventWatcher.Start()
   à IOTLinkAPI.Platform.Windows.ProcessEventManager.Init()
   à IOTLinkAPI.Platform.Windows.ProcessEventManager.GetInstance()
   à IOTLinkAddon.Service.ProcessMonitorService.SetupEventMonitor()
   à IOTLinkAddon.Service.ProcessMonitorService.Init(IAddonManager addonManager)
   à IOTLinkService.Service.Engine.ServiceAddonManager.LoadExternalAddons()
[STUDIO-DYNAMIX\ORDICAT][2021-04-20 18:44:52 +02:00][ERROR][IOTLinkAddon.Service.WindowsMonitorService]: WindowsMonitorService::InitMonitors() - Error while trying to initilize CPU: Impossible de charger les données de nom de compteur, car un index non valide '' a été lu à partir du Registre.
[STUDIO-DYNAMIX\ORDICAT][2021-04-20 18:44:53 +02:00][ERROR][IOTLinkAddon.Service.WindowsMonitorService]: WindowsMonitorService::InitMonitors() - Error while trying to initilize Uptime: Impossible de charger les données de nom de compteur, car un index non valide '' a été lu à partir du Registre.
[STUDIO-DYNAMIX\ORDICAT][2021-04-20 18:44:53 +02:00][INFO][IOTLinkAddon.Service.WindowsMonitorService]: WindowsMonitorService::SetupTimers() - System monitor is activated.
[STUDIO-DYNAMIX\ORDICAT][2021-04-20 18:44:53 +02:00][ERROR][IOTLinkService.Service.Engine.ServiceAddonManager]: Error while loading addon WindowsMonitor: System.NullReferenceException: La référence d'objet n'est pas définie à une instance d'un objet.
   à IOTLinkAddon.Service.Monitors.CPUMonitor.GetMonitorItems(Configuration config, Int32 interval)
   à IOTLinkAddon.Service.WindowsMonitorService.SetupDiscovery()
   à IOTLinkService.Service.Engine.ServiceAddonManager.LoadExternalAddons()
[STUDIO-DYNAMIX\ORDICAT][2021-04-20 18:44:54 +02:00][ERROR][IOTLinkAddon.Service.WindowsMonitorService]: WindowsMonitorService::ExecuteMonitor(CPU) - Error: System.NullReferenceException: La référence d'objet n'est pas définie à une instance d'un objet.
   à IOTLinkAddon.Service.Monitors.CPUMonitor.GetMonitorItems(Configuration config, Int32 interval)
   à IOTLinkAddon.Service.WindowsMonitorService.ExecuteMonitor(IMonitor monitor)
[STUDIO-DYNAMIX\ORDICAT][2021-04-20 18:44:54 +02:00][ERROR][IOTLinkAddon.Service.WindowsMonitorService]: WindowsMonitorService::ExecuteMonitor(Uptime) - Error: System.NullReferenceException: La référence d'objet n'est pas définie à une instance d'un objet.

Addon command is OK and works fine!

Any idea, please?

@Mister-Espria anyone figured a workaround for the CPU reads that are different from Task Manager reads?

I would like to run chrome in incognito. Anyone knows the command for it?

  my_computer_run_chrome:
    alias: "My Computer - Run Chrome"
    sequence:
      - service: mqtt.publish
        data:
          topic: "iotlink/workgroup/my-computer/commands/run"
          payload: '{ "command": "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe", "args": "https://iotlink.gitlab.io", "path": "C:\\Program Files (x86)\\Google\\Chrome\\Application", "user": "", "visible": true, "fallback": true }'

I can’t get this to work. Log says something about disabling tcp and web sockets.

https://jpst.it/2vr-Y

And some other errors.

My home assistant seems to detect something connecting based on the logs. Idrk what I’m doing with this. How do I disable it and will that fix the unhandled exception it’s saying there is? Thank you.

Paste your config settings

Hi all
Is there an easy way to deactivate the IOTLink service through HA? Sometimes I need to see the messages in HAs Mqtt and since I have 4 laptops connected to HA right now almost the only messages I see is from IOTLink.
thanks

I’m using IOT link on a laptop and my primary server (separate form HA server). It has a UPS attached, but IOT link does not recognize a battery attached even though Windows does (NoSystemBattery). Anyone else have this problem?

Don’t have a clue why but I can’t even get the installer to open on Windows 10, admin or no admin. Anyone know why? Haven’t had any success getting a response from @alexslx with previous issues so posting here! :slight_smile:

Hi @alexslx

I have just installed IOT link and its amazing thanks !

I was wondering if there is a way to enable me to login into my windows machine by first waking my windows 10 machine and then inputting my password. There is only one user so selecting users shouldn’t be a problem.

Is that possible?

Thanks.