Snapmaker 2.0 and Home Assistant

Did you know that it’s possible to discover your Snapmaker 2.0 in your LAN? Just send an UDP discover Broadcast to Port 20054 and your Snapmaker will reply with his IP-Address, Model-Name and Status.

Update 19.01.2024: This project got some reactions, see here: HomeAssistant-Forum and here: Snapmaker-Forum
Meanwhile I created a new Script V2 which gets more Information from the Web-API, this makes the information below obsolete.
-> See new code on github
Maybe I will try to write a HomeAssistant Integration someday….

With this function, I inform my Home Assistant about the state of my Snapmaker. Home Assistant sends me a push-message if the 3D-Print, Laser-Cut or CNC is finished.
Because I only need this information, it’s not necessary to login, get info and logout to the Snapmaker.
Maybe I will write another script in future to read other values like process, temperatures, enclosure state etc.

Here is an example of my webhook-sensors in templates.yaml: (For more details see this Link)

# Snapmaker JSON Webhook
- trigger:
    - platform: webhook
      webhook_id: wh-snapmakera350
        - POST
        - PUT
      local_only: true
    - name: "Snapmaker State"
      state: "{{ trigger.json.state }}"
    - name: "Snapmaker IP"
      state: "{{ trigger.json.ip }}"
    - name: "Snapmaker Model"
      state: "{{ trigger.json.model }}"

Then download the code on github and edit the python-script to your needs.
Run it in a cronjob, I do that on a separate raspberry-pi for example every 5min.

To notify me, this is my automation:

That’s my quick and dirty solution.

Some printscreens of the HA-Dashboard:

I hope this will help you to get at least some information from your Snapmaker to Home Assistant. I still hope that we can get more information in future from an usable Snapmaker-API 😉

4 thoughts on “Snapmaker 2.0 and Home Assistant

  1. Hi Stefan
    Ich bin HomeAssistant Neuling ebenfalls aus der Schweiz 🙂 und probiere jetzt seit bald zwei Stunden den Snapmaker zu integrieren.. Habe es aber bis jetzt noch nicht geschafft, dass ich die Sensoren sehe und wenn ich das Python Script (direkt in HA) triggern will erhalte ich immer einen unknown error.
    Hast du evtl. Zeit mir das mal zu erklären? Wenn ja, schreib mich gerne mal per Mail an.
    Danke und Gruss Raphael

Leave a Reply