IOT Link - Windows Management using MQTT

I’m pretty sure I did, but I guess complete reinstall is the only next option if there’s nothing else to try. Thanks for trying.

Is ist Possible to get CPU Temperature and GPU Temp?

Greetz

@kalyway101 one extra thing I implemented today. I was getting a little annoyed by the command prompt window that would pop up every time I logged in showing the service starting and stopping.

I already had a small program called nircmd that I use to change my window sound device settings and only just realized it could execute batch files in the background. I now have my scheduled task execute something like this:

nircmd exec hide “c:\myPath\myFile.bat”

Now the service restarts out of sight. Small fix but it helps with my ocd :wink:

1 Like

Guys can Someone Help me?
I got Iot Link Running and everything works well, but i try to start a Programm with Node Red what do i need to send to the Topic when i wanne start for example Notepad located on c:/program/notepad.exe

I tryed a lot but i always Fail everything else works great (sending keys , monitoring…)

Thx in advance

@Chrisss, I created the following script and tested. It worked fine for me.

mypc_notepad_test:
  alias: "Open Notepad"
  sequence:
    - service: mqtt.publish
      data:
        topic: "iotlink/workgroup/mypc/commands/run"
        payload: '{ "command": "C:\\windows\\notepad.exe", "path": "C:\\windows", "user": "", "visible": true, "fallback": true }'

I don’t have NR configured at the moment but it should be fairly simple to translate into a flow.
Keep in mind that when notepad opened for me it did not open to the forefront. It was in the background and I had to click on the instance in the taskbar.

1 Like

would you mind sharing your bat file? I want to reset the service once a day, because sometimes the HDD info unavailable, and the only way to get it back is to restart the service.

See this post and the discussion that followed for the Scheduled Task details.

hi I have the latest version of iotlink and it works perfectly, but I noticed that from some version, the binary sensors “binary_sensor.pc_name_media_playing” disappeared
how do i rehabilitate it?

Hello, first of all thanks for all the work developed!
I just installed it and all the sensors work well, however no script works.

I was careful to change the name of my pc in the scrips. I put all the scripts in the home assistant configuration.yaml file.

Here is an example of the script used:

  my_computer_suspend:
    alias: "AndrePC - Suspend"
    sequence:
      - service: mqtt.publish
        data:
          topic: "iotlink/workgroup/AndrePC/commands/suspend"
          payload: ""

I’ve read the whole topic trying to find a solution and I couldn’t, I’ve tried in the name of the PC to use only uppercase or lowercase letters but it doesn’t work anyway.

Thanks

Are there any errors in your logs when you run the script?

Also, I believe the pc name should be all lower case. Look at the name shown in your sensors for the correct pc name.

This add-on is awesome! I recently added it to include my PC in Office Area occupancy so Magic Areas doesn’t turn my office lights off (particularly in the wee hours) but I just added an automation that wakes up my screen when office motion is detected!

alias: Office - Motion
description: ''
trigger:
  - platform: state
    entity_id: binary_sensor.office_motion
    to: 'on'
    from: 'off'
condition: []
action:
  - service: mqtt.publish
    data:
      topic: iotlink/brunt/brunt-win10/commands/displays/on
      payload: ''
mode: single

sorry for the delay, after all it already works very well, I couldn’t understand the initial problem, I went to sleep and the next day it worked :smile:

Anybody know how to run a command using a global topic? I’m a bit confused as here in the write up it says the global topic defaults to
iotlink/all
but if I send a message there; no response

      - service: mqtt.publish
        data:
          topic: "iotlinkft/mshome/righttill/commands/run"
          retain: false
          payload: "{ \"command\": \"notifu.exe\", \"args\": \"/m \\\"Door not unlocked \\\" /p Alert\", \"user\": \"\", \"visible\": true, \"fallback\": true }"

that works

but

topic: "iotlinkft/homeassistant/commands/run"

doesn’t

topic: "homeassistant/commands/run"

doesn’t

topic: "iotlinkft/iotlink/all/commands/run"

doesn’t

topic: "iotlink/all/commands/run"

doesn’t

iotlinkft/all/commands/run

doesn’t

in the config right at the bottom it says

########################################################################
# General Addon Configuration
########################################################################
addons:
  enabled: true
  globalTopics:
    - homeassistant/#

so am most confused!

thanks guys

EDIT

Just looked at the log (stripped out the timestamp to make it more readable)

[MSHOME\RIGHTTILL][INFO][IOTLinkAddon.Service.CommandsService]: Addon Commands has subscribed to topic commands/shutdown
[MSHOME\RIGHTTILL][INFO][IOTLinkAddon.Service.CommandsService]: Addon Commands has subscribed to topic commands/reboot
[MSHOME\RIGHTTILL][INFO][IOTLinkAddon.Service.CommandsService]: Addon Commands has subscribed to topic commands/logoff
[MSHOME\RIGHTTILL][INFO][IOTLinkAddon.Service.CommandsService]: Addon Commands has subscribed to topic commands/lock
[MSHOME\RIGHTTILL][INFO][IOTLinkAddon.Service.CommandsService]: Addon Commands has subscribed to topic commands/hibernate
[MSHOME\RIGHTTILL][INFO][IOTLinkAddon.Service.CommandsService]: Addon Commands has subscribed to topic commands/suspend
[MSHOME\RIGHTTILL][INFO][IOTLinkAddon.Service.CommandsService]: Addon Commands has subscribed to topic commands/run
[MSHOME\RIGHTTILL][INFO][IOTLinkAddon.Service.CommandsService]: Addon Commands has subscribed to topic commands/displays/on
[MSHOME\RIGHTTILL][INFO][IOTLinkAddon.Service.CommandsService]: Addon Commands has subscribed to topic commands/displays/off
[MSHOME\RIGHTTILL][INFO][IOTLinkAddon.Service.CommandsService]: Addon Commands has subscribed to topic commands/volume/set
[MSHOME\RIGHTTILL][INFO][IOTLinkAddon.Service.CommandsService]: Addon Commands has subscribed to topic commands/volume/mute
[MSHOME\RIGHTTILL][INFO][IOTLinkAddon.Service.CommandsService]: Addon Commands has subscribed to topic commands/notify
[MSHOME\RIGHTTILL][INFO][IOTLinkAddon.Service.CommandsService]: Addon Commands has subscribed to topic commands/send-keys
[MSHOME\RIGHTTILL][INFO][IOTLinkAddon.Service.CommandsService]: Addon Commands has subscribed to topic commands/media/playpause
[MSHOME\RIGHTTILL][INFO][IOTLinkAddon.Service.CommandsService]: Addon Commands has subscribed to topic commands/media/stop
[MSHOME\RIGHTTILL][INFO][IOTLinkAddon.Service.CommandsService]: Addon Commands has subscribed to topic commands/media/next
[MSHOME\RIGHTTILL][INFO][IOTLinkService.Service.Engine.ServiceAddonManager]: Addon Commands has subscribed to topic commands/media/previous
[MSHOME\RIGHTTILL][INFO][IOTLinkService.Service.Engine.ServiceAddonManager]: Loading addon: commands
[MSHOME\RIGHTTILL][SYSTEM][IOTLinkService.Service.Engine.MQTT.MQTTClient]: ALL YOUR MQTT TOPICS WILL START WITH iotlinkft/mshome/righttill/

there’s no mention of “accepts global” like in this chap’s post?

Are there any alternatives for iot link? I want to be able to turn off my screen or computer thru ha. But it’s not often iot link works. It’s very random

Does your pc ever go to sleep after a certain time of inactivity?
If so, look through my posts on this topic. The IOTLink service does not always survive after resuming. You would need to restart the service.

The next time it fails, take a look at your IOTlink entities. If they say “unknown” or “unavailable” then you are probably experiencing this issue.

Yes pc goes to sleep! Ok thx!

Hi Alex,
Could you please to tell me, which retain should be enable to make it’s work?
Till now every time I restarted HA I have to restart IOTLink services on each machine…

@alexslx
Dear Alex,
I have an issue that seems to be mentioned in the final release:

Release Notes:

  • Fixed LWT not sending causing sensors to display as unavailable.

I cannot check whether my computer is on or off because it is sometimes unavailable, which is making the sensor useless. Is there a quick solution how to overcome this problem? I went through the discussion here and found that I am not the only one, however, nobody found a solution or a cause you would be able to debug. Thanks.

If you suspend/sleep you pc then you will have this issue and you would need to restart the IOT service. Look through my posts in this thread for the workaround. Hopefully the author can find the time to fix this issue eventually…but till then, restarting the service is all we have.

1 Like

hi…

I took it upon myself to try and fix the issues with suspend/hibernate/resume with regards to the MQTT connection being lost.

Now it should correctly disconnect the MQTT connection when sleeping/hibernating.
It also shuts down any agents/addons running
LWT should be OFF and all entities are now unavailable

and vice versa when resuming.
MQTT will reconnect
addons will restart.
LWT should be ON and all entities are available

try it out here…

http://www.mediafire.com/file/5tc5hx4bzh83akp/IOTLinkService_suspend_resume_try1.rar/file

extract the files and overwrite the original ones.

regards
gibman