Announcement

Collapse
No announcement yet.

Problem with showing graphs. Cache related?

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

    Problem with showing graphs. Cache related?

    In homeseer I am making graphs with the Device History plugin via events. This yields png files in the /usr/local/HomeSeer/html/DeviceHistory/images/chart directory.
    Within HSTouch Designer I show the graphs in a graphic element with a URL to the png file in the ImageURLNormal field. The graph is visible now in the element.

    After deploying the project to my Android phone I can see the graph without a problem. But, if I remake the graph with the event than I always see the old graph in HSTouch although the new graph correctly shows up in the chart directory. After renewing the graph several times it keeps showing the first graph.

    I observe that when I do a 'close all apps' on my Android phone than the latest figure is shown in HSTouch. Could this be related to a kind of a clear cache problem? I cannot find any possibility to set this.
    I also observe that the same is happening on my iPad that is why I think there must be something wrong in HSTouch Designer.

    HomeSeer HS4 is running on a RaspberryPi4 with Raspbian Buster.

    Any help appreciated.
    -- Cor --

    #2
    I believe you are correct that it is a problem with the image being cached. I've found that if I select 'IsVideo' and choose a reasonable refresh rate (that can usually be quite slow) the image updates normally.

    Click image for larger version  Name:	IsVideo.png Views:	0 Size:	3.6 KB ID:	1432739
    Mike____________________________________________________________ __________________
    HS3 Pro Edition 3.0.0.548, NUC i3

    HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

    Comment


      #3
      I set up an html file for each graph and then move each individual html file to a unique html file name. I have a script that moves the file. Always updates. The HTML files are all the same except for the img src filename. I use this for temperature, memory usage and weather files.

      Code:
      <html lang="en">
      <head><META HTTP-EQUIV=Refresh CONTENT=600></head>
      <body bgcolor="MidnightBlue" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
      <img src="http://192.168.1.135/opt/HomeSeer/Data/TemperatureLog/Device3285.png" height="100%" width="100%"></img>
      </body>
      </html>
      A snippet showing the setup in hstouch.

      Click image for larger version

Name:	Screenshot from 2020-11-12 09-12-19.png
Views:	264
Size:	112.8 KB
ID:	1432769

      Code:
      '12/23/2019 ScrollTemp.vb
      'Script to scroll through static pictures and write html file to unique filename.
      'jlg 4-20-2020 Add Device 743 to list
      
      IMPORTS System.IO
      IMPORTS System.Net
      IMPORTS System.Threading
      
      Sub Main(ByVal Parm As String) 'There are 0 parameters
      
      Dim sPath, sDisplayFile, Counter, Source, Destination As String
      Dim sFile(19) As String
      Dim dCounter As Double
      Dim iCnt, iMax, iIncCnt As Integer
      
      iMax = 19 'Set the maximum number of maps
      Counter = "TemperatureCntr" 'Created Counter
      
      'set the files and pathname for maps
      sPath = "/opt/HomeSeer/html/" 'The Path Name to the files
      sFile(0) = "Chart486.html"
      sFile(1) = "Chart492.html"
      sFile(2) = "Chart497.html"
      sFile(3) = "Chart688.html"
      sFile(4) = "Chart690.html"
      sFile(5) = "Chart691.html"
      sFile(6) = "Chart695.html"
      sFile(7) = "Chart706.html"
      sFile(8) = "Chart3285.html"
      sFile(9) = "Chart720.html" 'was 3374 - rescan set the new ref id to 720
      sFile(10)= "Chart3409.html"
      sFile(11)= "Chart3497.html"
      sFile(12)= "Chart3618.html"
      sFile(13)= "Chart3679.html"
      sFile(14)= "Chart3683.html"
      sFile(15)= "Chart3687.html"
      sFile(16)= "Chart3691.html"
      sFile(17)= "Chart3736.html"
      sFile(18)= "Chart3787.html"
      sFile(19)= "Chart3837.html"
      'sFile(20)= "Chart743.html"
      
      sDisplayFile= "Temperature.html" 'the file to use for display
      
      dCounter = hs.CounterValue(Counter) 'Get the Map Counter Value
      iCnt = CInt(dCounter) ' Set the double to an integer
      
      'Make the list a loop and set the Counter correctly
      
      If iCnt < 0 Then 'Went through the floor value so set to ceiling value.
      hs.CounterReset(Counter)
      For iIncCnt = 1 To iMax+1
      hs.CounterIncrement(Counter)
      Next
      iCnt = iMax
      End If
      
      If iCnt > iMax Then 'Went through the ceiling value so set to the floor value
      hs.CounterReset(Counter)
      iCnt = 0
      End If
      
      Source = sPath & sFile(iCnt)
      Destination = sPath & sDisplayFile
      
      'Overwrite or create the file that will be displayed.
      System.IO.File.Copy(Source, Destination, True)
      
      End Sub
      I recognize that this is convoluted, however it has been solid for the last year.

      Comment


        #4
        Thank you both for the information. It turns out that the solution of Uncle Michael works very nice.

        -- Cor --

        Comment

        Working...
        X