Hi Guys,
Is it possible to log my data readings (temperature and humidity) from Domoticz running on Raspberry Pi into internal folder or to LAN attached NAS storage (no external service). I need just hourly log with time stamp in some kind of text file.I have been searching on forum with no success.
Thanks a lot for suggestions.
Data Logging
Moderators: leecollings, remb0
- michaldobrotka
- Posts: 50
- Joined: Sunday 01 November 2015 17:21
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Contact:
Data Logging
Domoticz on Raspi 3 and slave on ZeroW (running only with Broadlink plugin), Serial Mysensors GW on Arduino nano, Broadlink RM2, Rehau CO2 USB Stick, RF link 433 MHz, 2x Amazon Echo Dot (Controlicz), ESP2866 witk Espeasy, Sonoff
- emme
- Posts: 909
- Joined: Monday 27 June 2016 11:02
- Target OS: Raspberry Pi / ODroid
- Domoticz version: latest
- Location: Milano, Italy
- Contact:
Re: Data Logging
what about a script that write a file?
somthing like:
somthing like:
Code: Select all
return {
on = {
timer = {
'every minutes'
}
},
execute = function(domoticz, device)
local devName = domoticz.devices('myTempHumidDeviceName')
local fileName = '/path/to/folder/filename.csv'
local timeStamp = os.date('*t')
fileOut = io.open(fileName, 'a')
fileOut:write(timeStamp..','..devName.temparature..','..devName.humidity..'\n')
fileOut:close()
end
}
The most dangerous phrase in any language is:
"We always done this way"
"We always done this way"
- michaldobrotka
- Posts: 50
- Joined: Sunday 01 November 2015 17:21
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Contact:
Re: Data Logging
Thanks emme, I will try it.
Domoticz on Raspi 3 and slave on ZeroW (running only with Broadlink plugin), Serial Mysensors GW on Arduino nano, Broadlink RM2, Rehau CO2 USB Stick, RF link 433 MHz, 2x Amazon Echo Dot (Controlicz), ESP2866 witk Espeasy, Sonoff
- michaldobrotka
- Posts: 50
- Joined: Sunday 01 November 2015 17:21
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Contact:
Re: Data Logging
Hi emme,
Checked dzVents and changed your script to :
.csv file was created, but no logs were written after hour.
Am I missing something in script?
Thanks
Checked dzVents and changed your script to :
Code: Select all
return {
on = {
timer = {
'every hour'
}
},
execute = function(domoticz, device)
local devName = domoticz.devices('Terrarium ground')
local fileName = '/home/domoticz/scripts/Datalogger/Terarriumgroundtemp.csv'
local timeStamp = os.date('*t')
fileOut = io.open(fileName, 'a')
fileOut:write(timeStamp..','..devName.temparature..','..devName.humidity..'\n')
fileOut:close()
end
}
Am I missing something in script?
Thanks
Domoticz on Raspi 3 and slave on ZeroW (running only with Broadlink plugin), Serial Mysensors GW on Arduino nano, Broadlink RM2, Rehau CO2 USB Stick, RF link 433 MHz, 2x Amazon Echo Dot (Controlicz), ESP2866 witk Espeasy, Sonoff
- mack
- Posts: 14
- Joined: Friday 08 April 2016 8:23
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Stable
- Location: Dallas, USA
- Contact:
Re: Data Logging
I didn't check your script logic, but wanted to point out for dzVents to be enabled, the checkbox for dzVents needs to be UNchecked.
Who is online
Users browsing this forum: No registered users and 1 guest