Wind speed script

Moderator: leecollings

desertdog
Posts: 84
Joined: Sunday 14 August 2016 13:45
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.1
Location: Netherlands
Contact:

Wind speed script

Post by desertdog »

I get my weather information from DarkSky and Buienradar. The both give wind information like this:
152.00;SSE;85;97;17.7;17.7 , meaning 152 SSE, Speed 30,6, Gust 34,9 ~Temp 17,7, Chill 17,7

I recently got electric sunscreens. They are not (yet) operated by Domoticz, but I would like to do so in the future.
For now I just want a notification when the wind speed get above a certain KM/H so i know when to put the sunscreens up.
Is there a wat to isolate the windspeed and/or windgust to a device value so i can use it as a trigger?
The script i found so far doesnt really seem to work or help. In blockly the values are not good either since the whole value '152.00;SSE;85;97;17.7;17.7' is the variable and not just the windspeed
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Wind speed script

Post by waaren »

desertdog wrote: Thursday 25 April 2019 14:14 I get my weather information from DarkSky and Buienradar. The both give wind information like this:
152.00;SSE;85;97;17.7;17.7 , meaning 152 SSE, Speed 30,6, Gust 34,9 ~Temp 17,7, Chill 17,7
I just want a notification when the wind speed get above a certain KM/H so i know when to put the sunscreens up.
Is there a wat to isolate the windspeed and/or windgust to a device value so i can use it as a trigger?
You could use the function in this example to extract Speed and Gust from the wind information.

Code: Select all

local function extractWind(wind) -- 
    t={}
    for value in wind:gmatch("[^;]+") do -- split string and insert 
        table.insert(t, value) -- results in table
    end
    return t[3],t[4]
end

local windSpeed, gust = extractWind(windVar)
print (windSpeed)
print (gust)
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
desertdog
Posts: 84
Joined: Sunday 14 August 2016 13:45
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.1
Location: Netherlands
Contact:

Re: Wind speed script

Post by desertdog »

When I Try that i get:
Error: EventSystem: in Script #1: [string "local function extractWind(wind) -- ..."]:3: attempt to index local 'wind' (a nil value)
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Wind speed script

Post by waaren »

desertdog wrote:When I Try that i get:
Error: EventSystem: in Script #1: [string "local function extractWind(wind) -- ..."]:3: attempt to index local 'wind' (a nil value)
Best to share the complete script. That might help in identifying what's causing the issue




Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
desertdog
Posts: 84
Joined: Sunday 14 August 2016 13:45
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.1
Location: Netherlands
Contact:

Re: Wind speed script

Post by desertdog »

The script is used is exactly what you posted
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Wind speed script

Post by waaren »

desertdog wrote: Friday 26 April 2019 14:12 The script is used is exactly what you posted
Ok what I posted was just the required function to extract windspeed and gust.

Happy to help you further but then I need some extra information.

What is the devicename of the device that contains the complete wind information now?
Which devices (Names / types /subtypes ) should receive the windspeed / gust values?

My preference would be to use dzVents. Would that work for you ?
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Toulon7559
Posts: 859
Joined: Sunday 23 February 2014 17:56
Target OS: Raspberry Pi / ODroid
Domoticz version: <2025
Location: Hengelo(Ov)/NL
Contact:

Re: Wind speed script

Post by Toulon7559 »

Other approach to get specific values from an input.
Buienradar is not a selection under Domoticz/Setup/Hardware, but DarkSky, AccuWeather and OpenWeatherMap are available.
Selecting those you get a Device with related svalues.
You can direct the extraction of a specific element from a Device or from the related svaluestring.
The svaluestring has a sequence-layout according to Domoticz' JSON/API-structure
Example script-lines for both methods for extractions by a lua-script for wind_info from svalues related to TFA_Nexus and to WS7000:
the simpler 'Nexus-approach' is working for external sources like Accuweather.
Sometimes a bit of experiment is required to find the effective way for extraction for a specific device.
Probably dzVents has similar functional capabilites.

Code: Select all

-- Line a1, Definition of input-devices
Wind1 = '<name of Domoticz' device1>'
Wind2 = '<name of Domoticz' device2>' 

-- Line x1, Read-out (direct) of Wind information from TFA_Nexus as input Wind1
    if Wind1 ~= '' then
        sWB1 = tonumber(otherdevices_winddir[Wind1])
        sWS1 = tonumber(otherdevices_windspeed[Wind1])
        sWG1 = tonumber(otherdevices_windgust[Wind1])
--   print('sWB1 = ' .. sWB1); print('sWS1 = ' .. sWS1); print('sWG1 = ' .. sWG1)
    end
-- Line x2, Read-out from svalues of Wind information from WS7000 as input-device Wind2
    if Wind2 ~= '' then
        sWB2, sWD2, sWS2, sWG2, sWT2, sWC2 = otherdevices_svalues[Wind2]:match("([^;]+);([^;]+);([^;]+);([^;]+);([^;]+);([^;]+)")
        sWB2= tonumber(sWB2)
        sWS2= tonumber(sWS2)
        sWG2= tonumber(sWG2)
--   print('sWB2 = ' .. sWB2); print('sWS2 = ' .. sWS2); print('sWG2 = ' .. sWG2)
    end
Last edited by Toulon7559 on Friday 26 April 2019 15:27, edited 5 times in total.
Set1 = RPI-Zero+RFXCom433+S0PCM+Shield for BMP180/DS18B20/RS485+DDS238-1ZNs
Set2 = RPI-3A++RFLinkGTW+ESP8266s+PWS_WS7000
Common = KAKUs+3*PVLogger+PWS_TFA_Nexus
plus series of 'satellites' for dedicated interfacing, monitoring & control.
desertdog
Posts: 84
Joined: Sunday 14 August 2016 13:45
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.1
Location: Netherlands
Contact:

Re: Wind speed script

Post by desertdog »

these are my 'wind' devices
558 DarkSky 0001 0 Wind Wind TFA 251.00;WSW;44;63;16.8;16.8
622 Buienradar 000F0006 6 Buienradar - Wind Wind TFA 223.0;SW;54;84;15.9;15.9

The windspeed value also need to be put in a device I think so i can use it in for example a blockly script. if speed > x, send message
Last edited by desertdog on Friday 26 April 2019 14:49, edited 1 time in total.
Toulon7559
Posts: 859
Joined: Sunday 23 February 2014 17:56
Target OS: Raspberry Pi / ODroid
Domoticz version: <2025
Location: Hengelo(Ov)/NL
Contact:

Re: Wind speed script

Post by Toulon7559 »

The label 'TFA' in the strings seems a clear hint that lua-extraction according to my 'Nexus'-approach could work.
Comparable dzVents-function should work as well.

In Blockly You can find the DarkSky-info under Devices/Weather:
click the small down-arrow at rightside of the appearing window to get the list of sub-elements.
Last edited by Toulon7559 on Friday 26 April 2019 14:59, edited 1 time in total.
Set1 = RPI-Zero+RFXCom433+S0PCM+Shield for BMP180/DS18B20/RS485+DDS238-1ZNs
Set2 = RPI-3A++RFLinkGTW+ESP8266s+PWS_WS7000
Common = KAKUs+3*PVLogger+PWS_TFA_Nexus
plus series of 'satellites' for dedicated interfacing, monitoring & control.
desertdog
Posts: 84
Joined: Sunday 14 August 2016 13:45
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.1
Location: Netherlands
Contact:

Re: Wind speed script

Post by desertdog »

I tried your script and replaced the first lines with
Wind1 = 'DarkSky'
Wind2 = 'Buienradar'

leads to:
2019-04-26 14:52:10.641 Error: EventSystem: in Script #1: [string "-- ..."]:15: attempt to index field '?' (a nil value)
Toulon7559
Posts: 859
Joined: Sunday 23 February 2014 17:56
Target OS: Raspberry Pi / ODroid
Domoticz version: <2025
Location: Hengelo(Ov)/NL
Contact:

Re: Wind speed script

Post by Toulon7559 »

Sorry, in 1st version of the example code the first scriptline was --
Apparently 'not appreciated' by the debugger => error
That 'wrong' scriptline should be removed.
Set1 = RPI-Zero+RFXCom433+S0PCM+Shield for BMP180/DS18B20/RS485+DDS238-1ZNs
Set2 = RPI-3A++RFLinkGTW+ESP8266s+PWS_WS7000
Common = KAKUs+3*PVLogger+PWS_TFA_Nexus
plus series of 'satellites' for dedicated interfacing, monitoring & control.
desertdog
Posts: 84
Joined: Sunday 14 August 2016 13:45
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.1
Location: Netherlands
Contact:

Re: Wind speed script

Post by desertdog »

when i remove the firs line with --

i still get
2019-04-26 15:08:54.951 Error: EventSystem: in Script #1: [string "-- Line a1, Definition of input-devices..."]:14: attempt to index field '?' (a nil value)
Toulon7559
Posts: 859
Joined: Sunday 23 February 2014 17:56
Target OS: Raspberry Pi / ODroid
Domoticz version: <2025
Location: Hengelo(Ov)/NL
Contact:

Re: Wind speed script

Post by Toulon7559 »

My mistake with wrong interpretation of the error-message.
The error is not in the 1st line of the script-segment, but later in the script!
The first error-report points to scriptline 15 and the next error-report (after removal of the first scriptline) points to scriptline 14.
Exactly the reason for my warning that sometimes some experiment is required to find the working variant.
For DarkSky and Buienradar apparently you must apply in both cases the structure in the first segment starting at Line x1, NOT the segment starting at Line x2.
Below script-version should be an improvement:
with the added 'head&tail' it should run without error-reports (I hope).

Code: Select all

-- Line 1= Start of commandArray
commandArray = {}
print ('Start of example script for data-extraction')

-- Line 5, Definition of input-devices
Wind1 = 'DarkSky'
Wind2 = 'Buienradar' 

-- Line 9, Read-out (direct) of Wind information from DarkSky as input Wind1
if Wind1 ~= '' then
        sWB1 = tonumber(otherdevices_winddir[Wind1])
        sWS1 = tonumber(otherdevices_windspeed[Wind1])
        sWG1 = tonumber(otherdevices_windgust[Wind1])
--   print('sWB1 = ' .. sWB1); print('sWS1 = ' .. sWS1); print('sWG1 = ' .. sWG1)
end

-- Line 17, Read-out (direct) of Wind information from Buienradar as input Wind2
if Wind2 ~= '' then
        sWB2 = tonumber(otherdevices_winddir[Wind2])
        sWS2 = tonumber(otherdevices_windspeed[Wind2])
        sWG2 = tonumber(otherdevices_windgust[Wind2])
--   print('sWB2 = ' .. sWB2); print('sWS2 = ' .. sWS2); print('sWG2 = ' .. sWG2)
end

-- Line 25, Here you can insert scriptlines for all subsequent actions to be performed by your lua-script
    
print ('End of example script')
return commandArray
Last edited by Toulon7559 on Friday 26 April 2019 16:05, edited 8 times in total.
Set1 = RPI-Zero+RFXCom433+S0PCM+Shield for BMP180/DS18B20/RS485+DDS238-1ZNs
Set2 = RPI-3A++RFLinkGTW+ESP8266s+PWS_WS7000
Common = KAKUs+3*PVLogger+PWS_TFA_Nexus
plus series of 'satellites' for dedicated interfacing, monitoring & control.
desertdog
Posts: 84
Joined: Sunday 14 August 2016 13:45
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.1
Location: Netherlands
Contact:

Re: Wind speed script

Post by desertdog »

When i try that script (fixed the typo in DarkSky)

Code: Select all

-- Line 1, Definition of input-devices
Wind1 = 'DarkSky'
Wind2 = 'Buienradar' 

-- Line 5, Read-out (direct) of Wind information from DarkSky as input Wind1
    if Wind1 ~= '' then
        sWB1 = tonumber(otherdevices_winddir[Wind1])
        sWS1 = tonumber(otherdevices_windspeed[Wind1])
        sWG1 = tonumber(otherdevices_windgust[Wind1])
--   print('sWB1 = ' .. sWB1); print('sWS1 = ' .. sWS1); print('sWG1 = ' .. sWG1)
    end

-- Line 13, Read-out (direct) of Wind information from Buienradar as input Wind2
    if Wind2 ~= '' then
        sWB2 = tonumber(otherdevices_winddir[Wind2])
        sWS2 = tonumber(otherdevices_windspeed[Wind2])
        sWG2 = tonumber(otherdevices_windgust[Wind2])
--   print('sWB2 = ' .. sWB2); print('sWS2 = ' .. sWS2); print('sWG2 = ' .. sWG2)
    end
it results in:
2019-04-26 15:36:00.256 Error: EventSystem: Lua script Script #1 did not return a commandArray
Toulon7559
Posts: 859
Joined: Sunday 23 February 2014 17:56
Target OS: Raspberry Pi / ODroid
Domoticz version: <2025
Location: Hengelo(Ov)/NL
Contact:

Re: Wind speed script

Post by Toulon7559 »

@desertdog

Not without reason I stated in my first message that the presented code were Example scriptlines for data-extraction.
These scriptlines only provide the extracted data, nothing more.

To make it a complete, working lua-script, you must add 'head & tail and other cosmetics', which are related to the application you want to realise!
Part of that addition is opening and closing of command array.
I have revised the later version a bit to reduce/suppress the error-reports.

;-) Further work for you to fill/expand line 25 etc. to produce a notification for control of your 'sunscreen-driving functions'.
Considering your stated application for sunscreencontrol, think about a strong&long hysteresys, because otherwise the screens may be jumping up and down!
Last edited by Toulon7559 on Saturday 27 April 2019 0:10, edited 2 times in total.
Set1 = RPI-Zero+RFXCom433+S0PCM+Shield for BMP180/DS18B20/RS485+DDS238-1ZNs
Set2 = RPI-3A++RFLinkGTW+ESP8266s+PWS_WS7000
Common = KAKUs+3*PVLogger+PWS_TFA_Nexus
plus series of 'satellites' for dedicated interfacing, monitoring & control.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Wind speed script

Post by waaren »

desertdog wrote: Friday 26 April 2019 14:42 these are my 'wind' devices
558 DarkSky 0001 0 Wind Wind TFA 251.00;WSW;44;63;16.8;16.8
622 Buienradar 000F0006 6 Buienradar - Wind Wind TFA 223.0;SW;54;84;15.9;15.9
You have not stated your preference for dzVents or Lua and for target devices yet but these scripts both print the results to the domoticz log. It should get you started. Please note that dzVents is 100% Lua.

If you are not yet familiar with dzVents then please look at the 10 lines using dzVents with Domoticz for an intro to dzVents and howto get this script active in domoticz.

dzVents version

Code: Select all

return {
            on =    { devices = { 558, 622 }},

    execute = function(dz, item)
        
        print('Windspeed in ' .. item.name .. ': '.. item.speed  .. ' Bf.')
        print('Wind gust in ' .. item.name .. ': ' .. item.gust .. ' m/s')
    end
}
The Lua version should be copied / paste in the event Editor as Lua device triggered script.
Lua version

Code: Select all

commandArray = {}

    local function extractWind(wind) -- 
        t = {} -- declare t as empty table
        for value in wind:gmatch("[^;]+") do -- split string and insert 
            table.insert(t, value) -- results in table
        end
        return (t[3]/10), (t[4]/10)
    end

    -- loop through all the changed devices
    for deviceName, deviceValue in pairs(devicechanged) do
        if (deviceName == 'Wind' or deviceName == 'Buienradar - Wind') then
            local windSpeed, gust = extractWind(deviceValue) -- Call function
            print ('Windspeed in ' .. deviceName .. ': ' .. windSpeed .. ' m/s')
            print ('Wind gust in ' .. deviceName .. ': ' .. gust .. ' m/s')
        end
    end

return commandArray
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Jan Jansen
Posts: 229
Joined: Wednesday 30 April 2014 20:27
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: The Netherlands
Contact:

Re: Wind speed script

Post by Jan Jansen »

waaren wrote: Friday 26 April 2019 16:33
The Lua version should be copied / paste in the event Editor as Lua device triggered script.
Lua version

Code: Select all

commandArray = {}

    local function extractWind(wind) -- 
        t = {} -- declare t as empty table
        for value in wind:gmatch("[^;]+") do -- split string and insert 
            table.insert(t, value) -- results in table
        end
        return (t[3]/10), (t[4]/10)
    end

    -- loop through all the changed devices
    for deviceName, deviceValue in pairs(devicechanged) do
        if (deviceName == 'Wind' or deviceName == 'Buienradar - Wind') then
            local windSpeed, gust = extractWind(deviceValue) -- Call function
            print ('Windspeed in ' .. deviceName .. ': ' .. windSpeed .. ' m/s')
            print ('Wind gust in ' .. deviceName .. ': ' .. gust .. ' m/s')
        end
    end

return commandArray
The devices relevant to me are:
Knipsel.PNG
Knipsel.PNG (19.63 KiB) Viewed 2430 times
I modified the code like this:

Code: Select all

commandArray = {}

    local function extractWind(wind) -- 
        t = {} -- declare t as empty table
        for value in wind:gmatch("[^;]+") do -- split string and insert 
            table.insert(t, value) -- results in table
        end
        return (t[3]/10), (t[4]/10)
    end

    -- loop through all the changed devices
    for deviceName, deviceValue in pairs(devicechanged) do
        if (deviceName == 'Wind') then
            local windSpeed, gust = extractWind(deviceValue) -- Call function
            print ('Windspeed in ' Windsnelheid ': ' .. windSpeed .. ' m/s')
            print ('Wind gust in ' Windvlaag ': ' .. gust .. ' m/s')
        end
    end

return commandArray
The logs displays:
Knipsel log.PNG
Knipsel log.PNG (25.83 KiB) Viewed 2430 times
It is undoubtedly very simple but I cannot get it solved :oops:

Help is much needed

Thanks in advance!
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Wind speed script

Post by waaren »

Jan Jansen wrote: Saturday 21 March 2020 14:24 It is undoubtedly very simple but I cannot get it solved :oops:
Help is much needed

Code: Select all

commandArray = {}

    local function extractWind(wind) -- 
        t = {} -- declare t as empty table
        for value in wind:gmatch("[^;]+") do -- split string and insert 
            table.insert(t, value) -- results in table
        end
        return (t[3]/10), (t[4]/10)
    end

    -- loop through all the changed devices
    for deviceName, deviceValue in pairs(devicechanged) do
        if (deviceName == 'Wind') then
            local windSpeed, gust = extractWind(deviceValue) -- Call function
            print ('Windspeed in "Windsnelheid" : ' .. windSpeed .. ' m/s')
            print ('Wind gust in "Windvlaag" : ' .. gust .. ' m/s')
        end
    end

return commandArray
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Jan Jansen
Posts: 229
Joined: Wednesday 30 April 2014 20:27
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: The Netherlands
Contact:

Re: Wind speed script

Post by Jan Jansen »

waaren wrote: Saturday 21 March 2020 21:25
Thank you in the first place for your quick answer!

After changing (deviceName == 'Wind') to (deviceName == 'Wind en buitentemperatuur'), the log shows:
Knipsel log.PNG
Knipsel log.PNG (15.57 KiB) Viewed 2396 times
Despite this, the Wind Speed and Wind Gust devices are not updated. The bars remain red. Also changing the sensor from the 'wind' type to the 'custom' type does not solve the problem.

Maybe I can ask a supplementary question. I think it must be possible to create a separate sensor with the outside temperature with same script. I tried it like this:

Code: Select all

commandArray = {}

    local function extractWind(wind) -- 
        t = {} -- declare t as empty table
        for value in wind:gmatch("[^;]+") do -- split string and insert 
            table.insert(t, value) -- results in table
        end
        return (t[3]/10), (t[4]/10), (t[5]/10)
    end

    -- loop through all the changed devices
    for deviceName, deviceValue in pairs(devicechanged) do
        if (deviceName == 'Wind en buitentemperatuur') then
            local windSpeed, gust = extractWind(deviceValue) -- Call function
            print ('Windspeed in "Windsnelheid" : ' .. windSpeed .. ' m/s')
            print ('Wind gust in "Windvlaag" : ' .. gust .. ' m/s')
            print ('Temperature in "Test" : ' .. temperature .. ' C')		
        end
    end
return commandArray
This script gives the following error (I don't know how to enter the degree sign):

Knipsel log2.PNG
Knipsel log2.PNG (21.74 KiB) Viewed 2396 times


Thanks again for the help.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Wind speed script

Post by waaren »

Jan Jansen wrote: Sunday 22 March 2020 11:10 Despite this, the Wind Speed and Wind Gust devices are not updated. The bars remain red. Also changing the sensor from the 'wind' type to the 'custom' type does not solve the problem.
I don't see a command in this script to update a device. It is only sending something to the log.
Maybe I can ask a supplementary question. I think it must be possible to create a separate sensor with the outside temperature with same script. I tried it like this:
I think you will do yourself a favorby switching to dzVents scripting if you're already working with Lua in domoticz. dzVents scripts are 100% Lua with a lot of the boilerplate code accessible via easy commands.
It might look like a bit overwhelming at first but once you passed that it will be much easier to work with in domoticz.


as example I show the classic Lua and the dzVents version of the same script.

classic Lua

Code: Select all

commandArray = {}

    local function extractWind(wind) -- 
        t = {} -- declare t as empty table
        for value in wind:gmatch("[^;]+") do -- split string and insert 
            table.insert(t, value) -- results in table
        end
           
         return (t[3]/10), (t[4]/10), (t[5])
    end

    -- loop through all the changed devices
    for deviceName, deviceValue  in pairs(devicechanged) do
        if (deviceName == 'Wind en buitentemperatuur') then
            local windSpeed, gust, temperature  = extractWind(deviceValue) -- Call function
            print ('Windsnelheid van device       ' .. deviceName .. ': ' .. windSpeed .. ' m/s')
            print ('Windvlaag snelheid van device ' .. deviceName .. ': ' .. gust .. ' m/s')
            print ('Temperatuur van device        ' .. deviceName .. ': ' .. temperature .. ' °C')		
        end
    end

return commandArray
dzVents

Code: Select all

return 
{
	on = { devices = { 'Wind en buitentemperatuur' }},
	
	execute = function(dz, item)
		dz.log('Windsnelheid van device       ' .. item.name .. ': ' .. item.speed .. ' m/s')
		dz.log('Windvlaag snelheid van device ' .. item.name .. ': ' .. item.gust .. ' m/s')
		dz.log('Temperatuur van device        ' .. item.name .. ': ' .. item.temperature .. ' °C')
	end
}
I don't know how to enter the degree sign
use alt + 0176 from the numeric keyblock



When not yet familiar with dzVents please start with reading Get started Before implementing (~ 5 minutes). Special attention please for "In Domoticz go to Setup > Settings > Other and in the section EventSystem make sure the checkbox 'dzVents enabled' is checked. Also make sure that in the Security section in the settings you allow 127.0.0.1 to not need a password. dzVents uses that port to send certain commands to Domoticz. Finally make sure you have set your current location in Setup > Settings > System > Location, otherwise there is no way to determine nighttime/daytime state."
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest