Page 1 of 1

Wierd temp sensor question

Posted: Sunday 17 July 2016 10:03
by minionbob
Hi,

I am new here but i am enjoying the software up till now.
I do have something weird happen and was wondering if i made a config error or i just have buggy equipment.

I currently run Domoticz on a Raspberry Pi with a RFXCom. The system runs really well and everything works as expected except my temperature sensors.
I have two temperature sensors from Ventus (WS155). One is on the roof of my house, combined with wind direction and speed, and one is in my computer room. The one in my computer room has a display on it. When it says 50C on Domoticz it does show the proper temp on the display of the sensor.
Every once in a while the temperature just jumps from around 24C to 50+C. It is always between that range. I must say if my computer room were to reach 50C i think i will need to move or something. haha
Is this a configuration error or are my sensors both just buggy?
By the way both sensors display the same behavior.

I hope someone has some ideas.
Thanks

Re: Wierd temp sensor question

Posted: Sunday 24 July 2016 8:12
by mrf68
Hi,

I have a similar problem with one of my temperature sensors. When it get below 0 degrees Celcius, in Domoticz it shows -25.6 degrees. So I use the 'sensorwu' script from the wiki and added a check, so when it reads -25.6 or lower it adds +25.6 to the value.

Code: Select all

if
	devicechanged[sensorwu] and
	tonumber(sWeatherTemp) < -25.6
then
	sWeatherTemp = sWeatherTemp + 25.6
	commandArray['UpdateDevice'] = 579 .. '|0|' .. tostring(sWeatherTemp)
	
elseif
	devicechanged[sensorwu]
then
	commandArray['UpdateDevice'] = 579 .. '|0|' .. tostring(sWeatherTemp)
end

Re: Wierd temp sensor question

Posted: Sunday 24 July 2016 17:47
by minionbob
Hi,

Thanks for your reply.
any chance you can post your complete LUA scipt?
i keep getting a error saying:

attempt to compare nil with number

i must admit i am new to lua but my gut feeling says i should be reading the current temp somewhere before i try to edit it.
any thought?

Re: Wierd temp sensor question

Posted: Monday 25 July 2016 7:31
by mrf68
Sure I can post the complete script.

Code: Select all


local sensorwu = 'Temp veranda via LAN' --name of the sensor that gets created when you add the WU device (and that contains multiple values like temperature, humidity, barometer etc)
local idx = 579 --idx of the virtual temperature sensor you created
commandArray = {}
 
if 
	devicechanged[sensorwu] 
then
	sWeatherTemp, sWeatherHumidity, sWeatherPressure = otherdevices_svalues[sensorwu]:match("([^;]+);([^;]+);([^;]+)")
	sWeatherTemp = tonumber(sWeatherTemp)
end


if
	devicechanged[sensorwu] and
	tonumber(sWeatherTemp) < -25.6
then
	sWeatherTemp = sWeatherTemp + 25.6
	commandArray['UpdateDevice'] = idx .. '|0|' .. tostring(sWeatherTemp)
	
elseif
	devicechanged[sensorwu]
then
	commandArray['UpdateDevice'] = idx .. '|0|' .. tostring(sWeatherTemp)
end

return commandArray
What it does, is get the values from the real sensor and passes the temperature to the virtual temp sensor. So you first need to create a virtual temp sensor, put the idx of this new sensor in the script. Remember to change the name of the real sensor in the script with the name of your own sensor. And save it in the LUA dir with the name script_device_something.lua.

More info in the wiki: https://www.domoticz.com/wiki/Virtual_weather_devices

I hope this will help you a bit more.

Re: Wierd temp sensor question

Posted: Saturday 30 July 2016 19:38
by CurrentThread
Maybe updating the RFXCom firmware helps, see: viewtopic.php?f=28&t=12787

Re: Wierd temp sensor question

Posted: Sunday 07 August 2016 10:51
by minionbob
@CurrentThread: Thanks. i put the EXT2 firmware on the RFXCOM and that solved it.
Super!