Integration between Moonraker and Home Assistant
- HACS (for installing custom component)
- @thosmasloven's Lovelace Card Mod
- @kalkih's Mini Graph Card
- Sonoff S26 with ESPHome for powering the 3D printer on/off
SSH into your Docker host and navigate to the folder location where you have the Home Assistant /config volume.
Run the command below.
wget -O - https://get.hacs.xyz | bash -
The files will now be downloaded and put into the directory where the Home Assistant volume is mapped.
Restart the docker
sudo docker restart homeassistant
Log in to Home Assistant.
After Home Assistant connects, select Settings, then Devices & Services.
Make a folder in your home assistant directory
In the bottom right, select Add Integration.
Search for HACS and select it.
If you agree with everything, select all options and then Submit.
Copy the code that Home Assistant provides and then select the link to sign into GitHub.
Sign in to GitHub, and then paste in the code from the previous step.
If you’d like to proceed, select Authorize HACS.
HACS is now installed! It’s best to reboot your Docker host at this point.
sudo docker restart homeassistant
After Home Assistant loads back up, HACS will be fully configured and ready to use!
mkdir homeassistant/config/packages
Add packages directory to configuration.yaml
homeassistant:
packages: !include_dir_named packages
Put the moonraker.yaml in
cp moonraker.yaml homeassistant/config/packages/moonraker.yaml
Replace with your 3D Printer IP in the moonraker.yaml file.
sed -i 's/<moonraker-ip-address>/10.0.0.69/g' homeassistant/config/packages/moonraker.yaml
Restart Home Assistant through the WebUI then you should see the entities of your 3D Printer show up.
Click HACS on the left column -> Frontend -> + Explore & Download Repositories
Search at the top for card-mod and mini-graph-card and then install them.
In your configurations.yaml add this for card-mod
frontend:
extra_module_url:
- /community/lovelace-card-mod/card-mod.js
Click Settings -> Devices and Services -> + Add Integration
Type MJPEG IP Camera and click it.
Name: 3d printer camera
MJPEG URL: <moonraker-ip-address>/webcam/?action=stream
Still Image URL: <moonraker-ip-address>/webcam/?action=snapshot
Uncheck Verify SSL certificate.
Click SUBMIT.
If you need to flip your camera uncomment this section in the yaml
# card_mod:
# style: |
# ha-card {
# transition: transform 0s;
# transform: rotate(180deg);
# }
Thumbnail will be added properly now with the grid.yaml paste snippet.
Click Edit Dashboard
Click + Add Card
Scroll to the bottom and click Manual
Paste the yaml content below into the Manual cards.
Grid Card
Showing model preview window with file name, live camera and buttons to stop, FW reset, pause, resume and cancel. Card code
Glance Card (Info and Sonoff Power Plug)
Showing info and button to turn on and off the Sonoff S26 Power Plug. Card code
Gauge Card (printing progress)
Showing currently % of printing progress. Changes color depending on % of progress Code card
Temperature Graph (hotend and bed)
Using mini-graph-card component, to show graph of hotend and bed temp. Code card
This is comprised of all three of these code bases below
- @denkyem's Home Assistant Moonraker
- @SirGoodenough's Home Assistant Moonraker
- @mSarheed's Home Assistant Moonraker
- Added more directions to readme and updated picture.
- Larger quality thumbnails.
- BTT Smart Filament Runout Sensor.
- Chamber Temperature.
- Flipped Webcam.
- Removed synthwave theme.