21/07/2015, 14:36:27
Re,
exemple de script :
<rule id="1wire-read">
<condition type="timer" trigger="true">
<every>2m</every>
</condition>
<actionlist>
<action type="script">
function read1wire(id, objname)
out = io.popen("/usr/local/bin/owread -s localhost:4304 "..id);
value = string.match(out:read("*a"), "[0-9.]+");
out:close();
if (value ~= nil) then
set(objname, value);
end
end;
read1wire("28.000000000000/temperature","temperature");
</action>
</actionlist>
</rule>
@+
Anthony.
exemple de script :
<rule id="1wire-read">
<condition type="timer" trigger="true">
<every>2m</every>
</condition>
<actionlist>
<action type="script">
function read1wire(id, objname)
out = io.popen("/usr/local/bin/owread -s localhost:4304 "..id);
value = string.match(out:read("*a"), "[0-9.]+");
out:close();
if (value ~= nil) then
set(objname, value);
end
end;
read1wire("28.000000000000/temperature","temperature");
</action>
</actionlist>
</rule>
@+
Anthony.