Using PLEG to copy a sensor value to another
-
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.
-
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) -
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)@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.
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