temperature sensor LM335Z and analog input

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
User avatar
HenkSynology
Posts: 21
Joined: Tuesday 12 March 2019 17:33
Target OS: Windows
Domoticz version: 1.13191
Location: Stadskanaal, NL
Contact:

temperature sensor LM335Z and analog input

Post by HenkSynology »

Hi evryone,
I have analoge input 0-10000mV
And i have a temperature sensor LM335Z, who gives 10mV/K
I want to now how much Celsius it is.
So.....
C=F-32/1,8

I write a program but is this not oke (??)
See errors in the log
I copy & pasta a lot off stuff and look at other programs :lol:

Code: Select all

local 'Analog Input 1 (AI1)'= 66
return {
    active = true,
	logging = {'Analog Input 1 (AI1)'},
	on = {timer = { 'every minute' }
	},
	fahrenheit1 = 'Analog Input 1 (AI1)'/10
	execute = function(domoticz, device)
	
	celsius1 = fahrenheit-32/1,8
		
		
	end
}


User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: temperature sensor LM335Z and analog input

Post by waaren »

HenkSynology wrote: Tuesday 14 May 2019 15:50 I have analoge input 0-10000mV
And i have a temperature sensor LM335Z, who gives 10mV/K
I want to now how much Celsius it is.
Happy to help but need some more information.
What is the type / subtype of your device in domoticz and what does it show (deg. Fahrenheit or mV or ? )
If you have calculated the Celsius value what do you want to do with it. (show in the log, store it in a variable or show it on a virtual sensor or something else ? )
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest