Is it possible to use the state of an application on a Mac as condition through NodeRed?

Running HASS.io on RPi3 with NodeRed.

I’m wondering if there’s a way for HA to check another desktop workstation on the same network to see if a specific application is running or not, then respond accordingly.

Possible?

I would run a script on the machine with the application that checks “top” with grep and then mqtt to HA or directly with the api.

So, would you have the process run on the mac, then have that workstation fire off a payload to HASS.io?

If so, wouldn’t that require a regular cron job to keep HA up to date like the Polling node in NodeRed?

You could run a python script on the Mac with a cron job every minute if you don’t need instance notification. If you did, you could run a python script to run continuously in the background.

If you have a MQTT server, I would just get the Mac python script to publish something on the mqtt server. I would then get HA to use mqtt trigger in automation or create a mqtt sensor.

or you could use this custom sensor if that is allowed in hass.io.

You can do this if you install NodeRED on your mac also, then use the ps command to find your running process

I like this idea, but hasn’t the configuration of the custom component changed? Shouldn’t the folder be named ssh instead of sensor?

~/.homeassistant/custom_components/ssh/sensor.py