read analoge 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:

read analoge input

Post by HenkSynology »

Hi evryone ,
I have Domoticz on my DS115J Synology server
I have buy a Denkovi print, really great stuff.
You put your print on your local net and it works .
Relays ands digital inputs that works fine.
Image


But i can not read my analoge input in the script.
I lookt several scripts, but i can get the real code.
I have buy some LM35 sensors (very cheap)
This one give 10mV/C
Image
It's 20,5 C
Image

Image

Code: Select all

return {
    active = true,
	logging = {'AI1'},
	on = {timer = { 'every minute' }
	},
	execute = function(dz, item)
	    
    -- local AI1 = dz.devices(66) ......try this don't work
    --domoticz.log('temperatuur = '.. AI1, domoticz.LOG_DEBUG)   ......try this don't work
    --TempAI1= AI1/10   ......try this don't work
    
    local temperatuur = dz.devices("AI1").DAENETIP4
    print (temperatuur)
		
	end
}
this is what i see in the log
Image

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

Re: read analoge input

Post by waaren »

HenkSynology wrote: Tuesday 28 May 2019 8:51 Can you help me :roll:
Can you try this ?

Code: Select all

return {
         on = { timer = { 'every minute' } },
        
        logging =   {   
                        level   = domoticz.LOG_INFO,
                        marker  = 'AI1'
                    },
   
    execute = function(dz, item)
        local AI1 = dz.devices('AI1')
        
        AI1.dump() -- just comment this line if you have seen enough
        dz.log('Data in sValue = '.. AI1.rawData[1], dz.LOG_INFO)

    end
}
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
HenkSynology
Posts: 21
Joined: Tuesday 12 March 2019 17:33
Target OS: Windows
Domoticz version: 1.13191
Location: Stadskanaal, NL
Contact:

Re: read analoge input

Post by HenkSynology »

Waaren it works Image
Thanks a lot for your help.
Your contribution to the forum is really great Image

Thanks thanks thanks
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest