Hi,
Thanks a lot, I expected that... Unfortunatelly, there is nothing in the log (I have also attached full script as used below):
2019-05-02 09:31:00.405 Status: dzVents: Info: ------ Start internal script: Post_influx_data:, trigger: every 1 minutes
2019-05-02 09:31:00.427 Status: dzVents: Info: Zapisuji do influx teplota venek
2019-05-02 09:31:00.427 Status: dzVents: Info: Zapisuji do influxdb teploty konec
2019-05-02 09:31:00.427 Status: dzVents: Info: TEMP Cels
2019-05-02 09:31:00.428 Status: dzVents: Info: 17.2
2019-05-02 09:31:00.428 Status: dzVents: Info: HUM
2019-05-02 09:31:00.428 Status: dzVents: Info: 68
2019-05-02 09:31:00.428 Status: dzVents: Info: TFA_sensor temp=17.2,hum=68
2019-05-02 09:31:00.428 Status: dzVents: Info: Zapsano do influxdb
2019-05-02 09:31:00.429 Status: dzVents: Info: ------ Finished Post_influx_data
2019-05-02 09:31:00.429 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
2019-05-02 09:31:00.465 Error: Error opening url:
http://127.0.0.1:8086/write?db=testd&u= ... ecision=ms
2019-05-02 09:31:00.558 Status: dzVents: Info: Handling httpResponse-events for: "mycallbackstring
2019-05-02 09:31:00.558 Status: dzVents: Info: ------ Start internal script: Post_influx_data: HTTPResponse: "mycallbackstring"
2019-05-02 09:31:00.563 Status: dzVents: !Info: return from influxDB:
2019-05-02 09:31:00.564 Status: dzVents: Info: ------ Finished Post_influx_data
Code: Select all
return {
on = {
timer = {'Every 1 minutes'},
--devices = {'Teplota_venku_TFA'},
httpResponses = {'mycallbackstring'}
},
data = {
},
logger = {},
execute = function(domoticz, item)
--basic url settings
--URL =
if item.isTimer and (domoticz.devices('Teplota_venku_TFA').temperature > -40 and domoticz.devices('Teplota_venku_TFA').temperature < 50 and domoticz.devices('Teplota_venku_TFA').humidity > 0 and domoticz.devices('Teplota_venku_TFA').humidity <= 100) then
domoticz.log('Zapisuji do influx teplota venek')
TEMP_CELS = domoticz.devices('Teplota_venku_TFA').temperature
TEMP_CELS = domoticz.utils.round (TEMP_CELS,3)
HUM = domoticz.devices('Teplota_venku_TFA').humidity
domoticz.log('Zapisuji do influxdb teploty konec')
domoticz.log('TEMP Cels ')
domoticz.log(TEMP_CELS)
domoticz.log('HUM ')
domoticz.log(HUM)
domoticz.openURL({
url = 'http://127.0.0.1:8086/write?db=testd&u=tester&p=xxxx&precision=ms',
method = 'POST',
headers = 'application/x-www-form-urlencoded',
callback = 'mycallbackstring',
postData = 'TFA_sensor temp=' .. TEMP_CELS .. ',hum=' .. HUM
})
domoticz.log('TFA_sensor temp=' .. TEMP_CELS .. ',hum='.. HUM)
domoticz.log('Zapsano do influxdb')
elseif (item.isHTTPResponse) then
domoticz.log("return from influxDB: " .. item.data,domoticz.LOG_FORCE)
end
end
}