IOT Link - Windows Management using MQTT

I used all the steps provided, but i can’t get it to work i have the entities available in home assistant bet they are all unavailable




Yes you can, navigate to “C:\ProgramData\IOTLink\Addons\WindowsMonitor” folder and edit the cofig .yaml, you can set the below to false their then disabled

monitors:
  CPU:
    enabled: false
    interval: 10
    cacheable: true
  Memory:
    enabled: true
    interval: 10
    cacheable: true
  HardDrive:
    enabled: true
    interval: 10
    cacheable: true
  Power:
    enabled: false
    interval: 10
    cacheable: true
  NetworkInfo:
    enabled: true
    interval: 10
    cacheable: true
  CurrentUser:
    enabled: true
    interval: 10
    cacheable: true
  IdleTime:
    enabled: true
    interval: 10
    cacheable: true
  Display-Info:
    enabled: true
    interval: 60
    cacheable: true
  Display-Screenshot:
    enabled: true
    interval: 60
    cacheable: true
1 Like

You dont have any credetials in the MQTT broker section, you created the sensors corectly in HA but your PC cant comunicate with your HA if the broker isnt setup,

Have you setup your MQTT broker?

If not you can do this via the Hassio Panel, install “Mosquitto broker”, then setup a user name and password, you then use these details in the IOT configuration file.

you also have to enable MQTT via the configuration

image
image
image
You’ll then get this message which is correct
image

That’s because I don’t have a password set for my mqtt broker, if I look in the addon log I see it connected with iotlink on my Lenovo laptop

Hi All,

Im trying to use IOTlink to determine wether the display has been turned off due to inactivtiy (windows is set to deactivate the display after 10 mins). But because its an HTPC and hooked up to a TV it doenst actually turn off the TV.

I want to be able to detect when the screen is turned off so I can actually shutdown all the TV/Receiver through my Harmony.

I tried to use the idle-timer sensor for this, but that one also starts counting when we’re just watching a video.

Has anybody found a solution for this?

Can you double check your workgroup setting, is your home workgroup called “workgroup”?

I had this on my second pc, I had to also set my client id in the “IOT” config file the same as my PC host name,

have you seen this message? in your log file

Topic subscribed?

Does your PC always stay on?

If not script the pc shutdown via RPV shutdown addon, then when the pc is off the script also turns off you TV boxes,

yes i have exactly the samen message in my logs

Thanks @Fally! I obviously must have missed that.

@r3mcos3

You can use the MQTT Explorer and restart the service while it is open so you can see all messages your broker has been received.

@PlatoNL

Not possible to detect screen is off actually, I didn’t found any API for this. Also idletime uses an API from Windows which doesn’t care about media playing…

If I get any updates about it, I’ll post here.

@All

I’m holding a new release for a long time because I had introduce a bug which causes big memory consumption. As soon as I resolve this bug, I’ll release a new version already reported bugs and a few more sensors.

1 Like

I will start from scratch tomorrow, and keep this in mind. thnx for the response :ok_hand:

got it working now, not all entities are available but i got something

some entities are unknown instead off unavailable?

Did you get this working? Also having trouble here with the notifications…

Nope, I have all of the sensors and the other commands working but not the notifications.

Hi Alex,

Thanks for looking into it. Too bad there isn’t an API for that.

Does anyone here have notifications working?

Hey,

IOT Link v1.3.0 has been released (https://iotlink.gitlab.io).

Release Notes:

  • NEW! Commands: Send Keys.
  • NEW! Commands: Media Control - Play/Pause/Next/Previous.
  • NEW! Windows Monitor: Media (Volume, Muted, Playing) Sensor.
  • NEW! Windows Monitor: Uptime Sensor.
  • Fixing more NullReferenceException errors.
  • Modified turn on monitor method to simulate a click input (works for Windows Tablets also).

IMPORTANT:

  • CPU sensor has been moved to stats/cpu/usage instead of stats/cpu
  • Current user has been moved to stats/system/current-user instead of stats/current-user
  • Idle time has been moved to stats/system/idle-time instead of stats/idle-time

I suggest everyone keeping IOTLink up to date as I’m always fixing some bugs and making improvements. Also check the Wiki documentation for examples.

@PlatoNL and @Fally
You may work with the new stats/media/playing sensor to see if there is any audio playing.

Regards,

1 Like

Installed v1.3.0 and all sensor and commands works great except for the ‘notify’ command. This latest release has not fixed it. It does work when called from HA using

    action:
      - service: mqtt.publish
        data:
          topic: "iotlink/workgroup/dds-asus/commands/notify"
          payload: '{ "title": "IOT Notify", "message": "Office Motion", "launchParams": "toast://open/https://iotlink.gitlab.io" }'

or similarily when called using MQTT Explorer in Windows 10.
Any ideas?

Hi @fantangelo

I just tested exactly with your code and it worked fine (MQTT Explorer).

Maybe you should verify your windows settings, specially the “do not disturb” settings. Also, always check the logs for errors.

Regards,

I checked the Windows Notifications settings and everything looks good except that the IOTlink app does not show as one of the Senders apps. Should it?
Do Not Disturb is not set and I receive other notifications including WinThing which is what I now use for HA to Windows notifications but would prefer to switch to IOTlink.
Here is a snipped of my log:

[WORKGROUP\DDS-ASUS][2019-08-06 07:30:06 -04:00][DEBUG][IOTLinkService.Service.Engine.ServiceMain]: MQTT Message Received
[WORKGROUP\DDS-ASUS][2019-08-06 07:30:06 -04:00][VERBOSE][IOTLinkAddon.Service.CommandsService]: OnVolumeSet: Message received
[WORKGROUP\DDS-ASUS][2019-08-06 07:30:06 -04:00][DEBUG][IOTLinkAddon.Service.CommandsService]: OnVolumeSet: Volume set to 11
[WORKGROUP\DDS-ASUS][2019-08-06 07:30:06 -04:00][DEBUG][IOTLinkService.Service.Engine.ServiceMain]: MQTT Message Received
[WORKGROUP\DDS-ASUS][2019-08-06 07:30:06 -04:00][VERBOSE][IOTLinkAddon.Service.CommandsService]: OnNotifyMessage: Message received
[WORKGROUP\DDS-ASUS][2019-08-06 07:30:06 -04:00][VERBOSE][IOTLinkService.Service.WebSockets.Server.WebSocketServerManager]: Sending message to clients

The volume set command works but the notify does not.
thanks