This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

1wire - Basic Script
#1
Hello,

I want kindly to ask you for a simple script 1wire example that will:

- contain a function with 2 parameters (location, sensor address)
- read the temperature value from a DS18b20 sensor every 60s
- print and return the temperature value

Also please let me if it's any documentation where I can find how to manage 1wire sensor via scripts (Lua scripts) or directly from LM UI....

Thank you in advance!
Reply
#2
You can do all this from the UI. Why do you need a script?
Reply
#3
(28.02.2020, 13:29)admin Wrote: You can do all this from the UI. Why do you need a script?

I tried to build a thermostat function inside of a resident script. So a need to have inside a function that will read (every n minutes ) the temperature from each location and it will return the temperature base on location and the address of each location. 

Do you think that it's an easy way to build a thermostat function base on DS18b20 temperature sensors? 

Thank you for your support
Reply
#4
You can use grp.getvalue() in your script to get current temperature object values. For improved reliability we recommend using 1-wire sensors with 5V power supply. In some cases you might need a small capacitor between 5V and GND close to the sensor.
Reply
#5
(28.02.2020, 16:22)admin Wrote: You can use grp.getvalue() in your script to get current temperature object values. For improved reliability we recommend using 1-wire sensors with 5V power supply. In some cases you might need a small capacitor between 5V and GND close to the sensor.
Thank you for your support!
Reply


Forum Jump: