Hello - Just curious if anyone know of a way to integrate gSender into HomeAssistant.
I have my 3D printers integrated to where I can monitor the print, time start/stop & duration/time_remaining, as well as image/video capture.
I am still waiting on my AltMill but I know I will want this integrated as well so was curious if anyone has done it or knows if anything like it (integration) even exists.
I found a reference to using Repetier-Server with CNCjs which gSender is a fork, right? Maybe there is some opportunity there…
About all I can do is confirm that gSender is a fork of CNCjs. I’ve only minimal experience with HomeAssistant. I only used it to view a camera for a time and now I’m using ffmpeg for that. I don’t have anything set up beyond being able to view the camera while I’m on my main computer which is one room away from my LongMill.
Appreciate the response. I figured it was a longshot and as technical as I am, I am no programmer.
Happy to at least see another user of HomeAssistant!
Not sure your level of interest or knowledge but I prepared a camera for the AltMill that will take a snapshot image every minute and then create a timelapse of whatever I am milling. I figure I’ll use a current sensor on the AltMill/Spindle to trigger the automation.
The things I would “like” to be able to do is view camera, job name, job duration & ETA (guess start time is ok as well), and then if possible, record the job/costs/date-time, etc similarly as I do with my Bambu Lab X1C.
That is a pretty extensive integration but has totally spoiled me as I can track power, filament costs, time, job name all automatically.
Another option would be if gSender tracked these things and had an API or even export for it. Real-time is best but historical is still good.
I don’t know about exporting yet but the devs somewhat recently added some job tracking and maintenance features to gSender. You can read about it here. I’m not sure what they have in mind next but there is a subtopic for requested features. Maybe they could add the ability to export to a common format like JSON in the future for other programs to parse.
EDIT: On the subject of 3D printers I have a Prusa i3 Mk3S+ with the Multi Material Unit and my step Dad has a Bambu P1S with an AMS. I can see what you mean about being spoiled by the Bambu. I’m not sold on all the cloud stuff but maybe you can use the Bambu without some of it, I’m just used to seeing how he operates the printer with all of it. It seems strange to me, and I may be mistaken, that you grab a model from a website and slice it on your PC and then send it back to the cloud to be streamed to the printer? Like I said the Bambu is not mine, so I may be misunderstanding some things, but sending it back to the cloud seems like adding another fail to point to me. Maybe what you get in return is worth it? I’m not sure, at least for me.
I too was a little displeased with the cloud functions but they to have a LAN-Only way of communicating & controlling is as well. The ‘cloud’ way is pretty slick though. You get or design a model, put it into their slicer and click print - it sends to cloud then to printer and it stores it locally on the printer for serving quickly to be printed.
I have it on a ‘iot’ Vlan just in-case though just like other things that need to phone home - to keep them out of my direct network.
Thanks for the links, I will check them out and see what I may have overlooked.
Okay, the fact that it sends it from the cloud to the printer all at once makes it not so bad. My concern was an internet problem during a long print but that shouldn’t matter if it’s all sent to the printer before it starts.
That’s smart, you don’t need someone hacking your network through your toaster!
I created an application that will connect to gsender and publishes all the events to MQTT. You can run it locally, but made more to run in a docker container. I’m going to be using it to hook into home assistant to turn on/off my dust collection when running a job.
This is how I have my configuration.yml to get some of the values:
mqtt:
sensor:
- name: Gsender Status
unique_id: gsender_status
state_topic: “gsender/status”
- name: Gsender Workflow
unique_id: gsender_workflow_state
state_topic: “gsender/workflow:state”
value_template: “{{ value_json[0] }}”
I have not really visited this topic in it’s original form since before getting my AltMill.
What I ended up doing, at least for now, is using a current sensor (Smart Switch) on the Spindle that an HA Automation monitors and when the amperage exceeds a preset amount, opens the Gate to the AltMill and turns on the Dust Collector (Smart Switch).
I also added a wall-hanger with a switch in it that when I disconnect and hang the 4" hose on it, prevents the automation from firing.
This might be because I don’t want it running for whatever reason or when I have the Laser on (which should not fire anyway since the Spindle won’t be running).
All that said, I would still like to get the information from gSender into HA… something like the Bambu Lab integration that tracks usage and jobs and power - so may soon review what you have done. Thanks!
Has this been working out for you so far?
I have not attempted yet and am still trying to decide my plan of attack.
A part of me kind of wants what I have with my Bambu Labs X1C but it is pretty in-depth (Wolfwithsword’s implementation) and not sure if I am up to it but one feature I’m particular that it has is job history with electrical consumption, name, duration, and a little more.
I already have a camera ported into HA that creates a timelapse and uploads to Discord so that parts that I am missing and would like to have (whether I use them or not) are the above history details, main controls and if possible visualizer.
I’m still working on it. I’ve mounted my dust collector and am working on the dust boot. But testing so far with gsender and home assistant has been working. When I turn on my machine and connect, home assistant picks it up. I’ve run some test code and it shows it as running. I am only using the workflow:state and connected state, but pretty much all the information is there. I am trying to get sending commands through mqtt to work, but I am having issues sending more complex ones that require data, like movements. But information wise, it is all the information that the remote screen uses. I’ve added sample data from my machine to the github repository so you can see what is available. There might be more and some could be different based on your machine. It even sends the file that is loaded, so you could create visualizer. Basically it sounds like you want a pendant inside home assistant. Gsender is based on cncjs, so you could look into pendants for cncjs as examples. It would take some work though. Let me know what you decide to do. I’ll give an update once I get everything hooked up and running.
I was able to get everything hooked up this weekend and I am happy to report that it has worked beautifully. Switch activated and turned on as soon as I hit start and it turned off at the end. Couldn’t be happier with it. I was flattening some thick pieces for a cutting board and needed to take off 6 or 7 mm because it was the end of the board and had corners cut off. So I ran the same job maybe 5 times and it worked great every time.
Are you setting the mosquito server address and the cnc address? Make sure remote access is setup in gsender as well. I have an example docker-compose.yml file in the repository.
Issue was url/uri format. Fixed that and stays running now but no messages in HA so far. Reset gSender, connected (with remote on), loaded a file, jogged the spindle.
Nothing in MQTT or in Portainer logs.
Update - been a while since I have messed with MQTT configuration - seems I wasn’t listening correctly. Now I am seeing the messages.
Thanks - will work on more at another time to decide what I want to do with it.
@darick_c Do you think it matters that I am connected to the SLB_Ext via ethenet? I keep only seeing the same three messages when I listen to gsender/#
I have disconnected/reconnected to the SLB, loaded different files and jogged around but still only the same 3 messages
Message 1730 received on gsender/status at 5:09 AM:
disconnected
QoS: 0 - Retain: false
Message 1729 received on gsender/serialport:list at 5:09 AM:
[[],[{"port":"COM1","manufacturer":"(Standard port types)","inuse":false},{"port":"COM6","manufacturer":"Microsoft","inuse":false},{"port":"COM5","manufacturer":"Microsoft","inuse":false}],[]]
QoS: 0 - Retain: false
Message 1728 received on gsender/startup at 5:09 AM:
[{"loadedControllers":["Grbl","grblHAL"],"baudrates":[],"ports":[],"socketsLength":2}]
QoS: 0 - Retain: false
If you are connected through ethernet, then I would think it should show up when doing a “gsender/serialport:list”. If you access it remotely and open developer tools (F12 should open dev tools), go to the network tab, refresh the page so things start showing up. Then click on the socket filter and then click on the entry that should be showing. You can see what it is sending to connect. I’m not using ethernet, so I wasn’t able to test that connection. But as long as it is working with the remote mode option, we should be able to get it workin.
ok so for starters, I guess I did not understand that I actually had to USE the Remote connection - only that I needed to have it on.
Once I used the Remote Connection to connect to the SLB, the Dev Tools started to populate.
However, still not seeing the same in MQTT/HA