Announcement

Collapse
No announcement yet.

Virtual device Value set with GET

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

    Virtual device Value set with GET

    I have a raspberry pi with some sensors on it. The Sensors will return data with a web GET. For example, if you request http://10.10.10.10:1200 a value from one of the sensors is returned. Is there a way to get this value and assign it to a virtual device?

    #2
    Yes although it will depend on what the data is returned by, is it plain html, text, XML, JSON etc. If it is very simple text you might be able to get by with a single line scripting call, if not then it's likely to need a full script (which would be a couple of lines) you would run in a recurring event.

    Probably best if you post the contents of the web page so it can be understand how it is coming back to you.

    Comment


      #3
      Thanks

      Yes, its a simple value, for example, a temperature or humidity value. 67 or 100 say. What would be the single line script?

      Comment


        #4
        You could also go about it another way. Have the pi control the HS virtual device via a JSON call. I'm using Node-Red on a pi3 to send various sensor data to HS3 with this method.

        Comment


          #5
          So you are using some sort of timer and sending data to HS at intervals?

          Comment


            #6
            Node Red allows you to set interval triggers to perform actions. I'm also using it to parse http info from my CAO Gadgets Wireless Tag Manager (Tag Manager > RPI3 w/Node Red > HS3).

            Sent from my Pixel XL using Tapatalk

            Comment

            Working...
            X