Logic Machine Forum
1wire - Basic Script - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: 1wire - Basic Script (/showthread.php?tid=2492)



1wire - Basic Script - maryantudor@gmail.com - 28.02.2020

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!


RE: 1wire - Basic Script - admin - 28.02.2020

You can do all this from the UI. Why do you need a script?


RE: 1wire - Basic Script - maryantudor@gmail.com - 28.02.2020

(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


RE: 1wire - Basic Script - admin - 28.02.2020

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.


RE: 1wire - Basic Script - maryantudor@gmail.com - 03.03.2020

(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!