I finally figured it out! The flow is below. But the key items to making this work is an autohotkey script that has been converted/compiled to a .exe file, and IOTLink app that allows execution of .exe files and more on remote windows computers. I will include a link to the script in .exe format so you will not need autohotkey installed to use it (although i highly recommend learning to use it) just double click it as you would any other app or program. I have also included a link to the IOTLink software. I am sure there is a cleaner way to do this but this works for my purpose. If you have questions don’t hesitate to ask.
Please be patient though I am a bit slow on replies sometimes.
Thanks for everyone’s help!
web page title check script: get_window_title.exe
IOTLink : Download IOTLink
AutoHotkey: Not needed, but recomended
Please Read the ReadMe Comment inside the flow below for Explanation.
I will warn you this is a pretty complicated flow and not for the faint of heart.
The main part that checks for browser pages that are open is the top section in the flow, and using IOTLink to execute the “get_window_title.exe script” the rest is extra so that maybe you can understand the flow and need for it better.
Thanks for everyone’s help!
[{"id":"411b25f1.f3caac","type":"file in","z":"f97d6301.f838e","name":"Movies Pages already active?","filename":"C:\\Scripts\\hamain_nodered\\getpagetitle\\clipboard2.txt","format":"utf8","chunk":false,"sendError":false,"encoding":"none","x":270,"y":200,"wires":[["d0db030f.a2829"]]},{"id":"d977039c.f33ee","type":"debug","z":"f97d6301.f838e","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":370,"y":120,"wires":[]},{"id":"d0db030f.a2829","type":"switch","z":"f97d6301.f838e","name":"","property":"payload","propertyType":"msg","rules":[{"t":"regex","v":"HBO Max","vt":"str","case":true},{"t":"regex","v":"Netflix","vt":"str","case":true},{"t":"regex","v":"Prime Video","vt":"str","case":true},{"t":"else"}],"checkall":"true","repair":false,"outputs":4,"x":435,"y":200,"wires":[["d977039c.f33ee"],["d977039c.f33ee"],["d977039c.f33ee"],["5c4a9371.9fc98c","5d379994.8098c8"]],"l":false},{"id":"5c4a9371.9fc98c","type":"debug","z":"f97d6301.f838e","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":390,"y":260,"wires":[]},{"id":"c893a888.3c69a8","type":"mqtt in","z":"f97d6301.f838e","name":"Mikes Home and Door just Closed - Check if movies links are already open","topic":"presense/mike/house/door-closed","qos":"2","datatype":"auto","broker":"2f23b1c0.527cce","x":55,"y":200,"wires":[["780c29db.d897d8"]],"l":false},{"id":"5d379994.8098c8","type":"mqtt out","z":"f97d6301.f838e","name":"Links are Not Open","topic":"presense/mike/house/links-not-open","qos":"","retain":"","broker":"2f23b1c0.527cce","x":610,"y":220,"wires":[]},{"id":"780c29db.d897d8","type":"delay","z":"f97d6301.f838e","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":115,"y":200,"wires":[["411b25f1.f3caac"]],"l":false},{"id":"aee22f18.04398","type":"comment","z":"f97d6301.f838e","name":"Checks to see if the links are already open on chrome before opening again.","info":"","x":310,"y":20,"wires":[]},{"id":"3e762512.85b3fa","type":"comment","z":"f97d6301.f838e","name":"Path to File is same as Script if looking for script","info":"","x":220,"y":60,"wires":[]},{"id":"27670ed3.042092","type":"comment","z":"f97d6301.f838e","name":"Read Me!!!!","info":"This is the flow that monitors the file that the \"get_window_title.exe\" script writes to. If the page titles written to the switch node are not presently open on screen, an mqtt message is sent to my home assistant node red instance via the \"Links are not open\" node where the main flow resides and uses IOTLink to open my movie.bat file on my TV/PC(movie.bat is just a simple batch file that opens web pages on my TV/PC )\nThis flow must run on a node red instance that is running on the same pc as the file it is monitoring or else the file will not be written and thus cannot be checked. I have tried to write or monitor files across a network with node red with no joy, if you can do this it makes this task much easier.\n\nI use Mqtt here to comunicate between \"Checks if Links are already open on jarvis\" node and the \"Mikes Home and Door just Closed - Check if movies links are already open\" node\nbecause I actually have one instance of node red talking to another that is running on my windows pc. If you do not have multiple instances you can connect all in the same flow without mqtt connection.","x":170,"y":100,"wires":[]},{"id":"74d2afdd.cc5bf","type":"within-time-switch","z":"f97d6301.f838e","name":"Shuts Down Flow 10pm to 8am","positionConfig":"cf4bfd8.c0a73","startTime":"22:00","startTimeType":"entered","startOffset":0,"startOffsetType":"none","startOffsetMultiplier":60000,"endTime":"08:00","endTimeType":"entered","endOffset":0,"endOffsetType":"none","endOffsetMultiplier":60000,"propertyStart":"","propertyStartType":"none","propertyStartCompare":"true","propertyStartThreshold":"","propertyStartThresholdType":"num","startTimeAlt":"","startTimeAltType":"entered","startOffsetAlt":0,"startOffsetAltMultiplier":60,"propertyEnd":"","propertyEndType":"none","propertyEndCompare":"true","propertyEndThreshold":"","propertyEndThresholdType":"num","endTimeAlt":"","endTimeAltType":"entered","endOffsetAlt":0,"endOffsetAltMultiplier":60,"tsCompare":"0","lastMsgOnStartOut":false,"lastMsgOnEndOut":false,"x":320,"y":420,"wires":[[],["c0e3748a.a29d28"]]},{"id":"e17207ce.2702c8","type":"api-call-service","z":"f97d6301.f838e","name":"Living Room Lights","server":"72a49159.6b7bc","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.living_room","data":"","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1341,"y":620,"wires":[[]]},{"id":"64a0f1e2.9b854","type":"api-call-service","z":"f97d6301.f838e","name":"Kitchen Lights","server":"72a49159.6b7bc","version":"1","debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.kitchen","data":"","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1331,"y":680,"wires":[[]]},{"id":"c0e3748a.a29d28","type":"switch","z":"f97d6301.f838e","name":"Mike or Shelby?","property":"topic","propertyType":"msg","rules":[{"t":"cont","v":"device_tracker.mikebt","vt":"str"},{"t":"eq","v":"device_tracker.mikeihere","vt":"str"},{"t":"cont","v":"device_tracker.shelbybt","vt":"str"},{"t":"cont","v":"device_tracker.shelbytile","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":210,"y":720,"wires":[["b6a9c621.a1f4a8"],["b6a9c621.a1f4a8"],["13adf9bf.2bb816"],["13adf9bf.2bb816"]]},{"id":"c19bf4cb.eeab68","type":"api-call-service","z":"f97d6301.f838e","name":"Bedroom Lights","server":"72a49159.6b7bc","version":"1","debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.master_bedroom","data":"","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1330,"y":1040,"wires":[[]]},{"id":"679e2ece.65bdd","type":"ha-wait-until","z":"f97d6301.f838e","name":"Wait Until Door Opens","server":"72a49159.6b7bc","outputs":2,"entityId":"binary_sensor.house_front_door_o_c_2_2","entityIdFilterType":"exact","property":"state","comparator":"is","value":"on","valueType":"str","timeout":"2","timeoutType":"num","timeoutUnits":"minutes","entityLocation":"","entityLocationType":"none","checkCurrentState":false,"blockInputOverrides":true,"x":790,"y":760,"wires":[["4781afac.c68c3"],[]]},{"id":"b6a9c621.a1f4a8","type":"switch","z":"f97d6301.f838e","name":"Where is Mike ?","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"home","vt":"str"},{"t":"eq","v":"not_home","vt":"str"},{"t":"eq","v":"Repair","vt":"str"},{"t":"eq","v":"Acc Shop","vt":"str"},{"t":"eq","v":"Parking Lot","vt":"str"},{"t":"eq","v":"Front Yard","vt":"str"},{"t":"eq","v":"Back Yard","vt":"str"},{"t":"eq","v":"Behind Shops","vt":"str"},{"t":"eq","v":"Impound Yard","vt":"str"},{"t":"eq","v":"West Parking","vt":"str"},{"t":"eq","v":"Trash Pile","vt":"str"}],"checkall":"true","repair":false,"outputs":11,"x":470,"y":640,"wires":[["e399c9d1.f99048","556e4aa.87267b4","2ee2f6f6.6e32ea"],[],[],[],[],[],[],[],[],[],[]]},{"id":"5fb14f1d.aded3","type":"api-call-service","z":"f97d6301.f838e","name":"Living Room Lights","server":"72a49159.6b7bc","version":"1","debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.living_room","data":"","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1340,"y":920,"wires":[[]]},{"id":"e21bdcf.645f12","type":"api-call-service","z":"f97d6301.f838e","name":"Kitchen Lights","server":"72a49159.6b7bc","version":"1","debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.kitchen","data":"","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1330,"y":980,"wires":[[]]},{"id":"556e4aa.87267b4","type":"ha-wait-until","z":"f97d6301.f838e","name":"Wait untill Door Closes","server":"72a49159.6b7bc","outputs":2,"entityId":"binary_sensor.house_front_door_o_c_2_2","entityIdFilterType":"exact","property":"state","comparator":"is","value":"off","valueType":"str","timeout":"5","timeoutType":"num","timeoutUnits":"minutes","entityLocation":"","entityLocationType":"none","checkCurrentState":false,"blockInputOverrides":false,"x":790,"y":560,"wires":[["55bf4567.8a773c"],[]]},{"id":"e399c9d1.f99048","type":"ha-wait-until","z":"f97d6301.f838e","name":"Wait untill Door Opens","server":"72a49159.6b7bc","outputs":2,"entityId":"binary_sensor.house_front_door_o_c_2_2","entityIdFilterType":"exact","property":"state","comparator":"is","value":"on","valueType":"str","timeout":"5","timeoutType":"num","timeoutUnits":"minutes","entityLocation":"","entityLocationType":"none","checkCurrentState":false,"blockInputOverrides":false,"x":790,"y":500,"wires":[["55bf4567.8a773c"],[]]},{"id":"55bf4567.8a773c","type":"throttle","z":"f97d6301.f838e","name":"Allows 1 message in 1 min","throttleType":"time","timeLimit":"60","timeLimitType":"seconds","countLimit":"1","blockSize":0,"locked":false,"x":1050,"y":520,"wires":[["461cb97.e685148","f16e8d92.abc4a","e17207ce.2702c8","64a0f1e2.9b854","3ae07e34.2815e2","e6bf468c.612e88"]]},{"id":"3966dd1f.46ae72","type":"server-state-changed","z":"f97d6301.f838e","name":"Mike","server":"72a49159.6b7bc","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"device_tracker.mikebt","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"x":80,"y":320,"wires":[["74d2afdd.cc5bf"]]},{"id":"1ab562ed.bee47d","type":"server-state-changed","z":"f97d6301.f838e","name":"Shelby","server":"72a49159.6b7bc","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"device_tracker.shelbybt","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"x":80,"y":480,"wires":[["74d2afdd.cc5bf"]]},{"id":"8b338352.35271","type":"ha-wait-until","z":"f97d6301.f838e","name":"Wait untill Door Closes","server":"72a49159.6b7bc","outputs":2,"entityId":"binary_sensor.house_front_door_o_c_2_2","entityIdFilterType":"exact","property":"state","comparator":"is_not","value":"off","valueType":"str","timeout":"2","timeoutType":"num","timeoutUnits":"minutes","entityLocation":"","entityLocationType":"none","checkCurrentState":false,"blockInputOverrides":false,"x":790,"y":820,"wires":[["4781afac.c68c3"],[]]},{"id":"4781afac.c68c3","type":"throttle","z":"f97d6301.f838e","name":"Allows 1 message in 1 min","throttleType":"time","timeLimit":"60","timeLimitType":"seconds","countLimit":"1","blockSize":0,"locked":false,"x":1050,"y":800,"wires":[["5fb14f1d.aded3","e21bdcf.645f12","c19bf4cb.eeab68","6cfec1dd.d8735"]]},{"id":"13adf9bf.2bb816","type":"switch","z":"f97d6301.f838e","name":"Where is Shelby ?","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"home","vt":"str"},{"t":"eq","v":"not_home","vt":"str"},{"t":"eq","v":"Repair","vt":"str"},{"t":"eq","v":"Acc Shop","vt":"str"},{"t":"eq","v":"Parking Lot","vt":"str"},{"t":"eq","v":"Front Yard","vt":"str"},{"t":"eq","v":"Back Yard","vt":"str"},{"t":"eq","v":"Behind Shops","vt":"str"},{"t":"eq","v":"Impound Yard","vt":"str"},{"t":"eq","v":"West Parking","vt":"str"},{"t":"eq","v":"Trash Pile","vt":"str"}],"checkall":"true","repair":false,"outputs":11,"x":480,"y":840,"wires":[["679e2ece.65bdd","8b338352.35271","acbecf24.36feb"],[],[],[],[],[],[],[],[],[],[]]},{"id":"2ee2f6f6.6e32ea","type":"api-call-service","z":"f97d6301.f838e","name":"Unlock Front Door","server":"72a49159.6b7bc","version":1,"debugenabled":false,"service_domain":"light","service":"turn_off","entityId":"light.front_door_lock","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":780,"y":420,"wires":[["e399c9d1.f99048","556e4aa.87267b4"]]},{"id":"acbecf24.36feb","type":"api-call-service","z":"f97d6301.f838e","name":"Unlock Front Door","server":"72a49159.6b7bc","version":"1","debugenabled":false,"service_domain":"light","service":"turn_off","entityId":"light.front_door_lock","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":780,"y":700,"wires":[["679e2ece.65bdd","8b338352.35271"]]},{"id":"6cfec1dd.d8735","type":"api-call-service","z":"f97d6301.f838e","name":"Ceiling Fan -- High","server":"72a49159.6b7bc","version":1,"debugenabled":false,"service_domain":"fan","service":"set_speed","entityId":"fan.living_room","data":"{\"speed\":\"high\"}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1340,"y":1100,"wires":[[]]},{"id":"efac605f.e870d","type":"server-state-changed","z":"f97d6301.f838e","name":"Shelby Tile","server":"72a49159.6b7bc","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"device_tracker.shelbytile","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"x":70,"y":540,"wires":[["74d2afdd.cc5bf"]]},{"id":"444c9f8e.f8b29","type":"server-state-changed","z":"f97d6301.f838e","name":"Mike iHere","server":"72a49159.6b7bc","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"device_tracker.mikeihere","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"x":70,"y":400,"wires":[["74d2afdd.cc5bf"]]},{"id":"dd2fc4ed.c1ade8","type":"mqtt out","z":"f97d6301.f838e","name":"Open Movies.bat on Jarvis","topic":"iotlink/workgroup/jarvis/commands/run","qos":"","retain":"","broker":"dee52ff1.ed3ba","x":1550,"y":380,"wires":[]},{"id":"28cc8764.365478","type":"change","z":"f97d6301.f838e","name":"Json Command","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"command\":\"C:\\\\Users\\\\msaut\\\\OneDrive\\\\1.Automation\\\\Multi Link Batch Files\\\\Movies.bat\",\"args\":\"/AUTO\",\"path\":\"C:\\\\Users\\\\msaut\\\\OneDrive\\\\1.Automation\\\\Multi Link Batch Files\",\"user\":\"\",\"visible\":true,\"fallback\":true}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":1330,"y":380,"wires":[["dd2fc4ed.c1ade8"]]},{"id":"b92d8a99.e43a48","type":"mqtt out","z":"f97d6301.f838e","name":"Open You Tube on Jarvis","topic":"iotlink/workgroup/jarvis/commands/run","qos":"","retain":"","broker":"dee52ff1.ed3ba","x":1540,"y":320,"wires":[]},{"id":"9a7c9e17.a139c","type":"change","z":"f97d6301.f838e","name":"Json Command","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"command\":\"C:\\\\Program Files (x86)\\\\Google\\\\Chrome\\\\Application\\\\chrome.exe\",\"args\":\"https://www.youtube.com/\",\"path\":\"C:\\\\Program Files (x86)\\\\Google\\\\Chrome\\\\Application\",\"user\":\"\",\"visible\":true,\"fallback\":true}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":1330,"y":320,"wires":[["b92d8a99.e43a48"]]},{"id":"3ae07e34.2815e2","type":"api-call-service","z":"f97d6301.f838e","name":"Turn on TV ","server":"72a49159.6b7bc","version":1,"debugenabled":false,"service_domain":"input_boolean","service":"turn_on","entityId":"input_boolean.living_room_tv","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1321,"y":740,"wires":[[]]},{"id":"e6bf468c.612e88","type":"api-call-service","z":"f97d6301.f838e","name":"Ceiling Fan -- Medium","server":"72a49159.6b7bc","version":1,"debugenabled":false,"service_domain":"fan","service":"set_speed","entityId":"fan.living_room","data":"{\"speed\":\"medium\"}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1351,"y":820,"wires":[[]]},{"id":"29ab99ec.bff2e6","type":"mqtt out","z":"f97d6301.f838e","name":"Runs the script on jarvis ","topic":"iotlink/workgroup/jarvis/commands/run","qos":"","retain":"","broker":"dee52ff1.ed3ba","x":1541,"y":480,"wires":[]},{"id":"461cb97.e685148","type":"change","z":"f97d6301.f838e","name":"Json Command","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"command\":\"C:\\\\Scripts\\\\hamain_nodered\\\\getpagetitle\\\\get_window_title.exe\",\"args\":\"C:\\\\Scripts\\\\hamain_nodered\\\\getpagetitle\\\\get_window_title.exe\",\"path\":\"C:\\\\Scripts\\\\hamain_nodered\\\\getpagetitle\",\"user\":\"msaut\",\"visible\":true,\"fallback\":true}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":1331,"y":480,"wires":[["29ab99ec.bff2e6"]]},{"id":"e6cda796.28f868","type":"comment","z":"f97d6301.f838e","name":"This uses iot link to execute an autohotkey script that has been compiled into a .exe on jarvis.","info":"","x":1286,"y":440,"wires":[],"l":false},{"id":"f85d2235.ea219","type":"comment","z":"f97d6301.f838e","name":"That script brings chrome to the front of all windows and checks active page title.","info":"","x":1326,"y":440,"wires":[],"l":false},{"id":"2b04b755.8c7028","type":"comment","z":"f97d6301.f838e","name":"It then writes that page title to a txt file that is monitored by the \"file in\" node for the pesense of reg ex's that match the pages that i am looking for.","info":"","x":1366,"y":440,"wires":[],"l":false},{"id":"f16e8d92.abc4a","type":"mqtt out","z":"f97d6301.f838e","name":"Checks if Links are already open on jarvis","topic":"presense/mike/house/door-closed","qos":"","retain":"","broker":"dee52ff1.ed3ba","x":1411,"y":560,"wires":[]},{"id":"f919d646.ede938","type":"comment","z":"f97d6301.f838e","name":"This go's out to node red on jarvis to check if movies links are already open","info":"","x":1286,"y":520,"wires":[],"l":false},{"id":"bdc4c96b.a968a8","type":"mqtt in","z":"f97d6301.f838e","name":"Movie Links are Not Open","topic":"presense/mike/house/links-not-open","qos":"2","datatype":"auto","broker":"dee52ff1.ed3ba","x":1185,"y":360,"wires":[["9a7c9e17.a139c","28cc8764.365478"]],"l":false},{"id":"2f23b1c0.527cce","type":"mqtt-broker","name":"","broker":"192.168.1.232","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"72a49159.6b7bc","type":"server","name":"HA Main","legacy":false,"addon":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":false,"cacheJson":true},{"id":"dee52ff1.ed3ba","type":"mqtt-broker","name":"Mosquitto-ha","broker":"192.168.1.232","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]