I have successfully connected IoT Link from my host PC to my HA VM via mqtt. I can run scripts in HA to do things on my host like Lock Windows session, etc. However, I’m at a loss how to write an Automation to monitor my PC for when the computer locks, logoff, etc. Ideas?
Those are ‘commands’. I’m wanting to know how to ‘monitor’ for these type of actions that occur on my host PC by other means.
Say I manually log out of my host PC, and I want my desk light to be turned off. I can certainly, manually turn off my light, but I want IoT Link and HA to monitor my host PC for the logoff action and react to it. Can this be accomplished?
I’m not sure the code is correct… That’s my inquiry. This code is from another sensor, but how do I figure out what the payload is, other than trial & error? For the next time… Where do I get the payload from?
Update: Got it working. I edited the below code. Since I didn’t specifically ID the sensor in my Automation, not certain the sensor is actually needed. I’m not certain how they work
Here’s what I have so far… The Automation presumably does not fire, though nothing in the HA logs to indicate failure.
MQTT Explorer shows SessionUnlock for status, so I assume it would say SessionLock when session is locked.
Yeah, I had looked at that page previously, but not sure it’s applicable in this scenario. For example, how do I split up an IoT Link topic that doesn’t reference anything in HA?