Is it possible to run Powershell commands with a variable made in Node-Red/Home Assistant?
I have a input_select that has options for filenames. Is it possible to have that filename be sent into a message payload and have HASS agent receive it and launch a powershell process with the matching file on the computer?
Solution:Jump to solution
Ya, commands/custom commands can "accept" parameters sent with the action (if I'm not mistaken configuring an empty one and then sending the absolute path to script as action payload should just launch it)
Although I must put it out there: from the security perspective that's not desirable :P...
4 Replies
It should be, Ive never done it personally. I can try it out in a couple hours, @Amadeo may know
Solution
Ya, commands/custom commands can "accept" parameters sent with the action (if I'm not mistaken configuring an empty one and then sending the absolute path to script as action payload should just launch it)
Although I must put it out there: from the security perspective that's not desirable :P
Interesting. Is there a more secure alternative? Would enabling ssl help?
I mean, the main point to secure would be MQTT broker itself and all devices that can send MQTT messages - since after configuring HASS.Agent to execute all it receives for specific command, every device that has connection to MQTT could execute technically "anything" on your pc