IOT Link - Windows Management using MQTT

Well, I’m on the latest version, service is set to restart on failure, but simply is unreliable. I have 63 mqtt devices (tasmota etc…) that work reliable over mqtt, so it is not a mqtt issue. Latest Windows 10 version, with patches applied upto may 2020. Not on 2004 yet however.

I already am running my own MQTT server. Assuming it’s running at 192.168.1.99 username/password, how can I configure IOT link to use that server and not create its own MQTT server?

I don’t think IOTLink creates it’s own mqtt server. In the configuration you have to specify your (own) server.

Maybe someone could tell me if IOTLink can accomplish what I need. I’d like to be able to use IFTTT to send a MQTT message and have that “caught” by IOTLink, and for that to run a powershell script based upon the MQTT message.

To control volume I’m using an input number entity and an automation:

input_number:
  pc_volume:
    name: PC Volume
    initial: 100
    min: 0
    max: 100
    step: 1
    unit_of_measurement: "%"
  - alias: 'PC Volume Control'
    trigger:
      - platform: state
        entity_id: input_number.pc_volume
    action:
      - service: mqtt.publish
        data:
          topic: "iotlink/workgroup/XXXXXX/commands/volume/set"
          payload_template: "{{ states('input_number.pc_volume') }}"
          
1 Like

@alexslx

I now upgraded iot to the latest version and the volume set and volume mute stopped working, set keys and run are still working just fine

any ideas?

@ido_1, @alexslx
Yes, same for me. I guess the problem is to have multiple sound outputs and switching them. Maybe sleep/wake the pc is also a factor?

Is it also possible to add dedicated volume up / volume down as commands? I tried a workaround with the send-keys command: ‘["^{ESC}",“sndvol.exe”,"{ENTER}","{UP}","{ENTER}"]’ but it doesn’t work reliably.

When it is working, it is working. When not (like today), I get endless messages in the log like this :

[WORKGROUP\DESKTOP-DESTINY][2020-06-06 13:25:41 +02:00][INFO][IOTLinkService.Service.MQTT.MQTTClient]: MQTTClient::OnConnectedHandler() - MQTT Connected
[WORKGROUP\DESKTOP-DESTINY][2020-06-06 13:25:41 +02:00][WARNING][MQTTnet.Client.Connecting.MqttClientConnectedHandlerDelegate]: MQTTClient::OnConnectedHandler() - MQTT Connected handler received without being connected.
[WORKGROUP\DESKTOP-DESTINY][2020-06-06 13:25:42 +02:00][INFO][IOTLinkService.Service.MQTT.MQTTClient]: MQTTClient::OnConnectedHandler() - MQTT Connected
[WORKGROUP\DESKTOP-DESTINY][2020-06-06 13:25:42 +02:00][WARNING][MQTTnet.Client.Connecting.MqttClientConnectedHandlerDelegate]: MQTTClient::OnConnectedHandler() - MQTT Connected handler received without being connected.
[WORKGROUP\DESKTOP-DESTINY][2020-06-06 13:25:42 +02:00][INFO][IOTLinkService.Service.MQTT.MQTTClient]: MQTTClient::OnConnectedHandler() - MQTT Connected
[WORKGROUP\DESKTOP-DESTINY][2020-06-06 13:25:42 +02:00][WARNING][MQTTnet.Client.Connecting.MqttClientConnectedHandlerDelegate]: MQTTClient::OnConnectedHandler() - MQTT Connected handler received without being connected.
[WORKGROUP\DESKTOP-DESTINY][2020-06-06 13:25:43 +02:00][INFO][IOTLinkService.Service.MQTT.MQTTClient]: MQTTClient::OnConnectedHandler() - MQTT Connected
[WORKGROUP\DESKTOP-DESTINY][2020-06-06 13:25:43 +02:00][WARNING][MQTTnet.Client.Connecting.MqttClientConnectedHandlerDelegate]: MQTTClient::OnConnectedHandler() - MQTT Connected handler received without being connected.

Really impressed! Never knew detail like screenshots could be part of a MQTT packet.
Being an MQTT newbie, I have a question on the Entities in HA becoming “unavailable” when the PC goes to sleep or is shutdown. Is this related to LWT? Is there a way to have them show in HA as “off” instead of “unavailable”

None of the volume commands work for me, not mute, not even volume set :frowning: Only media/playpause seems to work

Same here, none of the commands work, no volume or anything. Getting error: “MQTT connected handler received without being connected. “

Tried restarting the service and nothing…

Just installed for first time as i wanted this for volume control, i tried the topic iotlink/workgroup/<pc-name>/commands/audio/volume/set

as per the documentation which didnt work but dropping set from the end did work. Has the path been changed? Interestingly, the log shows command topics its listening for at startup.

go to C:\ProgramData\IOTLink\Addons\WindowsMonitor and look at the config.yaml. Check that AudioInfo is set to enabled: true.

i love this integration but its juts not reliable for me. Sensors go to ‘unavailable’ or freeze their values. if i stop the windows service and start it again then it starts to work for a while before it repeats its behaviour.

My MQTT integration is working flawlessly but the IOTLink connects/disconnects repeatedly all the time - I’m using the same credentials as everything else

1 Like

Hi @alexslx - this is an awesome tool. Just got it all set up and it worked perfectly for setting up a script that can swap my monitor between primary and secondary for inclusion in home theater automations.

However, I’ve got to say that I think the current design of the commands addon is very, very dangerous from a security point of view. Allowing anyone attached to the MQTT broker to execute arbitrary commands, as any user, is a pretty huge attack surface. And due to the way Home Assistant works, this means that every family member with access to Home Assistant has full administrator control over any machine using IOTLink.

One way to address this would be to make the Commands addon support a mode where it can only run pre-defined actions that are defined on the host machine in the addon config. This would prevent anyone from being able to execute arbitrary commands but keep the lion’s share of the capability in place. You’d lose the ability to dynamically build commands based on Hass data, but I think that’d be a small cost for the major security improvement we’d get, even moreso if this was an optional secure mode.

I hope you’ll consider it! And again, excellent job with the app.

1 Like

can you share your monitor method @OverloadUT please?

I have dual monitors and the main one is also hooked up to my xbox. If i want to play xbox i need to:

  1. switch it on (manually/HA)
  2. press monitor buttons to switch from DP to HDMI input.
  3. Tell W10 to only output to 2nd monitor.

Hopefully, your method might allow me to automate this.

Thanks

i tried it, it doesn’t help.
the set volume command is in the commands addon not the monitor.
i hope this will be solved

Uh oh, looks like a memory leak. IOTLink is using 30GB of RAM less than 24 hours after I installed it :frowning:

How do I set this up?

Just haven’t done any MQTT yet and the wiki is a bit confusing for a newbie :slight_smile:

I’m assuming that it shouldn’t be using 30% of my CPU all the time?