Page 1 of 1

read analoge input

Posted: Tuesday 28 May 2019 8:51
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:

Re: read analoge input

Posted: Tuesday 28 May 2019 13:14
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
}

Re: read analoge input

Posted: Tuesday 28 May 2019 15:09
by HenkSynology
Waaren it works Image
Thanks a lot for your help.
Your contribution to the forum is really great Image

Thanks thanks thanks