Announcement

Collapse
No announcement yet.

Help with HTTP Profile Logic

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

    Help with HTTP Profile Logic

    Hello,

    I'm fairly new to Big5, I've got a couple of profiles working, but I tried to add one today that comes out OK in the sandbox, but not in the actual device.

    The URL is https://www.saws.org/your-water/aqui...el-statistics/

    I'm trying to capture the value of the aquifer level in a device. The first instance appears as "Stage 1 Watering Hours / Edwards Aquifer Level: 657.5 Updated 7/12/20"

    I started in the sandbox by pasting the contents of the page in the "input" box and working out the regular expression:

    ${Regex(Regex(input, "Edwards Aquifer Level.*.\b\d{3}\.?\d*")[0],"\b\d{3}\.?\d*")[0]}

    Which shows the result of 657.5 in the Result box. That seems good.

    I pasted the sandbox string without ${} in the HTTP profile "Device value expression" and put the profile in a manually executed event. When I run the event I got the value of 2020 instead of 657.5

    Any thoughts where I'm going wrong?

    #2
    mterry63

    Most likely the web page doesn't produce the exact text that you expect in the order that you expect it.
    Try activating the Big5 debug mode at the bottom of "Configuration" page and see what exactly Big5 is getting in Homeseer's Log.
    Once you see that you may adjust your RegEx accordingly using the sandbox again.
    Other than that you are doing everything correctly by the book.

    Comment


      #3
      Thanks. Using Big5 debug I could see that the page was loading the actual data from another URL, which turned out to be a simple json URL which made capturing the number much easier. Got it all sorted and working.

      Comment

      Working...
      X