Found a typo in the key-names of the table. Fixed it and updated script in my post of Friday 06 September 2019 15:40 in this topic.
Hope it will solve your problem.
Moderator: leecollings
Found a typo in the key-names of the table. Fixed it and updated script in my post of Friday 06 September 2019 15:40 in this topic.
Code: Select all
2019-10-18 08:27:01.038 Status: dzVents: Debug: ObserverIP_4-0.201910171900: Processing device-adapter for AWindDir: Wind device adapter
2019-10-18 08:27:01.040 Status: dzVents: Debug: ObserverIP_4-0.201910171900: Processing device-adapter for AvgWind: Wind device adapter
2019-10-18 08:27:01.041 Status: dzVents: Debug: ObserverIP_4-0.201910171900: Processing device-adapter for AGustSpeed: Wind device adapter
2019-10-18 08:27:01.045 Status: dzVents: Debug: ObserverIP_4-0.201910171900: Processing device-adapter for AinTemp: Temperature device adapter
2019-10-18 08:27:01.048 Status: dzVents: Debug: ObserverIP_4-0.201910171900: Processing device-adapter for AinTempHum: Temperature+humidity device adapter
2019-10-18 08:27:01.051 Status: dzVents: Debug: ObserverIP_4-0.201910171900: Processing device-adapter for AoutTemp: Temperature device adapter
2019-10-18 08:27:01.053 Status: dzVents: Debug: ObserverIP_4-0.201910171900: Processing device-adapter for AoutTempHum: Temperature+humidity device adapter
2019-10-18 08:27:01.055 Status: dzVents: Debug: ObserverIP_4-0.201910171900: Processing device-adapter for ASolarRad: Solar radiation device adapter
2019-10-18 08:27:01.057 Status: dzVents: Debug: ObserverIP_4-0.201910171900: Processing device-adapter for AUvi: UV device adapter
2019-10-18 08:27:01.058 Status: dzVents: Debug: ObserverIP_4-0.201910171900: Processing device-adapter for ARain: Rain device
2019-10-18 08:27:01.060 Status: dzVents: Debug: ObserverIP_4-0.201910171900: Processing device-adapter for ARelPress: Barometer device adapter
2019-10-18 08:27:01.062 Status: dzVents: Debug: ObserverIP_4-0.201910171900: Processing device-adapter for ARainDaily: Custom sensor device adapter
2019-10-18 08:27:01.063 Status: dzVents: Debug: ObserverIP_4-0.201910171900: Processing device-adapter for ARainWeekly: Custom sensor device adapter
2019-10-18 08:27:01.065 Status: dzVents: Debug: ObserverIP_4-0.201910171900: Processing device-adapter for ARainMonthly: Custom sensor device adapter
2019-10-18 08:27:01.066 Status: dzVents: Debug: ObserverIP_4-0.201910171900: Processing device-adapter for ARainYearly: Custom sensor device adapter
2019-10-18 08:27:01.088 Status: dzVents: > weeklyRain: 18.00
2019-10-18 08:27:01.088 Status: dzVents: > UV: 40
2019-10-18 08:27:01.088 Status: dzVents: > outdoorTemperature: 13.5
2019-10-18 08:27:01.088 Status: dzVents: > solarRadiation: 0.00
2019-10-18 08:27:01.088 Status: dzVents: > windSpeed: 15.1
2019-10-18 08:27:01.088 Status: dzVents: > indoorHumidity: 63
2019-10-18 08:27:01.088 Status: dzVents: > UVI: 0
2019-10-18 08:27:01.088 Status: dzVents: > indoorTemperature: 22.8
2019-10-18 08:27:01.089 Status: dzVents: > yearlyRain: 604.80
2019-10-18 08:27:01.089 Status: dzVents: > windDirection: 244
2019-10-18 08:27:01.089 Status: dzVents: > monthlyRain: 98.70
2019-10-18 08:27:01.089 Status: dzVents: > dailyRain: 0.30
2019-10-18 08:27:01.089 Status: dzVents: > hourlyRainRate: 1.80
2019-10-18 08:27:01.089 Status: dzVents: > outdoorHumidity: 94
2019-10-18 08:27:01.089 Status: dzVents: > relativePressure: 999.80
2019-10-18 08:27:01.089 Status: dzVents: > absolutePressure: 997.70
2019-10-18 08:27:01.089 Status: dzVents: > windGust: 28.1
2019-10-18 08:27:01.091 Status: dzVents: Info: ObserverIP_4-0.201910171900: ------ Finished ObserverIP-4.lua
wind = dz.devices('AWindDir')
These values are already send to the 'AWindDir' device.I still have a problem with gustSpeed and Average wind.
Code: Select all
2019-10-18 13:19:00.931 Status: dzVents: Debug: ObserverIP_0.201910181100: Processing device-adapter for AinTemp: Temperature device adapter
2019-10-18 13:19:00.932 Status: dzVents: Debug: ObserverIP_0.201910181100: Processing device-adapter for AinTempHum: Temperature+humidity device adapter
2019-10-18 13:19:00.933 Status: dzVents: Debug: ObserverIP_0.201910181100: Processing device-adapter for AoutTemp: Temperature device adapter
2019-10-18 13:19:00.934 Status: dzVents: Debug: ObserverIP_0.201910181100: Processing device-adapter for AoutTempHum: Temperature+humidity device adapter
2019-10-18 13:19:00.935 Status: dzVents: Debug: ObserverIP_0.201910181100: Processing device-adapter for ASolarRad: Solar radiation device adapter
2019-10-18 13:19:00.935 Status: dzVents: Debug: ObserverIP_0.201910181100: Processing device-adapter for AUvi: UV device adapter
2019-10-18 13:19:00.936 Status: dzVents: Debug: ObserverIP_0.201910181100: Processing device-adapter for ARain: Rain device
2019-10-18 13:19:00.937 Status: dzVents: Debug: ObserverIP_0.201910181100: Processing device-adapter for ARelPress: Barometer device adapter
2019-10-18 13:19:00.938 Status: dzVents: Debug: ObserverIP_0.201910181100: Processing device-adapter for ARainDaily: Custom sensor device adapter
2019-10-18 13:19:00.939 Status: dzVents: Debug: ObserverIP_0.201910181100: Processing device-adapter for ARainWeekly: Custom sensor device adapter
2019-10-18 13:19:00.940 Status: dzVents: Debug: ObserverIP_0.201910181100: Processing device-adapter for ARainMonthly: Custom sensor device adapter
2019-10-18 13:19:00.940 Status: dzVents: Debug: ObserverIP_0.201910181100: Processing device-adapter for ARainYearly: Custom sensor device adapter
2019-10-18 13:19:00.941 Status: dzVents: Debug: ObserverIP_0.201910181100: Processing device-adapter for AGustSpeed: Custom sensor device adapter
2019-10-18 13:19:00.942 Status: dzVents: Debug: ObserverIP_0.201910181100: Processing device-adapter for AvgWind: Custom sensor device adapter
2019-10-18 13:19:00.953 Status: dzVents: Error (2.4.19): ObserverIP_0.201910181100: An error occured when calling event handler ObserverIP-5
2019-10-18 13:19:00.953 Status: dzVents: Error (2.4.19): ObserverIP_0.201910181100: /home/pi/domoticz/scripts/dzVents/scripts/ObserverIP-5.lua:207: attempt to compare nil with number
2019-10-18 13:19:00.953 Status: dzVents: Info: ObserverIP_0.201910181100: ------ Finished ObserverIP-5.lua
Code: Select all
ObserverIP_0.201910181100: An error occured when calling event handler ObserverIP-5
ObserverIP_0.201910181100: /home/pi/domoticz/scripts/dzVents/scripts/ObserverIP-5.lua:207: attempt to compare nil with number
No idea why you get this error. Can you add directly after line 181 (Line 181 is
Code: Select all
local function updateDevices(fields) -- update all ( declared ) devices. Specialized function to create required fields are local to this function
Code: Select all
if _G.logLevel == dz.LOG_DEBUG then dz.utils.dumpTable(fields) end
Code: Select all
2019-10-18 15:35:01.382 Status: dzVents: Info: Handling httpResponse-events for: "ObserverIP_0.201910181100
2019-10-18 15:35:01.382 Status: dzVents: Info: ObserverIP_0.201910181100: ------ Start external script: ObserverIP-5.lua: HTTPResponse: "ObserverIP_0.201910181100"
2019-10-18 15:35:01.385 Status: dzVents: Debug: ObserverIP_0.201910181100: Processing device-adapter for AWindDir: Wind device adapter
2019-10-18 15:35:01.388 Status: dzVents: Debug: ObserverIP_0.201910181100: Processing device-adapter for AinTemp: Temperature device adapter
2019-10-18 15:35:01.392 Status: dzVents: Debug: ObserverIP_0.201910181100: Processing device-adapter for AinTempHum: Temperature+humidity device adapter
2019-10-18 15:35:01.395 Status: dzVents: Debug: ObserverIP_0.201910181100: Processing device-adapter for AoutTemp: Temperature device adapter
2019-10-18 15:35:01.397 Status: dzVents: Debug: ObserverIP_0.201910181100: Processing device-adapter for AoutTempHum: Temperature+humidity device adapter
2019-10-18 15:35:01.399 Status: dzVents: Debug: ObserverIP_0.201910181100: Processing device-adapter for ASolarRad: Solar radiation device adapter
2019-10-18 15:35:01.400 Status: dzVents: Debug: ObserverIP_0.201910181100: Processing device-adapter for AUvi: UV device adapter
2019-10-18 15:35:01.402 Status: dzVents: Debug: ObserverIP_0.201910181100: Processing device-adapter for ARain: Rain device
2019-10-18 15:35:01.404 Status: dzVents: Debug: ObserverIP_0.201910181100: Processing device-adapter for ARelPress: Barometer device adapter
2019-10-18 15:35:01.405 Status: dzVents: Debug: ObserverIP_0.201910181100: Processing device-adapter for ARainDaily: Custom sensor device adapter
2019-10-18 15:35:01.407 Status: dzVents: Debug: ObserverIP_0.201910181100: Processing device-adapter for ARainWeekly: Custom sensor device adapter
2019-10-18 15:35:01.409 Status: dzVents: Debug: ObserverIP_0.201910181100: Processing device-adapter for ARainMonthly: Custom sensor device adapter
2019-10-18 15:35:01.411 Status: dzVents: Debug: ObserverIP_0.201910181100: Processing device-adapter for ARainYearly: Custom sensor device adapter
2019-10-18 15:35:01.413 Status: dzVents: Debug: ObserverIP_0.201910181100: Processing device-adapter for AGustSpeed: Custom sensor device adapter
2019-10-18 15:35:01.414 Status: dzVents: Debug: ObserverIP_0.201910181100: Processing device-adapter for AvgWind: Custom sensor device adapter
2019-10-18 15:35:01.427 Status: dzVents: > absolutePressure: 1001.30
2019-10-18 15:35:01.428 Status: dzVents: > yearlyRain: 604.80
2019-10-18 15:35:01.428 Status: dzVents: > monthlyRain: 98.70
2019-10-18 15:35:01.428 Status: dzVents: > weeklyRain: 18.00
2019-10-18 15:35:01.428 Status: dzVents: > outdoorHumidity: 74
2019-10-18 15:35:01.428 Status: dzVents: > indoorHumidity: 60
2019-10-18 15:35:01.428 Status: dzVents: > outdoorTemperature: 15.5
2019-10-18 15:35:01.428 Status: dzVents: > hourlyRainRate: 0.00
2019-10-18 15:35:01.428 Status: dzVents: > dailyRain: 0.30
2019-10-18 15:35:01.428 Status: dzVents: > UVI: 2
2019-10-18 15:35:01.428 Status: dzVents: > UV: 623
2019-10-18 15:35:01.428 Status: dzVents: > solarRadiation: 371.86
2019-10-18 15:35:01.428 Status: dzVents: > relativePressure: 1003.40
2019-10-18 15:35:01.428 Status: dzVents: > indoorTemperature: 22.6
2019-10-18 15:35:01.428 Status: dzVents: > windDirection: 181
2019-10-18 15:35:01.428 Status: dzVents: Error (2.4.19): ObserverIP_0.201910181100: An error occured when calling event handler ObserverIP-5
2019-10-18 15:35:01.428 Status: dzVents: Error (2.4.19): ObserverIP_0.201910181100: /home/pi/domoticz/scripts/dzVents/scripts/ObserverIP-5.lua:207: attempt to compare nil with number
2019-10-18 15:35:01.428 Status: dzVents: Info: ObserverIP_0.201910181100: ------ Finished ObserverIP-5.lua
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>LiveData</title>
<link href="axcss0.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table width="800" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" align="right" bgcolor="#0088F7"> </td>
</tr>
<tr>
<td colspan="2" bgcolor="#FFFFFF"><table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="20" height = "80"> </td>
<td > </td>
<td width="10"> </td>
<td class="txtstyle_1" >Weather Logger 2.2</td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="2" align="right" bgcolor="#60B7FF"><table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="120" align="center"><font color="#FFFFFF" face="Arial, Helvetica, sans-serif"><em>Version:2.2.2</em></font></td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="2" align="left" bgcolor="#C0C0C0">
<table width="20" border="0" cellpadding="0" cellspacing="0">
<tr>
<td bgcolor="#C0C0C0"><div class="menuitem_1"><a href="bscsetting.htm">Local Network</a></div></td>
<td bgcolor="#C0C0C0"><div class="menuitem_1"><a href="weather.htm">Weather Network</a></div></td>
<td bgcolor="#C0C0C0"><div class="menuitem_1"><a href="station.htm">Station Settings</a></div></td>
<td bgcolor="#EDEFEF"><div class="menuitem_1"><a href="livedata.htm">Live Data</a></div></td>
<td bgcolor="#C0C0C0"><div class="menuitem_1"><a href="correction.htm">Calibration</a></div></td>
</tr>
</table>
</td>
</tr>
<form name="livedata" method="POST" onsubmit="return chkForm(0);">
<tr>
<td colspan="2" bgcolor="#EDEFEF"><div class="subitem_1">Live Data</div></td>
</tr>
<tr>
<td width="533" bgcolor="#EDEFEF"><div class="item_1">Receiver Time:</div></td>
<td width="307" bgcolor="#EDEFEF">
<input name="CurrTime" disabled="disabled" type="text" class="item_2" style="WIDTH: 120px" value="15:36 10/18/2019" maxlength ="20"></td>
</tr>
<tr>
<td width="533" bgcolor="#EDEFEF"><div class="item_1">Indoor Battery Status</div></td>
<td width="307" bgcolor="#EDEFEF">
<select name="inBattSta" class="item_2" disabled="disabled" style="WIDTH: 120px">
<option value="0" selected >Normal</option>
<option value="1" >Indoor Bat Low</option>
</select></td>
</tr>
<tr>
<td width="533" bgcolor="#EDEFEF"><div class="item_1">Outdoor Battery Status</div></td>
<td width="307" bgcolor="#EDEFEF">
<select name="outBattSta" class="item_2" disabled="disabled" style="WIDTH: 120px">
<option value="0" selected >Normal</option>
<option value="1" >Outdoor Bat Low</option>
</select></td>
</tr>
<tr>
<td width="533" bgcolor="#EDEFEF"><div class="item_1">Indoor Sensor ID</div></td>
<td width="307" bgcolor="#EDEFEF"><input name="IndoorID" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="0x4c" maxlength="6"></td>
</tr>
<tr>
<td bgcolor="#EDEFEF"><div class="item_1">Outdoor Sensor1 ID</div></td>
<td bgcolor="#EDEFEF"><input name="Outdoor1ID" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="0x7e" maxlength="6"></td>
</tr>
<tr>
<td bgcolor="#EDEFEF"><div class="item_1">Outdoor Sensor2 ID</div></td>
<td bgcolor="#EDEFEF"><input name="Outdoor2ID" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="0x--" maxlength="6"></td>
</tr>
<tr>
<td bgcolor="#EDEFEF"><div class="item_1">Indoor Temperature</div></td>
<td bgcolor="#EDEFEF"><input name="inTemp" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="22.6" maxlength="8"></td>
</tr>
<tr>
<td bgcolor="#EDEFEF"><div class="item_1">Indoor Humidity</div></td>
<td bgcolor="#EDEFEF"><input name="inHumi" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="60" maxlength="4"></td>
</tr>
<tr>
<td bgcolor="#EDEFEF"><div class="item_1">Absolute Pressure </div></td>
<td bgcolor="#EDEFEF"><input name="AbsPress" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="1001.30" maxlength="6"></td>
</tr>
<tr>
<td bgcolor="#EDEFEF"><div class="item_1">Relative Pressure </div></td>
<td bgcolor="#EDEFEF"><input name="RelPress" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="1003.40" maxlength="6"></td>
</tr>
<tr>
<td bgcolor="#EDEFEF"><div class="item_1">Outdoor Temperature</div></td>
<td bgcolor="#EDEFEF"><input name="outTemp" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="15.5" maxlength="8"></td>
</tr>
<tr>
<td bgcolor="#EDEFEF"><div class="item_1">Outdoor Humidity </div></td>
<td bgcolor="#EDEFEF"><input name="outHumi" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="73" maxlength="4"></td>
</tr>
<tr>
<td bgcolor="#EDEFEF"><div class="item_1">Wind Direction </div></td>
<td bgcolor="#EDEFEF"><input name="windir" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="234" maxlength="5"></td>
</tr>
<tr>
<td bgcolor="#EDEFEF"><div class="item_1">Wind Speed </div></td>
<td bgcolor="#EDEFEF"><input name="avgwind" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="12.2" maxlength="6"></td>
</tr>
<tr>
<td bgcolor="#EDEFEF"><div class="item_1">Wind Gust </div></td>
<td bgcolor="#EDEFEF"><input name="gustspeed" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="16.2" maxlength="6"></td>
</tr>
<tr>
<td bgcolor="#EDEFEF"><div class="item_1">Solar Radiation </div></td>
<td bgcolor="#EDEFEF"><input name="solarrad" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="355.42" maxlength="12"></td>
</tr>
<tr>
<td bgcolor="#EDEFEF"><div class="item_1">UV </div></td>
<td bgcolor="#EDEFEF"><input name="uv" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="596" maxlength="12"></td>
</tr>
<tr>
<td bgcolor="#EDEFEF"><div class="item_1">UVI </div></td>
<td bgcolor="#EDEFEF"><input name="uvi" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="2" maxlength="4"></td>
</tr>
<tr>
<td bgcolor="#EDEFEF"><div class="item_1">Hourly Rain Rate</div></td>
<td bgcolor="#EDEFEF"><input name="rainofhourly" disabled="disabled" type="text" class="item_2" style="WIDTH: 80px" value="0.00" maxlength="8"></td>
</tr>
<form name="Rain_1" method="POST" onsubmit="return chkForm(0);">
<tr>
<td bgcolor="#EDEFEF"><div class="item_1">Daily Rain</div></td>
<td bgcolor="#EDEFEF"><input name="rainofdaily" type="text" class="item_2" style="WIDTH: 80px" value="0.30" maxlength="8">
<span id="rainofdaily_msg" class="errMsg0"></span></td>
</tr>
<tr>
<td bgcolor="#EDEFEF"><div class="item_1">Weekly Rain</div></td>
<td bgcolor="#EDEFEF"><input name="rainofweekly" type="text" class="item_2" style="WIDTH: 80px" value="18.00" maxlength="8">
<span id="rainofweekly_msg" class="errMsg0"></span></td>
</tr>
<tr>
<td bgcolor="#EDEFEF"><div class="item_1">Monthly Rain</div></td>
<td bgcolor="#EDEFEF"><input name="rainofmonthly" type="text" class="item_2" style="WIDTH: 80px" value="98.70" maxlength="8">
<span id="rainofmonthly_msg" class="errMsg0"></span></td>
</tr>
<tr>
<td bgcolor="#EDEFEF"><div class="item_1">Yearly Rain</div></td>
<td bgcolor="#EDEFEF"><input name="rainofyearly" type="text" class="item_2" style="WIDTH: 80px" value="604.80" maxlength="8">
<span id="rainofyearly_msg" class="errMsg0"></span></td>
</tr>
<tr>
<td colspan="2" bgcolor="#EDEFEF"> </td>
</tr>
<tr align="center">
<td colspan="2" bgcolor="#EDEFEF"><input name="Apply" type="submit" class="item_2" style="WIDTH: 60px; HEIGHT: 24px;" onclick="setSubmitType(1)" value="Apply" />
<input name="Cancel" type="reset" class="item_2" style="WIDTH: 60px; HEIGHT: 24px;" value="Cancel" /></td>
</tr>
</form>
<tr>
<td colspan="2" bgcolor="#EDEFEF"> </td>
</tr>
<tr>
<td colspan="2" align="center" bgcolor="#EDEFEF">
<input name="rain_Default" type="button" class="item_2" style="WIDTH: 110px; HEIGHT: 24px;" onclick="raindef()" value="Rain Reset">
<input id="refresh_st" type="button" class="item_4" style="WIDTH: 110px; HEIGHT: 24px;" onclick="uiCtrl(this.value);" value="Refresh">
<input id="refresh_sp" type="button" class="item_2" style="WIDTH: 110px; HEIGHT: 24px;" onclick="uiCtrl(this.value);" value="Stop Refresh">
</td>
</tr>
</form>
<tr>
<td colspan="2" bgcolor="#EDEFEF"> </td>
</tr>
<tr>
<td colspan="2" bgcolor="#C0C0C0"> </td>
</tr>
</table>
<script src="axjs0.js" type="text/javascript"></script>
<script language="JavaScript" type="text/javascript">
<!--
var rfTaskRuningFlag = 0, rfTimeId;
uiCtrl('Refresh');
function uiCtrl(uiCmd)
{
if (uiCmd=='Refresh'){
document.getElementById('refresh_st').disabled = true;
document.getElementById('refresh_sp').disabled = false;
rfTaskRuningFlag = 1;
rfTaskState = 0;
rfTimeId = setInterval("ss()",16000);
}else if (uiCmd=='Stop Refresh'){
document.getElementById('refresh_st').disabled = false;
document.getElementById('refresh_sp').disabled = true;
rfTaskRuningFlag = 0;
clearInterval(rfTimeId);
}
}
function ss()
{
if (rfTaskRuningFlag)
{
window.top.location.reload();
}
}
//-->
</script>
</body>
</html>
I tested with the response data from your curl command and I don't get an error.
Code: Select all
...
on =
{
devices = {'WH2600-Wind'}, --mydevice
httpResponses = { scriptVar }
},
etc ...
Code: Select all
2019-10-29 16:54:52.503 Status: dzVents: Info: Handling events for: "WH2600-Wind", value: "64;ENE;16.0;45.0;10.4;10.4"
2019-10-29 16:54:52.503 Status: dzVents: Info: ObserverIP_0.201910181100: ------ Start external script: ObserverIP-5.lua: Device: "WH2600-Wind (Virtuel)", Index: 43
2019-10-29 16:54:52.507 Status: dzVents: Debug: ObserverIP_0.201910181100: Processing device-adapter for LD-WindDir: Wind device adapter
2019-10-29 16:54:52.509 Status: dzVents: Debug: ObserverIP_0.201910181100: Processing device-adapter for LD-inTemp: Temperature device adapter
2019-10-29 16:54:52.510 Status: dzVents: Debug: ObserverIP_0.201910181100: Processing device-adapter for LD-inTempHum: Temperature+humidity device adapter
2019-10-29 16:54:52.512 Status: dzVents: Debug: ObserverIP_0.201910181100: Processing device-adapter for LD-outTemp: Temperature device adapter
2019-10-29 16:54:52.514 Status: dzVents: Debug: ObserverIP_0.201910181100: Processing device-adapter for LD-outTempHum: Temperature+humidity device adapter
2019-10-29 16:54:52.516 Status: dzVents: Debug: ObserverIP_0.201910181100: Processing device-adapter for LD-SolarRad: Solar radiation device adapter
2019-10-29 16:54:52.518 Status: dzVents: Debug: ObserverIP_0.201910181100: Processing device-adapter for LD-Uvi: UV device adapter
2019-10-29 16:54:52.520 Status: dzVents: Debug: ObserverIP_0.201910181100: Processing device-adapter for LD-Rain: Rain device
2019-10-29 16:54:52.521 Status: dzVents: Debug: ObserverIP_0.201910181100: Processing device-adapter for LD-RelPress: Barometer device adapter
2019-10-29 16:54:52.523 Status: dzVents: Debug: ObserverIP_0.201910181100: Processing device-adapter for LD-RainDaily: Custom sensor device adapter
2019-10-29 16:54:52.525 Status: dzVents: Debug: ObserverIP_0.201910181100: Processing device-adapter for LD-RainWeekly: Custom sensor device adapter
2019-10-29 16:54:52.527 Status: dzVents: Debug: ObserverIP_0.201910181100: Processing device-adapter for LD-RainMonthly: Custom sensor device adapter
2019-10-29 16:54:52.528 Status: dzVents: Debug: ObserverIP_0.201910181100: Processing device-adapter for LD-RainYearly: Custom sensor device adapter
2019-10-29 16:54:52.529 Status: dzVents: Debug: ObserverIP_0.201910181100: Processing device-adapter for LD-GustSpeed: Custom sensor device adapter
2019-10-29 16:54:52.530 Status: dzVents: Debug: ObserverIP_0.201910181100: Processing device-adapter for LD-AvgWind: Custom sensor device adapter
2019-10-29 16:54:52.530 Status: dzVents: Error (2.4.19): ObserverIP_0.201910181100: Could not get (good) data from 192.168.1.99
2019-10-29 16:54:52.530 Status: dzVents: Debug: ObserverIP_0.201910181100: nil
2019-10-29 16:54:52.531 Status: dzVents: Info: ObserverIP_0.201910181100: ------ Finished ObserverIP-5.lua
Code: Select all
2019-10-29 16:58:00.925 Status: dzVents: > indoorHumidity: 56
2019-10-29 16:58:00.925 Status: dzVents: > windGust: 12.2
2019-10-29 16:58:00.925 Status: dzVents: > relativePressure: 1021.50
2019-10-29 16:58:00.925 Status: dzVents: > UVI: 0
2019-10-29 16:58:00.925 Status: dzVents: > yearlyRain: 624.60
2019-10-29 16:58:00.925 Status: dzVents: > absolutePressure: 1019.40
2019-10-29 16:58:00.925 Status: dzVents: > monthlyRain: 118.50
2019-10-29 16:58:00.925 Status: dzVents: > weeklyRain: 0.00
2019-10-29 16:58:00.925 Status: dzVents: > windDirection: 46
2019-10-29 16:58:00.925 Status: dzVents: > indoorTemperature: 20.9
2019-10-29 16:58:00.925 Status: dzVents: > solarRadiation: 18.51
2019-10-29 16:58:00.925 Status: dzVents: > dailyRain: 0.00
2019-10-29 16:58:00.925 Status: dzVents: > UV: 73
2019-10-29 16:58:00.925 Status: dzVents: > windSpeed: 10.1
2019-10-29 16:58:00.926 Status: dzVents: > outdoorHumidity: 76
2019-10-29 16:58:00.926 Status: dzVents: > hourlyRainRate: 0.00
2019-10-29 16:58:00.926 Status: dzVents: > outdoorTemperature: 10.4
Code: Select all
Status: dzVents: Error (2.4.19): ObserverIP_0.201910181100: Could not get (good) data from 192.168.1.99
The script now checks if it was triggered by a timer-rule and if not it assumes that it was triggered by a HTTPResponse. Because you changed the trigger in the on = section from timer to devices it does not work as you expect. To enable the script to work on both devices and timers, you will have to change the last couple of lines of the script fromDoudy wrote: ↑Wednesday 30 October 2019 6:54 When I change 'on' as follows:There is the following error code:Code: Select all
... on = { devices = {'WH2600-Wind'}, --mydevice httpResponses = { scriptVar } }, etc ...
For me it's a little too complicated.Code: Select all
Status: dzVents: Error (2.4.19): ObserverIP_0.201910181100: Could not get (good) data from 192.168.1.99
Code: Select all
-- main
if item.isTimer then
checkWebpageResponse()
getWeatherStationData()
elseif item.ok then -- statusCode == 2xx
updateDevices(processHTM(item.data))
else
dz.log('Could not get (good) data from ' .. weatherStationIP,dz.LOG_ERROR)
dz.log(item.data,dz.LOG_DEBUG)
end
end
}
Code: Select all
-- main
if item.isTimer or item.isDevice then
checkWebpageResponse()
getWeatherStationData()
elseif item.ok then -- statusCode == 2xx
updateDevices(processHTM(item.data))
else
dz.log('Could not get (good) data from ' .. weatherStationIP,dz.LOG_ERROR)
dz.log(item.data,dz.LOG_DEBUG)
end
end
}
Code: Select all
2019-11-09 15:40:31.427 Status: dzVents: Error (2.4.19): ObserverIP_0.201910181100: /home/pi/domoticz/scripts/dzVents/scripts/ObserverIP-5.lua:210: bad argument #2 to 'pow' (number expected, got no value)
In the latest posted version (0.201911091100) the string pow does not exits so I guess you test with an old or mixed version. Please try again with this new version.Doudy wrote: ↑Saturday 09 November 2019 15:43Code: Select all
2019-11-09 15:40:31.427 Status: dzVents: Error (2.4.19): ObserverIP_0.201910181100: /home/pi/domoticz/scripts/dzVents/scripts/ObserverIP-5.lua:210: bad argument #2 to 'pow' (number expected, got no value)
Is Version: 4.10717 OK ?
You confuse the domoticz Version with the script version. domoticz V4.10717 is the latest "stable" domoticz version. There are newer ( beta ) versions available but those are not required for using this script.
Users browsing this forum: No registered users and 1 guest