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.

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 sensors with webhook: (For more details see this Link)

# Snapmaker JSON Webhook
- trigger:
    - platform: webhook
      webhook_id: wh-snapmakera350
      allowed_methods:
        - POST
        - PUT
      local_only: true
  sensor:
    - 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.

That’s my quick and dirty solution, and this is my dashboard if the Snapmaker is off, and below if it’s on but not running:

One thought on “Snapmaker 2.0 and Home Assistant

Leave a Reply