Calling HASS API from Various Shells

While working on making my macro pad trigger Home Assistant automations, I found the API would be the easiest way to integrate the systems. Here’s some of my experimenting with the API and how to call it from Linux curl and PowerShell Invoke-WebRequest

Linux Curl

Using the Linux curl command is pretty straight forward.

curl -X POST http://hass.local:8123/api/services/switch/toggle -H 'Authorization: Bearer ABCDEF' -d '{"entity_id": "switch.testsubject_test_subject"}'

PowerShell Invoke-WebRequest

PowerShell is a bit more annoying to get everything right, as Invoke-WebRequest is a bit pickier on its input arguments.

Invoke-WebRequest -Method POST -Uri "http://hass.local:8123/api/services/switch/toggle" -H @{"Authorization"="Bearer ABCDEF"} -Body '{"entity_id": "switch.testsubject_test_subject"}'

Apparently windows has a build of the official Unix curl and tar commands, but my PowerShell prompts all had curl as an alias to Invoke-WebRequest. I did find that if i call curl.exe, it would run the official curl command.

Conclusion

Do be careful when copying and pasting between shells, I found that copying out of the PowerShell prompt and back in would yield an invalid token. This was also encountered in the WSL terminal as well.

The API is pretty straight forward after a little bit of trying things out. The documentation covers the capability but doesn’t have as many examples as I would have liked otherwise.

Resources

WLED Automation for Roku in Home Assistant

I was able to get WLED going on a light strip but I do have a lack of ideas on how to make use of it. I finally decided to go with the tried and true movie lighting. So my goal is to setup automations so that when my Roku begins playing something, the WLED strip dims and sets to a specific color (we’ll go with red), and when I pause or stop playing, it will turn to max brightness white light. This will give lower lighting while watching and brighter lights if something is paused (and I have to go get something). I’m still not entirely sure if I will end up making use of this in the end, but it will give me some ideas on what I can do and how to do it.

Continue reading “WLED Automation for Roku in Home Assistant”

NextCloud File Lock Error in Joplin

I encountered a problem recently on the Joplin desktop app where it couldn’t synchronize due to a file lock being stuck in NextCloud. It uses a file in the jopline data directories to determine sync status and lock status on files being edited, and this file was stuck locked in NextCloud with no way to delete it. I performed some searching, finding some blog posts on the subject and found this on how to solve it. I’ll be going through the manual solution to this problem and updating the process with my experience.

Continue reading “NextCloud File Lock Error in Joplin”

Ortur Laser Master 2 Air Assist

While the Ortur Laser Master 2 that I picked up is advertised as a laser engraver and not a laser cutter, it can do lightweight cutting and I was intent and optimizing that capability. After performing some research, I found that air assist would be a great modification to aid in this endeavor.

The air assist system was built with 1 main goal in mind, to make cutting with the laser more efficient. This will also reduce sooting and scorching by putting out fires while cutting.

Continue reading “Ortur Laser Master 2 Air Assist”

Ortur Laser Master 2 Enclosure

The Ortur laser is completely open air, providing no assistance or infrastructure to vent the fumes away. I decided to work on an enclosure for these reasons. The enclosure has 2 main goals, to contain excess laser light from the room and to contain fumes from the laser so they can be exhausted. The exhaust could be a fan in the back of the box or using a vacuum table underneath the laser. In my case, I’ll be building a vacuum table to hold materials and exhaust fumes.

admin

Ortur Laser Master 2 Software – LightBurn

One thing needed with every CNC driven machine is good software to control it and generate the gcode. There are two main options for the Ortur Laser Master 2. These are LaserGRBL and LightBurn. The Ortur uses LaserGRBL as the main control software out of the box while LightBurn is a commercial offering that costs $40. This article will be going through the LightBurn setup while I went through LaserGRBL in the past.

Continue reading “Ortur Laser Master 2 Software – LightBurn”

Ortur Laser Master 2 Software – LaserGRBL

One thing needed with every CNC driven machine is good software to control it and generate the gcode. There are two main options for the Ortur Laser Master 2. These are LaserGRBL and LightBurn. The Ortur uses LaserGRBL as the main control software out of the box while LightBurn is a commercial offering that costs $40. This article will be going through the LaserGRBL setup while I’ll be doing one in the future going through the LightBurn setup.

Continue reading “Ortur Laser Master 2 Software – LaserGRBL”

Focusing the Diode Laser on an Ortur Laser Master 2

Focusing the laser is just as important if not more important than leveling the bed of a 3d printer. A well focused laser will have tighter cuts, will engrave and cut faster and will have higher quality engravings. Getting the laser to a good focus point however can be difficult, and there are a few tricks to getting things to work smoothly.

admin

Laser Safety Glasses

Various Laser Safety Glasses

I recently picked up an Ortur Laser Master 2 engraver and cutter. With the new hardware to join my 3d printer in making things, comes new safety gear to use things with minimal risk (and prevent myself from going blind). I ended up going on an adventure to get the right safety equipment. My wife and I both wanted to work with the laser, so we both needed safety glasses.

Continue reading “Laser Safety Glasses”