A lua script for pms7003 is incorrect
Posted: Sunday 15 December 2019 13:22
commandArray = {}
if devicechanged['Dust'] then
local device = otherdevices_svalues["Dust"]
print(device)
local pm1, pm25, pm10
_,_,pm1, pm25, pm10 = string.find(device, "(.+);(.+);(.+)")
print(pm1) --show temp in LOG
print(pm25) --show humidity in LOG
print(pm10) --show humstat in LOG,
commandArray[1] = {['UpdateDevice'] = 10 .. '|0|' .. pm25}
commandArray[2] = {['UpdateDevice'] = 11 .. '|0|' .. pm10}
end
return commandArray
It doesn't work.
Can someone help me?
if devicechanged['Dust'] then
local device = otherdevices_svalues["Dust"]
print(device)
local pm1, pm25, pm10
_,_,pm1, pm25, pm10 = string.find(device, "(.+);(.+);(.+)")
print(pm1) --show temp in LOG
print(pm25) --show humidity in LOG
print(pm10) --show humstat in LOG,
commandArray[1] = {['UpdateDevice'] = 10 .. '|0|' .. pm25}
commandArray[2] = {['UpdateDevice'] = 11 .. '|0|' .. pm10}
end
return commandArray
It doesn't work.
Can someone help me?