Announcement

Collapse
No announcement yet.

Jon00 OctoPrint (3D Printer Interface) For HomeSeer 3

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Jon00 OctoPrint (3D Printer Interface) For HomeSeer 3


    Octoprint is a free, open-source program to control and monitor a 3D printer via its web interface. Normally run on a Raspberry Pi, it has a built-in API which provides access to a number of metrics about the 3D printer. This script polls the API to update a number of virtual devices which can be used to trigger events.

    Example uses:

    » Switch off the 3D printer when the print has been completed.
    » Switch off the 3D printer if the nozzle or bed temperatures exceed pre-set limits.
    » Switch on the 3D printer/ventilation systems etc when a GCode file is uploaded to Octoprint.
    » Automatically change ventilation methods etc using the GCode filenames.
    » Send emails/Push messages detailing progress/pause/completion etc.

    Images from the Webcam is supported (if installed).

    Basic control of the printer is also provided.


    Click image for larger version

Name:	Octoprint.png
Views:	470
Size:	205.8 KB
ID:	1291385

    As always, it is available from my site (click on my banner below).

    Any problems, please post here.
    Jon


    #2
    Jon00,

    I got an issue with this script, it result in all de3vices created and some are filled with data, but some are not and the following entry in my log;
    Jon00_Octoprint Error at Main Block 30 Arithmetic operation resulted in an overflow.
    mrt-13 14:21:56 Jon00_Octoprint Error at Main Block 29 Arithmetic operation resulted in an overflow.
    I Also see 1000% instead of 100% probably a regional settings issue?


    Regards

    Bart
    Regards Bart
    ------------------------------------------
    Win7 64Bit on Intel NUCI7 with SSD
    HSPRO 3.
    Devices; 1370 Events; 691

    Jon00 Scripts, JowHue, HSTouch, Plugwise, Z-wave, Ultranetatmo, Ultracam, PHlocation, BLUSBUIRT, MeiHarmony, Buienradar, MEiUnifi Pushover 3P, Random, Nest HSPhone and Blueiris

    Visonic Powermax Alarm System (HS3) Interface: http://www.domoticaforum.eu/viewtopic.php?f=68&t=11129

    Comment


      #3
      The error points to a time format issue.

      The script should populate an additional ini file (Jon00OctoprintData.ini) with all the data. Would you post that please.
      Jon

      Comment


        #4
        Originally posted by jon00 View Post
        The error points to a time format issue.

        The script should populate an additional ini file (Jon00OctoprintData.ini) with all the data. Would you post that please.
        Hi Jon00,

        Hereby the ini file:

        Code:
        [Value]
        SD_Ready=1
        PrinterState_Flags_Cancelling=0
        PrinterState_Flags_ClosedOrError=0
        PrinterState_Flags_Error=0
        PrinterState_Flags_Finishing=0
        PrinterState_Flags_Operational=1
        PrinterState_Flags_Paused=0
        PrinterState_Flags_Pausing=0
        PrinterState_Flags_Printing=1
        PrinterState_Flags_Ready=0
        PrinterState_Flags_Resuming=0
        PrinterState_Flags_SDReady=1
        PrinterState_Text=1
        Temperature_Bed_Actual=2506
        Temperature_Bed_Offset=0
        Temperature_Bed_Target=250
        Temperature_Tool0_Actual=20031
        Temperature_Tool0_Offset=0
        Temperature_Tool0_Target=2000
        Temperature_Tool1_Actual=-1
        Temperature_Tool1_Offset=-1
        Temperature_Tool1_Target=-1
        Job_AveragePrintTime=-1
        Job_EstimatedPrintTime=20491147587530282
        Job_Filament_Tool0_Length=32368431919999,235
        Job_Filament_Tool0_Volume=0
        Job_Filament_Tool1_Length=-1
        Job_Filament_Tool1_Volume=-1
        Job_File_Name=0
        Job_File_Origin=0
        Job_File_Date=1552487818
        Job_File_Size=27636374
        Job_File_Path=0
        Job_File_Display=0
        Progress_FilePos=4399027
        Progress_Completion=1591752593882251
        Progress_PrintTime=6878
        Progress_PrintTimeLeft=20772
        Progress_PrintTimeLeftOrigin=1
        [String]
        SD_Ready=true
        PrinterState_Flags_Cancelling=false
        PrinterState_Flags_ClosedOrError=false
        PrinterState_Flags_Error=false
        PrinterState_Flags_Finishing=false
        PrinterState_Flags_Operational=true
        PrinterState_Flags_Paused=false
        PrinterState_Flags_Pausing=false
        PrinterState_Flags_Printing=true
        PrinterState_Flags_Ready=false
        PrinterState_Flags_Resuming=false
        PrinterState_Flags_SDReady=true
        Temperature_Bed_Actual=25.06
        Temperature_Bed_Offset=0
        Temperature_Bed_Target=25.0
        Temperature_Tool0_Actual=200.31
        Temperature_Tool0_Offset=0
        Temperature_Tool0_Target=200.0
        Temperature_Tool1_Actual=N/A
        Temperature_Tool1_Offset=N/A
        Temperature_Tool1_Target=N/A
        Job_AveragePrintTime=N/A
        Job_EstimatedPrintTime=20491.147587530282
        Job_Filament_Tool0_Length=32368.431919999235
        Job_Filament_Tool0_Volume=0.0
        Job_Filament_Tool1_Length=N/A
        Job_Filament_Tool1_Volume=N/A
        Job_File_Name=AI3M_V10planter_bodys_(Zwart).gcode
        Job_File_Origin=local
        Job_File_Date=1552487818
        Job_File_Size=27636374
        Job_File_Path=AI3M_V10planter_bodys_(Zwart).gcode
        Job_File_Display=AI3M_V10planter_bodys (Zwart).gcode
        Progress_FilePos=4399027
        Progress_Completion=15.91752593882251
        Progress_PrintTime=6878
        Progress_PrintTimeLeft=20772
        Progress_PrintTimeLeftOrigin=mixed-analysis
        PrinterState_Text=Printing
        [Updated]
        Time=13-3-2019 17:30:22

        for example at this moment its printing, and gives a completion of 1591752593882251% but it should be 15.91752593882251, so i guess there is also an issue with regional settings, which are dutch. decimal is (,)
        Regards Bart
        ------------------------------------------
        Win7 64Bit on Intel NUCI7 with SSD
        HSPRO 3.
        Devices; 1370 Events; 691

        Jon00 Scripts, JowHue, HSTouch, Plugwise, Z-wave, Ultranetatmo, Ultracam, PHlocation, BLUSBUIRT, MeiHarmony, Buienradar, MEiUnifi Pushover 3P, Random, Nest HSPhone and Blueiris

        Visonic Powermax Alarm System (HS3) Interface: http://www.domoticaforum.eu/viewtopic.php?f=68&t=11129

        Comment


          #5
          Thanks. It looks like Octoprint is not respecting regional settings via its API hence the . for decimal values. I'll PM a new version which replaces it with your regional character to see if that helps.
          Jon

          Comment


            #6
            Thanks, that did the trick!

            great support as always
            Regards Bart
            ------------------------------------------
            Win7 64Bit on Intel NUCI7 with SSD
            HSPRO 3.
            Devices; 1370 Events; 691

            Jon00 Scripts, JowHue, HSTouch, Plugwise, Z-wave, Ultranetatmo, Ultracam, PHlocation, BLUSBUIRT, MeiHarmony, Buienradar, MEiUnifi Pushover 3P, Random, Nest HSPhone and Blueiris

            Visonic Powermax Alarm System (HS3) Interface: http://www.domoticaforum.eu/viewtopic.php?f=68&t=11129

            Comment


              #7
              Good to hear!

              V1.0.1 is now posted on my site.
              Jon

              Comment


                #8
                Will this plug-in work for multiple Printers?
                RJ_Make On YouTube

                Comment


                  #9
                  Yes, it will support multiple instances of Octoprint running.
                  Jon

                  Comment


                    #10
                    Any chance we could get configuration options for the webcam? I'm getting the following log error

                    Jon00_Octoprint Webcam: ERROR: The remote server returned an error: (404) Not Found

                    Most likely as I'm running Octoprint on Windows 10 with my webcam on a non-standard port. Octoprint is aware of the webcam config and is displaying it fine, BTW.

                    .

                    Comment


                      #11
                      Under [Settings] add:

                      WebCamPort =XX

                      where XX is the Camera port number.
                      Jon

                      Comment


                        #12
                        Thanks for the prompt response. In retrospect, the port must be right otherwise there wouldn't be a 404 error in the log, as that implies it reached the server successfully. The webcam is using http://192.168.x.x:8000/camera/jpeg as the snapshot URL, is that what the script is looking for? Can we specify the URL?

                        Comment


                          #13
                          You cannot specify the entire address as I linked it to the WebAddress entry in the ini file.

                          If that is the same then you can add this also under [Settings]:

                          WebCamURL=/camera/jpeg
                          Jon

                          Comment


                            #14
                            Jon, sorry for the back and forth. The Webcam is running on the same host as Octoprint, so that's OK.
                            The Octoprint log shows the original URL request, which wasn't valid in my case as I suspected.

                            409 GET /api/printer (192.168.x.x) 4.00ms
                            WARNING - 404 GET /webcam/?action=snapshot:8000 (192.168.x.x) 3.00ms

                            I added the exact config line you stated and now the HS3 log says:

                            Webcam: ERROR: The given path's format is not supported.

                            And no hits to the Octoprint log.

                            Comment


                              #15
                              I don't believe the port number should be part of the URL.

                              See if this works:

                              WebCamPort =8000
                              WebCamURL=/webcam/?action=snapshot
                              Jon

                              Comment

                              Working...
                              X