Announcement

Collapse
No announcement yet.

Jon00 HTML to Image Utility

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

    #31
    Thanks.

    I did wait until you posted again as it has been difficult to see if it was/was not working with your posts yesterday!
    Jon

    Comment


      #32
      Yes; faded fast last night; age thing.

      Testing to see how fast the updates occur on one touchscreen. Working well this morning.

      Looking too to get my weather data graphs in some quick snapshot view. IE: maybe something like a 6, 12, 24, 72 hourly view of outdoor or indoor temps.

      I can "build" the specific granular graphs with MCSTemperature; but its kind of slow so I might try the XAP on demand version. It would be a combo kind of set up utilizing your graphs application for a quickie snapshot with an additional granular snapshot using some specific ranges and time ranges.

      The Chumby's now basically picture frames nestled in just about every "group" of picture frames sprinkled throughout the home; kind of blending in discretely yet HSTouch "functional" on demand.
      Attached Files
      Last edited by Pete; July 11, 2011, 07:37 AM.
      - Pete

      Auto mator
      Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb

      HS4 Pro - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
      HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

      X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

      Comment


        #33
        I am trying to do a screen shot of the RFXWeather.aspx page and grab just the temp/humidity sensor graph.

        Unfortunately because of the oddity of my LAN config with a FIOS router and my Linksys router on DMZ, I trust nothing into HS and force passwords on all requests, including local.

        Up until now, that's not been a problem.

        I want to inject user/pass into the url for localhost:<port>/RFXUSER/RFXWEATHER.aspx and then crop the resulting web page.

        Any ideas / suggestions welcome.
        huggy_d1

        Automating made easy

        Comment


          #34
          I'm not sure I can help.

          Are you saying that on your HS server/PC that every HS page viewed has to include a user & pass in the URL string?
          Jon

          Comment


            #35
            I build my WUN weather cam picture with one radar picture using HTML. I then take the HTML image and embed it into a bigger image.

            Using Jon's new html to image application and the older custom image application you can custom create any kind of image you want.

            I keep the Infocast Chumby 3.5" pretty intact with little bit of mods to it. I use these images with widgets to provide up to date status pages running multiple Chumby widgets; kind of keeping the Chumby 3.5" lite.
            Last edited by Pete; September 16, 2011, 05:50 PM.
            - Pete

            Auto mator
            Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb

            HS4 Pro - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
            HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

            X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

            Comment


              #36
              Jon,

              I am doing a screen grab of the mcsTemperature graphs. Currently testing an external program which uses a command line. The thing with mcsTemperature graphs is that it takes about 20 seconds or so to get the picture to come up and I was getting an error with your program:

              9/16/2011 7:22:12 AM - Jon00_HTML2Image - Error at Webgrab Subroutine Block 1 (A generic error occurred in GDI+.)
              9/16/2011 7:23:13 AM - Jon00_HTML2Image - Error at Webgrab Subroutine Block 1 (A generic error occurred in GDI+.)
              9/16/2011 7:24:23 AM - Jon00_HTML2Image - Error at Webgrab Subroutine Block 1 (A generic error occurred in GDI+.)
              9/16/2011 7:26:24 AM - Jon00_HTML2Image - Error at Webgrab Subroutine Block 1 (A generic error occurred in GDI+.)
              9/16/2011 7:27:34 AM - Jon00_HTML2Image - Error at Webgrab Subroutine Block 1 (A generic error occurred in GDI+.)
              The external mini program can be run from a command line so I can use it with Homeseer. The command line looks like this and includes a "timing mode".
              It shuts down IE after a specified time.

              C:\Progra~1\MiniCap\MiniCap.exe -save "C:\Documents and Settings\Pete\My Documents\WUN\mcstemptrend.jpg" -captureregion 400 500 500 700 -closeapp -exit -sleep 70 -capturerunapp -run "C:\Program Files\Internet Explorer\iexplore.exe" "http://ipofhomeseer/Temperature.asp?Page=trend"
              - Pete

              Auto mator
              Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb

              HS4 Pro - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
              HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

              X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

              Comment


                #37
                Originally posted by Pete View Post
                Jon,

                I am doing a screen grab of the mcsTemperature graphs. Currently testing an external program which uses a command line. The thing with mcsTemperature graphs is that it takes about 20 seconds or so to get the picture to come up and I was getting an error with your program:

                The external mini program can be run from a command line so I can use it with Homeseer. The command line looks like this and includes a "timing mode".
                It shuts down IE after a specified time.
                I'm doing something for traffic capture using google with traffic layer. Here's the command:

                iecapt --url="http://maps.google.com/maps?ll=<mylat>,<mylon>&spn=0.203733,0.527&sll=<mylat>,<mylo n>&sspn=0.203733,0.527&gl=us&vpsrc=6&layer=t&z=12" --out=c:\temp\rva_traffic.png --min-width=1600 --max-wait=5000 --delay=4000
                I found out about the iecapt open source capture utility from these forums and really like that you can set the delay to whatever you want. Some iterating with max-wait and delay gets the data _most_ of the time. If the computer is busy or the network busy, it _may_ take longer. Setting it to 30 seconds might do the job for you.
                huggy_d1

                Automating made easy

                Comment


                  #38
                  Thanks Huggy.

                  The screen grab from mcsTemperature takes up to about 40 seconds some times. Its internal so I have to wait until the application creates the graph; then do the snapshot.

                  Does iecapt just capture part of the screen?

                  Here are the command line options of the program I am using.

                  Last edited by Pete; September 16, 2011, 10:58 AM.
                  - Pete

                  Auto mator
                  Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb

                  HS4 Pro - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
                  HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

                  X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

                  Comment


                    #39
                    Found another thing this morning with Weatherunderground. You can specify data with graphs from your own data; which works even faster; but you have to get the graphs from WUN. Its only one temperature though and not as flexible.

                    Here's all the graphs:



                    Then just one.

                    - Pete

                    Auto mator
                    Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb

                    HS4 Pro - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
                    HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

                    X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

                    Comment


                      #40
                      Pete,

                      I see you have your solution(s) so I'm not going to dwell too much on this. This was originally written to capture Homeseer device strings which it still does :-)

                      I would be interested if you can just try version 1.01 of my utility on a MCS graph.

                      You can now add the following under each [CaptureX] entry:

                      Delay=<numerical value in 1/10 second>

                      i.e.

                      Delay=300

                      Which should delay the grab for 30 seconds.
                      Last edited by jon00; September 23, 2011, 09:47 AM.
                      Jon

                      Comment


                        #41
                        I'm still playing. I like the mcsTemperature graphs the best though.

                        I'll give it a try; it would be better to keep the capture to HS rather than utilize an external application.

                        Testing it see the following in the HS Logs. It is the JPG that's generated when it creates the graph. It changes though after a while.

                        9/16/2011 1:40:11 PM Error Web Server Error 404, cannot serve file: C:\Program Files\HomeSeer 2\html/mcsTemp/mcs192168244234Temp-OUT6.jpg
                        9/16/2011 1:45:13 PM Error Web Server Error 404, cannot serve file: C:\Program Files\HomeSeer 2\html/mcsTemp/mcs192168244234Temp-OUT6.jpg
                        9/16/2011 1:50:11 PM Error Web Server Error 404, cannot serve file: C:\Program Files\HomeSeer 2\html/mcsTemp/mcs192168244234Temp-OUT6.jpg
                        9/16/2011 1:55:11 PM Error Web Server Error 404, cannot serve file: C:\Program Files\HomeSeer 2\html/mcsTemp/mcs192168244234Temp-OUT6.jpg
                        Shouldn't the application though just be saving a snapshot of the screen?

                        The above was at a setting of 600.

                        I changed the setting to 400 and it looks to be maybe working.

                        It is writing the saved HTML image to the directory as specfied in the ini file. But its still doing the HS web server error thing as above.

                        But it doesn't show the web error every time I run it with it set to 400.

                        I do see these though maybe 10-15 minutes after I run the script.

                        9/16/2011 2:52:31 PM Event Event Trigger "MCS Test Snapshot"
                        9/16/2011 2:52:31 PM Event Running script in background: Jon00HTML2Image.vben("Main","1")

                        9/16/2011 3:05:11 PM Error Web Server Error 404, cannot serve file: C:\Program Files\HomeSeer 2\html/mcsTemp/mcs192168244234Temp-OUT6.jpg
                        9/16/2011 3:10:11 PM Error Web Server Error 404, cannot serve file: C:\Program Files\HomeSeer 2\html/mcsTemp/mcs192168244234Temp-OUT6.jpg
                        9/16/2011 3:15:11 PM Error Web Server Error 404, cannot serve file: C:\Program Files\HomeSeer 2\html/mcsTemp/mcs192168244234Temp-OUT6.jpg
                        9/16/2011 3:20:11 PM Error Web Server Error 404, cannot serve file: C:\Program Files\HomeSeer 2\html/mcsTemp/mcs192168244234Temp-OUT6.jpg

                        This is great Jon! Much better than using an external program.
                        Last edited by Pete; September 16, 2011, 05:12 PM.
                        - Pete

                        Auto mator
                        Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb

                        HS4 Pro - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
                        HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

                        X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

                        Comment


                          #42
                          Pete,

                          Can you try 500, run the script once and then wait a minute to see if it appears without error.
                          Jon

                          Comment


                            #43
                            Will do. Been playing. I have the jpg now posted with the Wunderground cam pic.

                            Before change to 500

                            9/16/2011 5:39:11 PM - Event - Running script in background: Jon00HTML2Image.vben("Main","1")
                            9/16/2011 5:40:11 PM - Error - Web Server Error 404, cannot serve file: C:\Program Files\HomeSeer 2\html/mcsTemp/mcs192168244234Temp-OUT6.jpg
                            9/16/2011 5:45:11 PM - Error - Web Server Error 404, cannot serve file: C:\Program Files\HomeSeer 2\html/mcsTemp/mcs192168244234Temp-OUT6.jpg
                            9/16/2011 5:50:12 PM - Error - Web Server Error 404, cannot serve file: C:\Program Files\HomeSeer 2\html/mcsTemp/mcs192168244234Temp-OUT6.jpg




                            [Capture1]
                            URL=http://IPOFHOMESEER/Temperature.asp?Page=trend
                            ImagePath=C:\Program Files\HomeSeer 2\html\Images\wunderground\mcs.jpg
                            Crop=75,430,656,725
                            Delay=500
                            It seems to be only doing it once after the event is triggered rather than 2-3 times as before. I'll let it settle a bit as I have it set to run every 30 minutes or so instead of manually running the event every couple of minutes.

                            9/16/2011 5:58:55 PM Event Running script in background: Jon00HTML2Image.vben("Main","1")
                            9/16/2011 6:00:29 PM Error Web Server Error 404, cannot serve file: C:\Program Files\HomeSeer 2\html/mcsTemp/mcs192168244234Temp-OUT6.jpg
                            9/16/2011 6:00:52 PM Event Event Trigger "MCS Graphs Snapshot"
                            9/16/2011 6:00:52 PM Event Running script in background: Jon00HTML2Image.vben("Main","1")
                            9/16/2011 6:05:11 PM Error Web Server Error 404, cannot serve file: C:\Program Files\HomeSeer 2\html/mcsTemp/mcs192168244234Temp-OUT6.jpg
                            9/16/2011 6:09:11 PM Event Event Trigger "MCS Graphs Snapshot"
                            9/16/2011 6:09:11 PM Event Running script in background: Jon00HTML2Image.vben("Main","1")
                            9/16/2011 6:10:11 PM Error Web Server Error 404, cannot serve file: C:\Program Files\HomeSeer 2\html/mcsTemp/mcs192168244234Temp-OUT6.jpg
                            Its still doing it; I am getting the images fine; even with the errors.

                            9/16/2011 6:39:11 PM - Event - Event Trigger "MCS Graphs Snapshot"
                            9/16/2011 6:39:11 PM - Event - Running script in background: Jon00HTML2Image.vben("Main","1")
                            9/16/2011 6:40:11 PM - Error - Web Server Error 404, cannot serve file: C:\Program Files\HomeSeer 2\html/mcsTemp/mcs192168244234Temp-OUT6.jpg
                            9/16/2011 6:45:11 PM - Error - Web Server Error 404, cannot serve file: C:\Program Files\HomeSeer 2\html/mcsTemp/mcs192168244234Temp-OUT6.jpg
                            9/16/2011 6:50:12 PM - Error - Web Server Error 404, cannot serve file: C:\Program Files\HomeSeer 2\html/mcsTemp/mcs192168244234Temp-OUT6.jpg
                            9/16/2011 6:55:11 PM - Error - Web Server Error 404, cannot serve file: C:\Program Files\HomeSeer 2\html/mcsTemp/mcs192168244234Temp-OUT6.jpg
                            9/16/2011 6:59:08 PM - Error - Web Server Error 404, cannot serve file: C:\Program Files\HomeSeer 2\html/mcsTemp/mcs192168244234Temp-OUT6.jpg
                            9/16/2011 7:00:30 PM - Error - Web Server Error 404, cannot serve file: C:\Program Files\HomeSeer 2\html/mcsTemp/mcs192168244234Temp-OUT6.jpg
                            9/16/2011 7:00:32 PM - Error - Web Server Error 404, cannot serve file: C:\Program Files\HomeSeer 2\html/mcsTemp/mcs192168244234Temp-OUT6.jpg
                            9/16/2011 7:01:18 PM - Error - Web Server Error 404, cannot serve file: C:\Program Files\HomeSeer 2\html/mcsTemp/mcs192168244234Temp-OUT6.jpg
                            Last edited by Pete; September 16, 2011, 07:04 PM.
                            - Pete

                            Auto mator
                            Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb

                            HS4 Pro - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
                            HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

                            X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

                            Comment


                              #44
                              Pete,

                              It is strange that the captured page does not have images missing?

                              Can you find out what image this is?

                              If you load the graph normally, can you find it on the page?

                              ...or how about just trying to load it by entering the following in your browser:

                              http://IPOFHOMESEER/mcsTemp/mcs19216...4Temp-OUT6.jpg
                              Jon

                              Comment


                                #45
                                Here are some snapshots. If I load the page and look at the source; it shows that same link as the image. If I load the link as mentioned above while I have the page open it will just show the graph. If I close the page then open the link I can get to the graph; so it remains. Just checked (and I didn't remember if I had done so or not) the directory and it is in the directory. I've attached a picture. I had set it to grab the graph every 15 minutes last night. I checked the log this morning and it would show the error 4 times with every graph grab.

                                The HTML in the directory reads:

                                <HTML><HEAD><SCRIPT LANGUAGE='JavaScript'>function initialize() {setTimeout('restore()',60000);}function restore() {document.chart.submit();}</script></HEAD><BODY onload='initialize()'><form name='chart' action='/Temperature.asp' method='post'><input type='hidden' name='chart' value='redraw'><input type='hidden' name='Group' value='Temp-OUT'><input type = 'hidden' name='PriorGroup' value = 'Temp-OUT'><input type='hidden' name='EndDate' value='now'><input type='hidden' name='GraphStyle' value='All'><input type='hidden' name='Period' value='72Hour'></form><img src='/mcsTemp/mcs192168244234Temp-OUT6.jpg'></BODY></HTML>
                                Attached Files
                                Last edited by Pete; September 17, 2011, 08:18 AM.
                                - Pete

                                Auto mator
                                Homeseer 3 Pro - 3.0.0.548 (Linux) - Ubuntu 18.04/W7e 64 bit Intel Haswell CPU 16Gb

                                HS4 Pro - Ubuntu 22.04 / Lenova Tiny M900 / 32Gb Ram
                                HSTouch on Intel tabletop tablets (Jogglers) - Asus AIO - Windows 11

                                X10, UPB, Zigbee, ZWave and Wifi MQTT automation-Tasmota-Espurna. OmniPro 2, Russound zoned audio, Alexa, Cheaper RFID, W800 and Home Assistant

                                Comment

                                Working...
                                X