Adding Creality K1 Max to HA using Nodered (No root required)

Hello everyone!

I’m a happy camper with my new K1 Max. After years using a Ender 3 I decided to upgrade to continue my 3D life :innocent:

I was looking for a way to bring data from the K1 Max into Home Assistant without having to resort to rooting, monraker of anything of the sort.

Luckly, the K1 Max exposes a websocket whenever it’s on, therefor I used nodered to bring the data to HA.

  • Is it the best way to do it ? => I’m sure it’s not
  • Was it worth the effort compared to rooting the printer? => Couldn’t say, haven’t even attempted to root it
  • Does it work ? => Totally

I’m sure someone that knows python and HA integrations could make something work with the websocket exposed on the K1 … but not me.

What’s working:

  • Several temperature sensors (Nozzle, Case, Bed)
  • Other sensors (layer counts, material length, print progress)
  • Partial fan control (ON/OFF)
  • Light control

If you want to chat about it or need help understanding the mess I made, hit me up!

If there are node-red experts that care to check what I came up and give tips to improve the workflow, let me know. It’s my first time using it in 5 years.

You can get the workflow from here

Cheers
Chris

2 Likes

Additional tips:

You can add the K1 Camera to HA using the MJPEG IP Camera - Home Assistant integration

  • MJPEG URL : http://your_printer_ip:8080/?action=stream
  • Still Image: http://your_printer_ip/downloads/original/current_print_image.png (This will display a still image of the last print you sent to your printer)

Nice dashboard! I wanna know how to bring these sensor infos to my dashboard…

Hey @git-clover !

Sorry been down sick past couple of days and missed your message.

I don’t know how far you are coming from so I’m gonna start with a simple answer and we’ll take it from there.

Using Node-RED’s “sensor” block which comes pre-installed when you add the Node-RED, it basically create a brand new entity on your HA (you need the Node-RED companion too

image

That entity can be used like any other on the dashboard, your creativity takes care of the rest. I didn’t share that part because all dashboards are different and people like to see them their own way

Thanks for sharing! Im real fresh with Home assistant but with a bit of chat GPT help iv managed to get Node red and the Companion app installed, iv input your script and added my printers IP.
I can see the sensors in the node red Integration but they don’t update or allow me to control.
Any pointers on what I could be missing to direct me to getting this running.
Thanks in advance :slight_smile:

Hello @Spellbinder_4 ,

Some values are only updated while printing, so lets start with the simple question, are you printing when checking the sensors in HA?

If you are let’s start with the Node-RED side:

  • Add a debug node behind the Server Listener and make sure you have some output from the printer. Everything relies on that

image

  • If you haven’t used Node-RED before, you can access debug messages on the right of your screen by clicking on

image

Do you get anything on that screen?

:bulb:
I also noticed that the sensors get stuck on my side after a long time of the printer being off (I completely shut the power to the printer when not in use using a connected wll plug). I believe this is caused by Node-RED permanently shutting down the connection to the WS Server after too many attemps at connecting to a server that is off.

I solved that by creating an automation that I can share if you are on the same situation.

Thanks for the help @bouyssic,

Ok so added the debugging node, and started a print. (I hadn’t had a print going before) and nothings coming up, so I’m assuming my printers not connected to begin with.

Dose the below look correct?
Screenshot 2024-12-02 at 8.10.44 pm

Interesting !

What happens if you browse http://192.168.1.110 ? Do you reach an UI with your printer settings and ongoing print ?

When I do it on my side I have something like this (even when no printing):

If you have the same thing, you should have a WS socket working.

How can you check that part ?

When on that page:

  • Open a Developer console. (If you are on Chrome, the shortcut would be CTRL+SHIFT+I)
  • Go to the network tab
  • Refresh the page

If you select the websocket line and click on the message tab, you should see plenty of messages displayed there. These are the messages we are parsing through NodeRed to generate the sensors

1 Like

Yeh when heading to http://192.168.1.110 I get to the Creality Printer UI page.

So Using Google Chrome I couldn’t see anything going on in the network panel. However I’m on a Mac and was able to get to the same place on Safari and can see the mentioned connectors.

Still not having any luck with the node red debugging section either. :frowning:

Thanks

@Spellbinder_4 ,

This means that the WS server is available on your network but your NodeRED is unable to connect to it. This is probably a network related issue, rather than a NodeRED one, but I think I found out why :slight_smile:

The ws socket is available on port 9999, hence your WS node needs to look like this:
image

Sorry I missed that on your first screenshot … :face_exhaling:

Cheers

1 Like

Yep thats done it!! Amazing thank you. Appreciate you spending the time to troubleshoot!
magic-freak

1 Like

Anytime ! That’s what I love from this community. Sharing experience

1 Like

Thank you for sharing this!

It’s much nicer than dealing with a custom integration that may or may not continue to be supported.

1 Like