Page 1 of 1

Weerlive.nl

Posted: Wednesday 30 December 2020 13:33
by erijk999
Hallo,

I have the following script running, and would like to add a little more. I am new to this area and could use a little push in the right direction.
I would like to add the following: min and max temperature and wind chill maybe even more later, but with some help from you I would be able to do that.

Code: Select all

-- KNMI weerlive.nl for domoticz
-- KNMI Weergegevens via Weerlive.nl
-- http://weerlive.nl/delen.php
-- add Domoticz forum link later
-- 2019-06-19 initial version

local apiKey = "local apiKey"
local location = "51.9991039,5.6747544"

-- create below devices in Domoticz
-- creat dummy hardware device WEERLIVE and add:
local wind  = 'weerlive wind'        -- wind
local baro  = 'weerlive barometer'   -- Temp + Humidity + Baro
local text  = 'weerlive'             -- text
local verw  = 'weerlive verwachting' -- text
local vis   = 'weerlive visibility'  -- visibility
local twind = 'weerlive twind'       -- text
local alarm = 'weerlive alarm'       -- text

return {
    logging = { 
            -- level = domoticz.LOG_DEBUG -- comment when not in dev
        },
    on = {
        timer = { 'every 10 minutes' },
        httpResponses = { 'get_weerlive' },
    },
    execute = function(dz, item) 
        if item.isTimer then
            dz.log('weerlive started by trigger: ' .. item.trigger, dz.LOG_INFO)

            dz.openURL({
                url = 'http://weerlive.nl/api/json-data-10min.php?key=' .. apiKey .. '&locatie=' .. location,
                method='GET',
                callback='get_weerlive'
            })
        elseif item.isHTTPResponse then

            dz.log('HTTPResponse event was triggered by ' .. item.trigger, dz.LOG_INFO)

            if (not item.ok or not item.isJSON) then
                dz.log('buienRadar call failed', dz.log_ERROR)
                dz.log('responseOK: ' .. tostring(item.ok), dz.LOG_INFO)
                dz.log('statusCode: ' .. item.statusCode, dz.LOG_INFO)
                dz.log('statusText: ' .. item.statusText, dz.LOG_INFO)
                dz.log('json: ', dz.LOG_INFO)
                dz.log(item.json, dz.LOG_INFO)
                return
            end

            if ( not item.json["liveweer"] ) then
                dz.log('weerlive data missing liveweer', dz.LOG_ERROR)
                return
            end

            local wr = { "Noord", "NNO", "NO", "ONO", "Oost", "OZO", "ZO", "ZZO", 
                "Zuid", "ZZW", "ZW", "WZW", "West", "WNW", "NW", "NNW" }            
            function w2d(w)
                for i,v in pairs(wr) do
                    if v == w then
                        return(22.5*(i-1))
                    end
                end
            end          
            function w2e(w)
                local we = { "N", "NNE", "NE", "ENE", "E", "ESE", "SE", "SSE",
                    "S", "SSW", "SW", "WSW", "W", "WNW", "NW", "NNW" }
                for i,v in pairs(wr) do
                    if v == w then
                        return we[i]
                    end
                end
            end


            local wl = item.json["liveweer"][1]
            dz.devices(wind).updateWind(w2d(wl["windr"]),w2e(wl["windr"]),
                wl['windms'],0,wl['temp'],wl['gtemp'])

            function lvstat(lv)
                lv = tonumber(lv)
                if lv < 35 then return dz.HUM_DRY
                elseif 35 < lv and lv < 45 then return dz.HUM_NORMAL
                elseif 45 < lv and lv < 55 then return dz.HUM_COMFORTABLE
                elseif 55 < lv and lv < 65 then return dz.HUM_NORMAL
                else return dz.HUM_WET
                end
            end
            -- dz.BARO_CLOUDY, dz.PARTLYCLOUDY, dz.BARO_STABLE, dz.BARO_SUNNY, 
            -- dz.BARO_THUNDERSTORM, dz.BARO_NOINFO, dz.BARO_UNSTABLE, 
            -- dz.BARO_RAIN
            function ic2fc(ic) 
                if ic == "zonnig" or ic =="helderenacht" then return dz.BARO_SUNNY
                elseif ic == "halfbewolkt" or ic == "mist" 
                    or ic == "nachtmist" then return dz.BARO_PARTLYCLOUDY
                elseif ic == "bewolkt" or ic == "zwaarbewolkt" 
                    or ic == "wolkennacht" then return dz.BARO_CLOUDY
                elseif ic == "regen" or ic == "buien" or ic == "hagel" 
                    or ic == "sneeuw" then return dz.BARO_RAIN
                elseif ic == "bliksem" then return dz.BARO_THUNDERSTORM
                else 
                    dz.log('unknown icon: ' .. ic, dz.LOG_ERROR)
                    return BARO_NOINFO
                end
            end
            dz.devices(baro).updateTempHumBaro(wl["temp"],wl["lv"], 
                lvstat(wl["lv"]), wl['luchtd'], ic2fc(wl['image']))

            local t = nil
            t = wl["samenv"]
            if dz.devices(text).text ~= t then 
                dz.devices(text).updateText(t)
            end
            t = wl["verw"]
            if dz.devices(verw).text ~= t then
                dz.devices(verw).updateText(t)
            end

            dz.devices(vis).updateVisibility(wl['zicht'])

            t = wl["windr"] .. ' ' .. wl["winds"] .. ' Bft'
            if dz.devices(twind).text ~= t then
                dz.devices(twind).updateText(t)
            end

            if wl["alarm"] == "0" then
                t = "no alarms"
            else
                t = wl['alarm'] .. ': ' .. wl['alarmtxt']
            end
            if dz.devices(alarm) ~= t then
                dz.devices(alarm).updateText(t)
            end



        end
    end
}

Re: Weerlive.nl

Posted: Wednesday 30 December 2020 16:18
by kiddigital
I guess that must be possible, but why not use the Domoticz native modules like Buienradar or Open Weather Map (Domoticz Beta version has a very extended OWM module)?

Do you miss anything in these maybe?

Re: Weerlive.nl

Posted: Wednesday 30 December 2020 18:17
by erijk999
owm is not accurate enough for my location and buienradar also has no min and max temperature measurement

Re: Weerlive.nl

Posted: Wednesday 30 December 2020 19:41
by PatrickSt91
Buienradar does have a min and max temperature. It even has max min, min min, and min max and max max.

Nevertheless I'm willing to help you out but I need to see the JSON output from http://weerlive.nl/api/json-data-10min.php?key=


So I can put the info in variables

Re: Weerlive.nl

Posted: Wednesday 30 December 2020 20:06
by erijk999
Hi Patrikst91,


is this what you mean?

{ "liveweer": [{"plaats": "Bennekom", "temp": "3.1", "gtemp": "-0.5", "samenv": "Half bewolkt", "lv": "97", "windr": "ZW", "windms": "4", "winds": "3", "windk": "7.8", "windkmh": "14.4", "luchtd": "1002.9", "ldmmhg": "752", "dauwp": "3", "zicht": "8", "verw": "Enkele buien. Morgen in het zuidoosten kans op natte sneeuw", "sup": "08:42", "sunder": "16:36", "image": "wolkennacht", "d0weer": "bewolkt", "d0tmax": "5", "d0tmin": "0", "d0windk": "3", "d0windknp": "8", "d0windms": "4", "d0windkmh": "15", "d0windr": "Z", "d0neerslag": "17", "d0zon": "7", "d1weer": "halfbewolkt_regen", "d1tmax": "3", "d1tmin": "1", "d1windk": "2", "d1windknp": "4", "d1windms": "2", "d1windkmh": "7", "d1windr": "ZO", "d1neerslag": "50", "d1zon": "20", "d2weer": "bewolkt", "d2tmax": "2", "d2tmin": "-1", "d2windk": "2", "d2windknp": "4", "d2windms": "2", "d2windkmh": "7", "d2windr": "ZW", "d2neerslag": "30", "d2zon": "10", "alarm": "0"}]}

Re: Weerlive.nl

Posted: Wednesday 30 December 2020 20:29
by PatrickSt91
Yep that's what I meant, I'll make something tomorrow.

Gr,
Patrick

Re: Weerlive.nl

Posted: Wednesday 30 December 2020 20:34
by erijk999
Wow PatrickSt91,

Thank you very much

Re: Weerlive.nl

Posted: Wednesday 30 December 2020 21:13
by PatrickSt91
Couldn't wait till tomorrow haha.

So here it is.

Please let me know if it work :)

I added 4;
- Wind chill
- Max temperature
- Min temperature
- Temperature

Code: Select all

-- KNMI weerlive.nl for domoticz
-- KNMI Weergegevens via Weerlive.nl
-- http://weerlive.nl/delen.php
-- add Domoticz forum link later
-- 2019-06-19 initial version
-- 2020-12-30 updated version


local apiKey = "local apiKey"
local location = "51.9991039,5.6747544"

-- create below devices in Domoticz
-- creat dummy hardware device WEERLIVE and add:
local wind  = 'weerlive wind'        -- wind
local baro  = 'weerlive barometer'   -- Temp + Humidity + Baro
local text  = 'weerlive'             -- text
local verw  = 'weerlive verwachting' -- text
local vis   = 'weerlive visibility'  -- visibility
local twind = 'weerlive twind'       -- text
local alarm = 'weerlive alarm'       -- text

-- 2020-12-30 Added temperature
local windc = 'weerlive windchill'	 -- temperature (Windchill) ADDED
local maxtp = 'weerlive maxtemp' 	 -- temperature (Max Temp) ADDED
local mintp = 'weerlive mintemp' 	 -- temperature (Min Temp) ADDED
local tempn = 'weerlive tempnow'	 -- temperature (Temperature) ADDED

return {
    logging = { 
            -- level = domoticz.LOG_DEBUG -- comment when not in dev
        },
    on = {
        timer = { 'every 10 minutes' },
        httpResponses = { 'get_weerlive' },
    },
    execute = function(dz, item) 
        if item.isTimer then
            dz.log('weerlive started by trigger: ' .. item.trigger, dz.LOG_INFO)

            dz.openURL({
                url = 'http://weerlive.nl/api/json-data-10min.php?key=' .. apiKey .. '&locatie=' .. location,
                method='GET',
                callback='get_weerlive'
            })
        elseif item.isHTTPResponse then

            dz.log('HTTPResponse event was triggered by ' .. item.trigger, dz.LOG_INFO)

            if (not item.ok or not item.isJSON) then
                dz.log('buienRadar call failed', dz.log_ERROR)
                dz.log('responseOK: ' .. tostring(item.ok), dz.LOG_INFO)
                dz.log('statusCode: ' .. item.statusCode, dz.LOG_INFO)
                dz.log('statusText: ' .. item.statusText, dz.LOG_INFO)
                dz.log('json: ', dz.LOG_INFO)
                dz.log(item.json, dz.LOG_INFO)
                return
            end

            if ( not item.json["liveweer"] ) then
                dz.log('weerlive data missing liveweer', dz.LOG_ERROR)
                return
            end

            local wr = { "Noord", "NNO", "NO", "ONO", "Oost", "OZO", "ZO", "ZZO", 
                "Zuid", "ZZW", "ZW", "WZW", "West", "WNW", "NW", "NNW" }            
            function w2d(w)
                for i,v in pairs(wr) do
                    if v == w then
                        return(22.5*(i-1))
                    end
                end
            end          
            function w2e(w)
                local we = { "N", "NNE", "NE", "ENE", "E", "ESE", "SE", "SSE",
                    "S", "SSW", "SW", "WSW", "W", "WNW", "NW", "NNW" }
                for i,v in pairs(wr) do
                    if v == w then
                        return we[i]
                    end
                end
            end


            local wl = item.json["liveweer"][1]
            dz.devices(wind).updateWind(w2d(wl["windr"]),w2e(wl["windr"]),
                wl['windms'],0,wl['temp'],wl['gtemp'])

            function lvstat(lv)
                lv = tonumber(lv)
                if lv < 35 then return dz.HUM_DRY
                elseif 35 < lv and lv < 45 then return dz.HUM_NORMAL
                elseif 45 < lv and lv < 55 then return dz.HUM_COMFORTABLE
                elseif 55 < lv and lv < 65 then return dz.HUM_NORMAL
                else return dz.HUM_WET
                end
            end
            -- dz.BARO_CLOUDY, dz.PARTLYCLOUDY, dz.BARO_STABLE, dz.BARO_SUNNY, 
            -- dz.BARO_THUNDERSTORM, dz.BARO_NOINFO, dz.BARO_UNSTABLE, 
            -- dz.BARO_RAIN
            function ic2fc(ic) 
                if ic == "zonnig" or ic =="helderenacht" then return dz.BARO_SUNNY
                elseif ic == "halfbewolkt" or ic == "mist" 
                    or ic == "nachtmist" then return dz.BARO_PARTLYCLOUDY
                elseif ic == "bewolkt" or ic == "zwaarbewolkt" 
                    or ic == "wolkennacht" then return dz.BARO_CLOUDY
                elseif ic == "regen" or ic == "buien" or ic == "hagel" 
                    or ic == "sneeuw" then return dz.BARO_RAIN
                elseif ic == "bliksem" then return dz.BARO_THUNDERSTORM
                else 
                    dz.log('unknown icon: ' .. ic, dz.LOG_ERROR)
                    return BARO_NOINFO
                end
            end
            dz.devices(baro).updateTempHumBaro(wl["temp"],wl["lv"], 
                lvstat(wl["lv"]), wl['luchtd'], ic2fc(wl['image']))

            local t = nil
            t = wl["samenv"]
            if dz.devices(text).text ~= t then 
                dz.devices(text).updateText(t)
            end
            t = wl["verw"]
            if dz.devices(verw).text ~= t then
                dz.devices(verw).updateText(t)
            end

            dz.devices(vis).updateVisibility(wl['zicht'])

            t = wl["windr"] .. ' ' .. wl["winds"] .. ' Bft'
            if dz.devices(twind).text ~= t then
                dz.devices(twind).updateText(t)
            end

            if wl["alarm"] == "0" then
                t = "no alarms"
            else
                t = wl['alarm'] .. ': ' .. wl['alarmtxt']
            end
            if dz.devices(alarm) ~= t then
                dz.devices(alarm).updateText(t)
            end

		-- 2020-12-30 Added temperature
		dz.devices(windc).updateTemperature(wl['gtemp'])
		dz.devices(maxtp).updateTemperature(wl['d0tmax'])
		dz.devices(mintp).updateTemperature(wl['d0tmin'])
		dz.devices(tempn).updateTemperature(wl['temp'])
			
        end
    end
}
Gr,
Patrick

Re: Weerlive.nl  [Solved]

Posted: Wednesday 30 December 2020 21:33
by erijk999
Hi Patrikst91,

works well
Super thanks

Re: Weerlive.nl

Posted: Wednesday 30 December 2020 21:43
by PatrickSt91
Okay great to hear, enjoy!

Re: Weerlive.nl

Posted: Friday 15 January 2021 11:57
by mikkelnl
Hi guys... I'd like to send an e-mail whenever the text changes for the 'general text' device that contains the 'weerbericht' content. Is this possible? I think it will need some scripting, and since I am fine editing/tweaking, I am not able to script such a thing myself ;-)

Re: Weerlive.nl

Posted: Friday 15 January 2021 12:42
by waaren
mikkelnl wrote: Friday 15 January 2021 11:57 Hi guys... I'd like to send an e-mail whenever the text changes for the 'general text' device that contains the 'weerbericht' content. Is this possible? I think it will need some scripting, and since I am fine editing/tweaking, I am not able to script such a thing myself ;-)
Can you try with this?

Code: Select all

-- KNMI weerlive.nl for domoticz
-- KNMI Weergegevens via Weerlive.nl
-- http://weerlive.nl/delen.php
-- add Domoticz forum link later
-- 2019-06-19 initial version
-- 2020-12-30 updated version
-- 2021-01-15 Added Email


local apiKey = "local apiKey"
local location = "51.9991039,5.6747544"

-- create below devices in Domoticz
-- creat dummy hardware device WEERLIVE and add:
local wind  = 'weerlive wind'        -- wind
local baro  = 'weerlive barometer'   -- Temp + Humidity + Baro
local text  = 'weerlive'             -- text
local verw  = 'weerlive verwachting' -- text
local vis   = 'weerlive visibility'  -- visibility
local twind = 'weerlive twind'       -- text
local alarm = 'weerlive alarm'       -- text

-- 2020-12-30 Added temperature
local windc = 'weerlive windchill'	 -- temperature (Windchill) ADDED
local maxtp = 'weerlive maxtemp' 	 -- temperature (Max Temp) ADDED
local mintp = 'weerlive mintemp' 	 -- temperature (Min Temp) ADDED
local tempn = 'weerlive tempnow'	 -- temperature (Temperature) ADDED

local email = '[email protected]' -- set to false if you don't want an Email
 
return {
    logging = { 
            -- level = domoticz.LOG_DEBUG -- comment when not in dev
        },
    on = {
        timer = { 'every 10 minutes' },
        httpResponses = { 'get_weerlive' },
    },
    execute = function(dz, item) 
        if item.isTimer then
            dz.log('weerlive started by trigger: ' .. item.trigger, dz.LOG_INFO)

            dz.openURL({
                url = 'http://weerlive.nl/api/json-data-10min.php?key=' .. apiKey .. '&locatie=' .. location,
                method='GET',
                callback='get_weerlive'
            })
        elseif item.isHTTPResponse then

            dz.log('HTTPResponse event was triggered by ' .. item.trigger, dz.LOG_INFO)

            if (not item.ok or not item.isJSON) then
                dz.log('Weerlive call failed', dz.log_ERROR)
                dz.log('responseOK: ' .. tostring(item.ok), dz.LOG_INFO)
                dz.log('statusCode: ' .. item.statusCode, dz.LOG_INFO)
                dz.log('statusText: ' .. item.statusText, dz.LOG_INFO)
                dz.log('json: ', dz.LOG_INFO)
                dz.log(item.json, dz.LOG_INFO)
                return
            end

            if ( not item.json["liveweer"] ) then
                dz.log('weerlive data missing liveweer', dz.LOG_ERROR)
                return
            end

            local wr = { "Noord", "NNO", "NO", "ONO", "Oost", "OZO", "ZO", "ZZO", 
                "Zuid", "ZZW", "ZW", "WZW", "West", "WNW", "NW", "NNW" }            
            function w2d(w)
                for i,v in pairs(wr) do
                    if v == w then
                        return(22.5*(i-1))
                    end
                end
            end          
            function w2e(w)
                local we = { "N", "NNE", "NE", "ENE", "E", "ESE", "SE", "SSE",
                    "S", "SSW", "SW", "WSW", "W", "WNW", "NW", "NNW" }
                for i,v in pairs(wr) do
                    if v == w then
                        return we[i]
                    end
                end
            end


            local wl = item.json["liveweer"][1]
            dz.devices(wind).updateWind(w2d(wl["windr"]),w2e(wl["windr"]),
                wl['windms'],0,wl['temp'],wl['gtemp'])

            function lvstat(lv)
                lv = tonumber(lv)
                if lv < 35 then return dz.HUM_DRY
                elseif 35 < lv and lv < 45 then return dz.HUM_NORMAL
                elseif 45 < lv and lv < 55 then return dz.HUM_COMFORTABLE
                elseif 55 < lv and lv < 65 then return dz.HUM_NORMAL
                else return dz.HUM_WET
                end
            end
            -- dz.BARO_CLOUDY, dz.PARTLYCLOUDY, dz.BARO_STABLE, dz.BARO_SUNNY, 
            -- dz.BARO_THUNDERSTORM, dz.BARO_NOINFO, dz.BARO_UNSTABLE, 
            -- dz.BARO_RAIN
            function ic2fc(ic) 
                if ic == "zonnig" or ic =="helderenacht" then return dz.BARO_SUNNY
                elseif ic == "halfbewolkt" or ic == "mist" 
                    or ic == "nachtmist" then return dz.BARO_PARTLYCLOUDY
                elseif ic == "bewolkt" or ic == "zwaarbewolkt" 
                    or ic == "wolkennacht" then return dz.BARO_CLOUDY
                elseif ic == "regen" or ic == "buien" or ic == "hagel" 
                    or ic == "sneeuw" then return dz.BARO_RAIN
                elseif ic == "bliksem" then return dz.BARO_THUNDERSTORM
                else 
                    dz.log('unknown icon: ' .. ic, dz.LOG_ERROR)
                    return BARO_NOINFO
                end
            end
            dz.devices(baro).updateTempHumBaro(wl["temp"],wl["lv"], 
                lvstat(wl["lv"]), wl['luchtd'], ic2fc(wl['image']))

            local t = nil
            t = wl["samenv"]
            if dz.devices(text).text ~= t then 
                dz.devices(text).updateText(t)
                if email then dz.email('Weerbericht', t, email) end
            end
            t = wl["verw"]
            if dz.devices(verw).text ~= t then
                dz.devices(verw).updateText(t)
            end

            dz.devices(vis).updateVisibility(wl['zicht'])

            t = wl["windr"] .. ' ' .. wl["winds"] .. ' Bft'
            if dz.devices(twind).text ~= t then
                dz.devices(twind).updateText(t)
            end

            if wl["alarm"] == "0" then
                t = "no alarms"
            else
                t = wl['alarm'] .. ': ' .. wl['alarmtxt']
            end
            if dz.devices(alarm) ~= t then
                dz.devices(alarm).updateText(t)
            end

		-- 2020-12-30 Added temperature
		dz.devices(windc).updateTemperature(wl['gtemp'])
		dz.devices(maxtp).updateTemperature(wl['d0tmax'])
		dz.devices(mintp).updateTemperature(wl['d0tmin'])
		dz.devices(tempn).updateTemperature(wl['temp'])
			
        end
    end
}

Re: Weerlive.nl

Posted: Friday 15 January 2021 13:23
by erem
@waaren
copy/paste got you again :D :D

>> dz.log('buienRadar call failed', dz.log_ERROR)

Re: Weerlive.nl

Posted: Friday 15 January 2021 14:27
by waaren
erem wrote: Friday 15 January 2021 13:23 copy/paste got you again :D :D

>> dz.log('buienRadar call failed', dz.log_ERROR)
Thx, ...but I haven't touched that part so it was already in the script. Nevertheless I will correct it in my post.

Re: Weerlive.nl

Posted: Saturday 16 January 2021 13:55
by mikkelnl
waaren wrote: Friday 15 January 2021 12:42
mikkelnl wrote: Friday 15 January 2021 11:57 Hi guys... I'd like to send an e-mail whenever the text changes for the 'general text' device that contains the 'weerbericht' content. Is this possible? I think it will need some scripting, and since I am fine editing/tweaking, I am not able to script such a thing myself ;-)
Can you try with this?

Code: Select all

-- KNMI weerlive.nl for domoticz
-- KNMI Weergegevens via Weerlive.nl
-- http://weerlive.nl/delen.php
-- add Domoticz forum link later
-- 2019-06-19 initial version
-- 2020-12-30 updated version
-- 2021-01-15 Added Email


local apiKey = "local apiKey"
local location = "51.9991039,5.6747544"

-- create below devices in Domoticz
-- creat dummy hardware device WEERLIVE and add:
local wind  = 'weerlive wind'        -- wind
local baro  = 'weerlive barometer'   -- Temp + Humidity + Baro
local text  = 'weerlive'             -- text
local verw  = 'weerlive verwachting' -- text
local vis   = 'weerlive visibility'  -- visibility
local twind = 'weerlive twind'       -- text
local alarm = 'weerlive alarm'       -- text

-- 2020-12-30 Added temperature
local windc = 'weerlive windchill'	 -- temperature (Windchill) ADDED
local maxtp = 'weerlive maxtemp' 	 -- temperature (Max Temp) ADDED
local mintp = 'weerlive mintemp' 	 -- temperature (Min Temp) ADDED
local tempn = 'weerlive tempnow'	 -- temperature (Temperature) ADDED

local email = '[email protected]' -- set to false if you don't want an Email
 
return {
    logging = { 
            -- level = domoticz.LOG_DEBUG -- comment when not in dev
        },
    on = {
        timer = { 'every 10 minutes' },
        httpResponses = { 'get_weerlive' },
    },
    execute = function(dz, item) 
        if item.isTimer then
            dz.log('weerlive started by trigger: ' .. item.trigger, dz.LOG_INFO)

            dz.openURL({
                url = 'http://weerlive.nl/api/json-data-10min.php?key=' .. apiKey .. '&locatie=' .. location,
                method='GET',
                callback='get_weerlive'
            })
        elseif item.isHTTPResponse then

            dz.log('HTTPResponse event was triggered by ' .. item.trigger, dz.LOG_INFO)

            if (not item.ok or not item.isJSON) then
                dz.log('Weerlive call failed', dz.log_ERROR)
                dz.log('responseOK: ' .. tostring(item.ok), dz.LOG_INFO)
                dz.log('statusCode: ' .. item.statusCode, dz.LOG_INFO)
                dz.log('statusText: ' .. item.statusText, dz.LOG_INFO)
                dz.log('json: ', dz.LOG_INFO)
                dz.log(item.json, dz.LOG_INFO)
                return
            end

            if ( not item.json["liveweer"] ) then
                dz.log('weerlive data missing liveweer', dz.LOG_ERROR)
                return
            end

            local wr = { "Noord", "NNO", "NO", "ONO", "Oost", "OZO", "ZO", "ZZO", 
                "Zuid", "ZZW", "ZW", "WZW", "West", "WNW", "NW", "NNW" }            
            function w2d(w)
                for i,v in pairs(wr) do
                    if v == w then
                        return(22.5*(i-1))
                    end
                end
            end          
            function w2e(w)
                local we = { "N", "NNE", "NE", "ENE", "E", "ESE", "SE", "SSE",
                    "S", "SSW", "SW", "WSW", "W", "WNW", "NW", "NNW" }
                for i,v in pairs(wr) do
                    if v == w then
                        return we[i]
                    end
                end
            end


            local wl = item.json["liveweer"][1]
            dz.devices(wind).updateWind(w2d(wl["windr"]),w2e(wl["windr"]),
                wl['windms'],0,wl['temp'],wl['gtemp'])

            function lvstat(lv)
                lv = tonumber(lv)
                if lv < 35 then return dz.HUM_DRY
                elseif 35 < lv and lv < 45 then return dz.HUM_NORMAL
                elseif 45 < lv and lv < 55 then return dz.HUM_COMFORTABLE
                elseif 55 < lv and lv < 65 then return dz.HUM_NORMAL
                else return dz.HUM_WET
                end
            end
            -- dz.BARO_CLOUDY, dz.PARTLYCLOUDY, dz.BARO_STABLE, dz.BARO_SUNNY, 
            -- dz.BARO_THUNDERSTORM, dz.BARO_NOINFO, dz.BARO_UNSTABLE, 
            -- dz.BARO_RAIN
            function ic2fc(ic) 
                if ic == "zonnig" or ic =="helderenacht" then return dz.BARO_SUNNY
                elseif ic == "halfbewolkt" or ic == "mist" 
                    or ic == "nachtmist" then return dz.BARO_PARTLYCLOUDY
                elseif ic == "bewolkt" or ic == "zwaarbewolkt" 
                    or ic == "wolkennacht" then return dz.BARO_CLOUDY
                elseif ic == "regen" or ic == "buien" or ic == "hagel" 
                    or ic == "sneeuw" then return dz.BARO_RAIN
                elseif ic == "bliksem" then return dz.BARO_THUNDERSTORM
                else 
                    dz.log('unknown icon: ' .. ic, dz.LOG_ERROR)
                    return BARO_NOINFO
                end
            end
            dz.devices(baro).updateTempHumBaro(wl["temp"],wl["lv"], 
                lvstat(wl["lv"]), wl['luchtd'], ic2fc(wl['image']))

            local t = nil
            t = wl["samenv"]
            if dz.devices(text).text ~= t then 
                dz.devices(text).updateText(t)
                if email then dz.email('Weerbericht', t, email) end
            end
            t = wl["verw"]
            if dz.devices(verw).text ~= t then
                dz.devices(verw).updateText(t)
            end

            dz.devices(vis).updateVisibility(wl['zicht'])

            t = wl["windr"] .. ' ' .. wl["winds"] .. ' Bft'
            if dz.devices(twind).text ~= t then
                dz.devices(twind).updateText(t)
            end

            if wl["alarm"] == "0" then
                t = "no alarms"
            else
                t = wl['alarm'] .. ': ' .. wl['alarmtxt']
            end
            if dz.devices(alarm) ~= t then
                dz.devices(alarm).updateText(t)
            end

		-- 2020-12-30 Added temperature
		dz.devices(windc).updateTemperature(wl['gtemp'])
		dz.devices(maxtp).updateTemperature(wl['d0tmax'])
		dz.devices(mintp).updateTemperature(wl['d0tmin'])
		dz.devices(tempn).updateTemperature(wl['temp'])
			
        end
    end
}
Thanks, did not get an email :( is there a log to check?

edit: Never mind, my bad, works fine, thanks!