Announcement

Collapse
No announcement yet.

Jon00 DataScraper/JSON Parser Script For Homeseer 3 and Homeseer 4

Collapse
This topic is closed.
X
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Hi Jon,

    Thankyou so much for your help, I genuinely appreciate it. I will have to try and find another way around it. Although I don't need the full functionality of Octoprint, I may grab a Raspberry Pi and try out your Octoprint plugin as that would then allow me to see printer status and drive announcements etc on the Sonos system when the printer pauses or completes etc. I can just use it to monitor the printer rather than control it or provide video functionality. I wonder if a basic Raspberry Pi Zero would manage just that functionality?

    Once again, thankyou for your support and for everything that you do for all of us!

    I've sent you a beer on PayPal !

    Have a great evening and take care,

    Jay

    Comment


      Many thanks. Probably better to go for a normal RPi IMO.
      Jon

      Comment


        Finally getting around to fixing this. Is is possible to have data scraper go one level deeper and retrieve the image from the linked page? I am planning to extract the picture from each news story in the BBS RSS feed. I also want to capture the body of the story so I can display this. Currently I am using the link to display the web page - but the page is very busy and slow on my touchscreens. Thanks for any help.

        Originally posted by RoChess View Post

        They are basic Regular Expressions scraping the RSS feed.
        http://feeds.bbci.co.uk/news/rss.xml?edition=us contains no images though, so that is probably why that stopped working. You could add rss.png to all the DeviceImage entries for "DeviceNameXX", the same way it was setup for [400] and [430]+. BBC probably had an icon/preview image as part of the description that would get shown, but as you can see from the raw feed it is pure text now.

        The only image reference is an RSS feed one @ https://news.bbcimg.co.uk/nol/shared...ews_120x60.gif

        Each article has none in the primary feed, but does have one at article level, so not sure how advanced the scraper-script options are to travel one level deeper and fetch the "og:image" meta tag contents.

        Comment


          As per your quoted text, I think the BBC stopped providing images in their RSS feeds?
          Jon

          Comment


            I am occasionally getting an error because the file that DScraper is looking for did not get created (by other events):
            Jon00_DScraper Error - Cannot access path: C:\Users\Tom\Desktop\uivision\datasources\iComfortHistory.cs v
            I would like to trigger an event when this occurs. Is there a way for HS3 to trigger an event if DScraper throws an error? I can create a situation that will trigger an event but first would like to know if there is a more direct way.

            Comment


              Not from Datascraper directly but you can use my log monitor to trigger on this error.
              Jon

              Comment


                Wanted to display some updated weather info on my HStouch screen and was able to scrape data from a website (thanks Jon00 for this excellent plugin!).
                After going a few times through the 42 pages :-), this resulted in the following devices:

                Click image for larger version

Name:	Jon00weather.PNG
Views:	214
Size:	142.9 KB
ID:	1409821

                When trying to publish these on my Hstouch screen, I loose the picture. Is there anyway I could retain these or am able to show them?

                Comment


                  Are you serving the images directly from the Internet? I'm not a HSTouch user but I believe you have to serve images via the HS Webserver.
                  Jon

                  Comment


                    I scraped the picture file names from the webpage and have put similar file names in the Datascraper directory (as described in your manual), so that's how these file names show up before the text in the devices overview.

                    Comment


                      Does setting DeviceMode=1 make any difference?

                      (devices will need to be updated to see any change)

                      Also, how many different images are there?
                      Jon

                      Comment


                        The difference when using DeviceMode=1 is that the pictures will be much larger in my Homeseer Devices overview. But no change in HStouch.
                        I'm still updating the number of pictures (awaiting more weather circumstances the coming months), but up till now about 20.

                        HSTouch takes the picture name of the device itself (in this case Click image for larger version

Name:	status.PNG
Views:	203
Size:	5.2 KB
ID:	1409910being datascraper.png)...

                        Comment


                          It may be best to use value graphic pairs to do this which will work in HSTouch. To do so, we need to change each image file to a number.

                          This will need a bit of work but fairly easy once you get the hang of it. Would you post a few of the image filenames you capture so I can use them as an example?
                          Jon

                          Comment


                            As the weather only was hot and a bit of thunder during the last few days I did collect a few (no snow yet ):

                            Cloudy,png Cloudyshower.png Lightcloudy.png Lightshower.png Lightsun.png Shower.png Sun.png Thunder.png Thundershower.png

                            Comment


                              The following will convert the png names to a Integer which can be used to set the device value. Set the [0] entry to the value that reflects the capture of the image file.

                              Code:
                              DeviceValue1= [0] [replace "Cloudy.png","1"] [replace "Cloudyshower.png","2"] [replace "Lightcloudy.png","3"] [replace "Lightshower.png","4"] [replace "Lightsun.png","5"] [replace "Shower.png","6"] [replace "Sun.png","7"] [replace "Thunder.png","8"] [replace "Thundershower.png","9"]
                              Next set DeviceMode = 2

                              This will only show text on the device and no image.

                              The next part cannot be done in HS4 interface (because you cannot select an image from a specified directory)

                              Go to the HS3 legacy device utility page (/deviceutility) and find the Datascraper device.

                              Click on the name link and click on the status graphics tab.

                              Add a 'New single graphic' and give it a value of 1, then add Cloudy.png as the image.

                              Do the same for a value of 2, then add CloudyShower.png.

                              Continue to do the rest of the images as numbered in the replace sequence.

                              That's it.

                              So if CloudyShower.png is parsed, this is replaced with a 2 which is saved as its device value. Because 2 is set as a graphic value, you will see it on the device, including HSTouch.
                              Jon

                              Comment


                                Sorry for my late reply, someone drove into our neigbourhoods' VDSL distibution point and we had to live two days without internet. I have to say that this is quite interesting with three teenagers in our house .

                                Thanks for your very well-explained solution, which I'm going to give this a try this evening!

                                Comment

                                Working...
                                X