This is a very interesting pull request that was just completed into main (not in a release yet but will be in 4.0.2). It would allow for some interesting abilities like sending commands or getting data from home assistant or other APIs.
Well, that was fun. I setup Home Assistant on Docker, built that latest main of FluidNC and put it on my Eggbot. I tied Home Assistant to Alexa, created a webhook, and after resolving some firewall issues, I can now run this gcode command which gets Alexa to say “Alexa says hello to FluidNC!”.
$HTTP/Command=@alexa_speak_start
I have a file on flash called http_settings.json which contains:
{
"tokens": {
"ha_url": "192.168.0.145:8123",
"ha_token": "[token from Home Assistant goes here]"
},
"commands": {
"alexa_speak_start": "http://${ha_url}/api/webhook/fluidnc-alexa-speak{\"method\":\"POST\",\"headers\":{\"Authorization\":\"${ha_token}\",\"Content-Type\":\"application/json\"},\"body\":\"{\\\"message\\\":\\\"Alexa says Hello to FluidNC!\\\"}\"}"
}
}
Umm, you could do a lot of crazy things with this.
With the WebDAV changes, you could also do stuff like create a custom interface, upload say test.html.gz to flash, and go to http://fluidnc.local/flash/test.html and get to that interface while still keeping the WebUI. Before, you could only download the file if you went to http://fluidnc.local/test.html, it wouldn’t render in the browser. That opens up some things too.
Hopefully Fluidnc 4 with stabilize soon. It would be nice to be able to send a gcode file from MillMage or Lightburn to the SD card using WebDAV. I remember the MillMage guys mentioning it a while back on Discord.
FluidNC v4.0.2 was just released. I’ll be testing this one as I believe it may be stable now. (If you’re relatively new, don’t try it yet until we’ve done some testing.)
Yay! That was my PR. I’m glad people find it interesting! I have been using it to start the air assist/ventilation/water pump on my laser cutter through HA. It has startup commands (with pauses) in the header and shutdown commands in the footer. One less thing for me to mess up while cutting!