Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Controllers
  3. Vera
  4. Using PLEG to copy a sensor value to another

Using PLEG to copy a sensor value to another

Scheduled Pinned Locked Moved Vera
3 Posts 2 Posters 2.1k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dbemowsk
    wrote on last edited by
    #1

    So I am having trouble trying to do something with PLEG. I have an outside temp sensor which is on my OneWire network. I also have my MySensors thermostat bridge that will accept a value for the outside temp that will get displayed on the actual wall thermostat display. I just present a separate device for the outside temp as a place to set the value. I am trying to find a way to copy the value from the OneWire sensor to the thermostat outside temp device. It would be nice if I could do it any time the value changes, but I would also accept doing it say every minute. When I look at the options for the temp sensor, all I have is "if the temp goes above", "if the temp goes below" or "if the battery goes below". Because of this I am assuming that I will have to do it once a minute, but maybe someone knows how to do it on change of the value. My main thing is that I can't figure out how to copy the value over.

    Vera Plus running UI7 with MySensors, Sonoffs and 1-Wire devices
    Visit my website for more Bits, Bytes and Ramblings from me: http://dan.bemowski.info/

    1 Reply Last reply
    0
    • K Offline
      K Offline
      korttoma
      Hero Member
      wrote on last edited by
      #2

      Just add LUA as a Logic Action triggered by a cyclic condition in PLEG
      Using Lua just get the value from the temp sensor variable and set the variable on the thermostat:

      local PipeTemp = luup.variable_get("urn:upnp-org:serviceId:TemperatureSensor1","CurrentTemperature", 42)
      luup.variable_set("urn:upnp-org:serviceId:TemperatureSensor1","CurrentTemperature",PipeTemp,44)
      
      
      • Tomas
      D 1 Reply Last reply
      0
      • K korttoma

        Just add LUA as a Logic Action triggered by a cyclic condition in PLEG
        Using Lua just get the value from the temp sensor variable and set the variable on the thermostat:

        local PipeTemp = luup.variable_get("urn:upnp-org:serviceId:TemperatureSensor1","CurrentTemperature", 42)
        luup.variable_set("urn:upnp-org:serviceId:TemperatureSensor1","CurrentTemperature",PipeTemp,44)
        
        
        D Offline
        D Offline
        dbemowsk
        wrote on last edited by
        #3

        @korttoma Perfect. This is what I came up with in the end, and I have it triggering every minute. I needed the number rounded to the nearest whole number as the thermostat will not display a decimal value for the outside temp.

        local CurrentTemp= luup.variable_get("urn:upnp-org:serviceId:TemperatureSensor1","CurrentTemperature", 26)
        luup.variable_set("urn:upnp-org:serviceId:LcdText1", "LcdText", string.format("%.0f", CurrentTemp), 365)
        

        Thanks a million.

        Vera Plus running UI7 with MySensors, Sonoffs and 1-Wire devices
        Visit my website for more Bits, Bytes and Ramblings from me: http://dan.bemowski.info/

        1 Reply Last reply
        1

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        9

        Online

        12.0k

        Users

        11.2k

        Topics

        113.4k

        Posts


        Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • MySensors
        • OpenHardware.io
        • Categories
        • Recent
        • Tags
        • Popular