No Svalue in Soil Moisture
Posted: Thursday 04 January 2018 11:23
Hi,
I have a Soil Moisture device using Mysensors Arduino code, this shows up in Domoticz as a soil moisture sensor with no issues (see JSON output below).
I've been trying to read the sValue in a separate script using LUA to export this value to a txt file for another purpose. Unfortunately the code will return a 'nil' value using this line of code:
sSoilmoist = otherdevices_svalues[soilmoist_dv]
(soilmoist_dv is declared as my soil moisture device name).
I notice in the devices 'show current state' this device has no sValue so i assume this is the issue. Is there another way to extract the value or get better still get the sValue populated? Can anyone help please?
{
"ActTime" : 1515016367,
"ServerTime" : "2018-01-03 21:52:47",
"Sunrise" : "08:04",
"Sunset" : "16:07",
"result" : [
{
"AddjMulti" : 1.0,
"AddjMulti2" : 1.0,
"AddjValue" : 0.0,
"AddjValue2" : 0.0,
"BatteryLevel" : 84,
"CustomImage" : 0,
"Data" : "135 cb",
"Desc" : "dangerously dry",
"Description" : "",
"Favorite" : 0,
"HardwareID" : 93,
"HardwareName" : "MySensors MQTT",
"HardwareType" : "MySensors Gateway with MQTT interface",
"HardwareTypeVal" : 92,
"HaveTimeout" : false,
"ID" : "00000501",
"LastUpdate" : "2018-01-03 21:51:41",
"Name" : "Soil Moisture",
"Notifications" : "false",
"PlanID" : "0",
"PlanIDs" : [ 0 ],
"Protected" : false,
"ShowNotifications" : true,
"SignalLevel" : "-",
"SubType" : "Soil Moisture",
"SwitchTypeVal" : 0,
"Timers" : "false",
"Type" : "General",
"TypeImg" : "moisture",
"Unit" : 1,
"Used" : 1,
"XOffset" : "0",
"YOffset" : "0",
"idx" : "2160"
}
],
"status" : "OK",
"title" : "Devices"
}
I have a Soil Moisture device using Mysensors Arduino code, this shows up in Domoticz as a soil moisture sensor with no issues (see JSON output below).
I've been trying to read the sValue in a separate script using LUA to export this value to a txt file for another purpose. Unfortunately the code will return a 'nil' value using this line of code:
sSoilmoist = otherdevices_svalues[soilmoist_dv]
(soilmoist_dv is declared as my soil moisture device name).
I notice in the devices 'show current state' this device has no sValue so i assume this is the issue. Is there another way to extract the value or get better still get the sValue populated? Can anyone help please?
{
"ActTime" : 1515016367,
"ServerTime" : "2018-01-03 21:52:47",
"Sunrise" : "08:04",
"Sunset" : "16:07",
"result" : [
{
"AddjMulti" : 1.0,
"AddjMulti2" : 1.0,
"AddjValue" : 0.0,
"AddjValue2" : 0.0,
"BatteryLevel" : 84,
"CustomImage" : 0,
"Data" : "135 cb",
"Desc" : "dangerously dry",
"Description" : "",
"Favorite" : 0,
"HardwareID" : 93,
"HardwareName" : "MySensors MQTT",
"HardwareType" : "MySensors Gateway with MQTT interface",
"HardwareTypeVal" : 92,
"HaveTimeout" : false,
"ID" : "00000501",
"LastUpdate" : "2018-01-03 21:51:41",
"Name" : "Soil Moisture",
"Notifications" : "false",
"PlanID" : "0",
"PlanIDs" : [ 0 ],
"Protected" : false,
"ShowNotifications" : true,
"SignalLevel" : "-",
"SubType" : "Soil Moisture",
"SwitchTypeVal" : 0,
"Timers" : "false",
"Type" : "General",
"TypeImg" : "moisture",
"Unit" : 1,
"Used" : 1,
"XOffset" : "0",
"YOffset" : "0",
"idx" : "2160"
}
],
"status" : "OK",
"title" : "Devices"
}