Help Example, months of the year

Easy to use, 100% Lua-based event scripting framework.
Post Reply
User avatar
Derik
Posts: 2150
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Help Example, months of the year

Post by Derik » Sunday 19 August 2018 10:05

Dear all.
I try to understand dzvents.. [ hard to get for me ]

I try to make a script wjere every month of the year is acting with Domoticz.
12 dummys that switch on the month of the year.
Looks for me a simple start to begin.Only i get unfortunately not 1 month to switch to the good month..:-(

Is there perhaps someone that can give me some basic code from where i can start?

Thanks
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups

User avatar
waaren
Posts: 918
Joined: Tuesday 03 January 2017 15:18
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Help Example, months of the year

Post by waaren » Monday 20 August 2018 0:20

Derik wrote:
Sunday 19 August 2018 10:05
try to make a script wjere every month of the year is acting with Domoticz.
12 dummys that switch on the month of the year.
Looks for me a simple start to begin.Only i get unfortunately not 1 month to switch to the good month..:-(

Is there perhaps someone that can give me some basic code from where i can start?
I am not sure I completely understand what you try to achieve but based on my assumption that you have created a virtual switch for every month and only want the switch with the name of the current month to be switched to On, I have put together the script below.
Please let me know if my assumption is incorrect or if you do not completely understand the script.

Code: Select all

-- setMonthswitch.lua

return { 
    on      =   {   timer  =   { "at 00:01" }}, -- the script will run every night at 00:01
                    
    logging =   {   level       =   domoticz.LOG_DEBUG,   -- this sets the loglevel. Options are LOG_INFO, LOG_DEBUG, LOG_ERROR or LOG_FORCE
                    marker      =  "setMonthswitch" },    -- the marker will ensure you can see where information comes from
    
    execute = function(dz)                          -- the parm dz (short for domoticz) will ensure all information from domoticz is available in this script 
        months={    "januari",      -- months is here a table (or array) with all month names. The names can be accessed by months[1] .. months[12]
                    "februari",
                    "maart",
                    "april",
                    "mei",
                    "juni",
                    "juli",
                    "augustus",
                    "september",
                    "oktober",
                    "november",
                    "december"  }
                    
        dz.log(months[tonumber(os.date("%m"))],dz.LOG_DEBUG) -- os.date("%m") returns the month-number with a leading zero as a string. 
                                                             -- tonumber converts this string to a number   
        for i = 1,#months do                                 -- #months means max. items in the table months (so for loop from 1 to 12)  
            dz.devices(months[i]).switchOff().checkFirst()   -- Switch off all virtual switches labeled with names of the months 
                                                             -- checkFirst() wil make sure switch will only be done when before state is different
        end
        dz.devices(months[tonumber(os.date("%m"))]).switchOn().checkFirst() -- Only current month switch will be set to on (when not already done)
    end
}
Last edited by waaren on Monday 20 August 2018 20:36, edited 2 times in total.
Raspberry (debian stretch via berryboot on Synology DS916+) , Domoticz (almost) latest Beta, , dzVents 2.6, RFLink, RFXtrx433e, P1, Youless, Harmony, Hue, Yeelight, Xiaomi, HomeWizard, Zwave, Amazon echo

bimse
Posts: 20
Joined: Sunday 05 February 2017 13:09
Target OS: Raspberry Pi
Domoticz version: Model 3
Contact:

Re: Help Example, months of the year

Post by bimse » Monday 20 August 2018 16:22

Try with
timer = { 'at 00:01 on 1/*'}, -- Every 1st of the month at 00:01
Translated with google

User avatar
waaren
Posts: 918
Joined: Tuesday 03 January 2017 15:18
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Help Example, months of the year

Post by waaren » Monday 20 August 2018 16:42

bimse wrote:
Monday 20 August 2018 16:22
Try with
timer = { 'at 00:01 on 1/*'}, -- Every 1st of the month at 00:01
Thanks. It kind of depends what is most important for the user. With your modification the script would run once a month and thus saving CPU cycles
and it would work most of the times but if the system is down for two minutes at that particular moment the switches would show a wrong month for the whole month. With my example it would run once a day and burning CPU (0.026 seconds on my PI-3 system) and the switches could be off for a day if the system is down for two minutes on the first day of the month at 00:01)
So it is up to user environment what is most important. Execute monthly, -daily ( or even hourly ? )

But credits for you to show this alternative
Raspberry (debian stretch via berryboot on Synology DS916+) , Domoticz (almost) latest Beta, , dzVents 2.6, RFLink, RFXtrx433e, P1, Youless, Harmony, Hue, Yeelight, Xiaomi, HomeWizard, Zwave, Amazon echo

User avatar
Derik
Posts: 2150
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: Help Example, months of the year

Post by Derik » Monday 20 August 2018 20:00

Dear all.
Thanks for this, i see now your reaction, i get no notification from the forum??

So i give it a try .... this evening
you hear from me..

Ps i can change the names for the months in the script to what i want?
En what setting do i need in dz vents.. all time or device?


Edit:
Error:

Code: Select all

 2018-08-20 20:13:14.485 Status: dzVents: Error (2.4.7): error loading module 'DZ: Maanden' from file '/home/pi/domoticz/scripts/dzVents/generated_scripts/DZ: Maanden.lua':
2018-08-20 20:13:14.485 ...moticz/scripts/dzVents/generated_scripts/DZ: Maanden.lua:9: unexpected symbol near '`'
2018-08-20 20:13:14.544 Status: dzVents: Error (2.4.7): error loading module 'DZ: Maanden' from file '/home/pi/domoticz/scripts/dzVents/generated_scripts/DZ: Maanden.lua':
2018-08-20 20:13:14.544 ...moticz/scripts/dzVents/generated_scripts/DZ: Maanden.lua:9: unexpected symbol near '`'
Last edited by Derik on Monday 20 August 2018 20:29, edited 1 time in total.
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups

User avatar
Derik
Posts: 2150
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: Help Example, months of the year

Post by Derik » Monday 20 August 2018 20:21

The error found .. grrrr

Only now I have:
ScreenShot255.png
ScreenShot255.png (11.75 KiB) Viewed 337 times
And:
ScreenShot256.png
ScreenShot256.png (89.17 KiB) Viewed 337 times
Only not working..
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups

User avatar
waaren
Posts: 918
Joined: Tuesday 03 January 2017 15:18
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Help Example, months of the year

Post by waaren » Monday 20 August 2018 20:26

Derik wrote:
Monday 20 August 2018 20:00
Dear aall.
Thanks for this, i see now your reaction, i get no notification from the forum??

So i give it a try .... this evening
you hear from me..

Ps i can change the names for the months in the script to what i want?
En what setting do i need in dz vents.. all time or device?


Edit:
Error:

Code: Select all

 2018-08-20 20:13:14.485 Status: dzVents: Error (2.4.7): error loading module 'DZ: Maanden' from file '/home/pi/domoticz/scripts/dzVents/generated_scripts/DZ: Maanden.lua':
2018-08-20 20:13:14.485 ...moticz/scripts/dzVents/generated_scripts/DZ: Maanden.lua:9: unexpected symbol near '`'
2018-08-20 20:13:14.544 Status: dzVents: Error (2.4.7): error loading module 'DZ: Maanden' from file '/home/pi/domoticz/scripts/dzVents/generated_scripts/DZ: Maanden.lua':
2018-08-20 20:13:14.544 ...moticz/scripts/dzVents/generated_scripts/DZ: Maanden.lua:9: unexpected symbol near '`'
Oops.. overlooked one quote.. I removed it in the script so please try again.
You can change the names to your liking but do not remove- or add one and they must be the same as your dummy devices.
For dzVents it does not matter what type you use in the internal event editor the type is determined in the on = section
Raspberry (debian stretch via berryboot on Synology DS916+) , Domoticz (almost) latest Beta, , dzVents 2.6, RFLink, RFXtrx433e, P1, Youless, Harmony, Hue, Yeelight, Xiaomi, HomeWizard, Zwave, Amazon echo

User avatar
waaren
Posts: 918
Joined: Tuesday 03 January 2017 15:18
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Help Example, months of the year

Post by waaren » Monday 20 August 2018 20:31

Derik wrote:
Monday 20 August 2018 20:21
The error found .. grrrr
Only not working..
Did you define all (virtual) month switches ?
Do you see something in the log ?
Raspberry (debian stretch via berryboot on Synology DS916+) , Domoticz (almost) latest Beta, , dzVents 2.6, RFLink, RFXtrx433e, P1, Youless, Harmony, Hue, Yeelight, Xiaomi, HomeWizard, Zwave, Amazon echo

User avatar
Derik
Posts: 2150
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: Help Example, months of the year

Post by Derik » Monday 20 August 2018 20:35

mm i did try only 1 month
No thing in the log..
i make first all the months...
then
I be back :-)
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups

User avatar
waaren
Posts: 918
Joined: Tuesday 03 January 2017 15:18
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Help Example, months of the year

Post by waaren » Monday 20 August 2018 20:39

Derik wrote:
Monday 20 August 2018 20:35
mm i did try only 1 month
No thing in the log..
i make first all the months...
then
I be back :-)
And please load the example again. Found one other typo
Raspberry (debian stretch via berryboot on Synology DS916+) , Domoticz (almost) latest Beta, , dzVents 2.6, RFLink, RFXtrx433e, P1, Youless, Harmony, Hue, Yeelight, Xiaomi, HomeWizard, Zwave, Amazon echo

User avatar
Derik
Posts: 2150
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: Help Example, months of the year

Post by Derik » Monday 20 August 2018 20:45

Did all the months:
ScreenShot257.png
ScreenShot257.png (87.55 KiB) Viewed 325 times
and:
ScreenShot258.png
ScreenShot258.png (92.25 KiB) Viewed 325 times


No thing to see in the log
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups

User avatar
waaren
Posts: 918
Joined: Tuesday 03 January 2017 15:18
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Help Example, months of the year

Post by waaren » Tuesday 21 August 2018 23:32

Derik wrote:
Monday 20 August 2018 20:45
No thing to see in the log
Can you copy / paste the script again and report your findings ?
At least something should be visible in the logfile.
Raspberry (debian stretch via berryboot on Synology DS916+) , Domoticz (almost) latest Beta, , dzVents 2.6, RFLink, RFXtrx433e, P1, Youless, Harmony, Hue, Yeelight, Xiaomi, HomeWizard, Zwave, Amazon echo

User avatar
Derik
Posts: 2150
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: Help Example, months of the year

Post by Derik » Wednesday 22 August 2018 17:51

Code: Select all

-- setWindChill.lua

return { 
    on      =   {   timer  =   { "every 10 minutes" }}, -- the script will run every 10 minutes
                    
--   logging =   {   level       =   domoticz.LOG_DEBUG,   -- this sets the loglevel. Options are LOG_INFO, LOG_DEBUG, LOG_ERROR or LOG_FORCE
--                   marker      =  "setWindchill" },    -- the marker will ensure you can see where information comes from
    
    execute = function(dz)  -- the parm dz (short for domoticz) will ensure all information from domoticz is available in this script 
        -----  enter your settings below this line -------------------------------------------------------------------------------
        myTemperature   = dz.devices("Buiten: Terras")          -- Name of your windDevice within quotes or idx without quotes
        myWind          = dz.devices("D.M.: Buienradar - Wind") -- Name of your temperatureDevice within quotes or idx without quotes
        myWindChill     = dz.devices("D.M.: Windchill")          -- Name of your windchill Device within quotes or idx without quotes
        -----  enter your settings above this line -------------------------------------------------------------------------------
        
        
        function windChill(windSpeed, temperature)
           if temperature ==   nil then return -99     -- Should not happen
           elseif windSpeed == nil then return -99     -- Should not happen
            -- chill temperature cannot be calculated for these conditions
           elseif windSpeed < 1.3 or windSpeed > 49 or temperature < -46 or temperature > 17 then return temperature
           end
           return dz.utils.round(13.12 + (0.6215 * temperature) - (13.96 * math.pow(windSpeed, 0.16)) + (0.4867 * temperature * math.pow(windSpeed, 0.16)), 1)
        end
     
        myWindChill.updateTemperature(windChill(myWind.speed,myTemperature.temperature))

    end
}
The output:
ScreenShot262.png
ScreenShot262.png (15.04 KiB) Viewed 248 times
Log:

Code: Select all

 17:50:00.810 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
2018-08-22 17:50:05.897 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
2018-08-22 17:50:11.600 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
2018-08-22 17:50:20.599 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
2018-08-22 17:50:30.325 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
2018-08-22 17:50:38.978 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
2018-08-22 17:50:47.763 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua 
That are scripts without any thing?
Perhaps one of these?
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups

User avatar
Derik
Posts: 2150
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: Help Example, months of the year

Post by Derik » Wednesday 22 August 2018 20:56

Proud on myself

THANKS to Jos..
Did change his script, for seazos..
MY first script that is working:

Code: Select all

-- script_time maanden.lua

commandArray = {}
time = os.date("*t")
-- check once a minute for the months to change
if (time.month == 1) then
	if otherdevices["D.M.: Januari D"] == 'Off' then
		commandArray['D.M.: Januari D'] = 'On'
		commandArray['D.M.: Februari D'] = 'Off'
		commandArray['D.M.: Maart D'] = 'Off'
		commandArray['D.M.: April D'] = 'Off'
		commandArray['D.M.: Mei D'] = 'Off'
		commandArray['D.M.: Juni D'] = 'Off'
		commandArray['D.M.: Juli D'] = 'Off'
		commandArray['D.M.: Augustus D'] = 'Off'
		commandArray['D.M.: September D'] = 'Off'
		commandArray['D.M.: Oktober D'] = 'Off'
		commandArray['D.M.: November D'] = 'Off'
		commandArray['D.M.: December D'] = 'Off'
	end
elseif (time.month == 2) then
	if otherdevices ["D.M.: Februari D"] == 'Off' then
		commandArray['D.M.: Januari D'] = 'Off'
		commandArray['D.M.: Februari D'] = 'On'
		commandArray['D.M.: Maart D'] = 'Off'
		commandArray['D.M.: April D'] = 'Off'
		commandArray['D.M.: Mei D'] = 'Off'
		commandArray['D.M.: Juni D'] = 'Off'
		commandArray['D.M.: Juli D'] = 'Off'
		commandArray['D.M.: Augustus D'] = 'Off'
		commandArray['D.M.: September D'] = 'Off'
		commandArray['D.M.: Oktober D'] = 'Off'
		commandArray['D.M.: November D'] = 'Off'
		commandArray['D.M.: December D'] = 'Off'
	end
elseif (time.month == 3) then
	if otherdevices ["D.M.: Maart D"] == 'Off' then
		commandArray['D.M.: Januari D'] = 'Off'
		commandArray['D.M.: Februari D'] = 'Off'
		commandArray['D.M.: Maart D'] = 'On'
		commandArray['D.M.: April D'] = 'Off'
		commandArray['D.M.: Mei D'] = 'Off'
		commandArray['D.M.: Juni D'] = 'Off'
		commandArray['D.M.: Juli D'] = 'Off'
		commandArray['D.M.: Augustus D'] = 'Off'
		commandArray['D.M.: September D'] = 'Off'
		commandArray['D.M.: Oktober D'] = 'Off'
		commandArray['D.M.: November D'] = 'Off'
		commandArray['D.M.: December D'] = 'Off'
	end
elseif (time.month == 4) then
	if otherdevices ["D.M.: April D"] == 'Off' then
		commandArray['D.M.: Januari D'] = 'Off'
		commandArray['D.M.: Februari D'] = 'Off'
		commandArray['D.M.: Maart D'] = 'Off'
		commandArray['D.M.: April D'] = 'On'
		commandArray['D.M.: Mei D'] = 'Off'
		commandArray['D.M.: Juni D'] = 'Off'
		commandArray['D.M.: Juli D'] = 'Off'
		commandArray['D.M.: Augustus D'] = 'Off'
		commandArray['D.M.: September D'] = 'Off'
		commandArray['D.M.: Oktober D'] = 'Off'
		commandArray['D.M.: November D'] = 'Off'
		commandArray['D.M.: December D'] = 'Off'
	end
elseif (time.month == 5) then
	if otherdevices ["D.M.: Mei D"] == 'Off' then
		commandArray['D.M.: Januari D'] = 'Off'
		commandArray['D.M.: Februari D'] = 'Off'
		commandArray['D.M.: Maart D'] = 'Off'
		commandArray['D.M.: April D'] = 'Off'
		commandArray['D.M.: Mei D'] = 'On'
		commandArray['D.M.: Juni D'] = 'Off'
		commandArray['D.M.: Juli D'] = 'Off'
		commandArray['D.M.: Augustus D'] = 'Off'
		commandArray['D.M.: September D'] = 'Off'
		commandArray['D.M.: Oktober D'] = 'Off'
		commandArray['D.M.: November D'] = 'Off'
		commandArray['D.M.: December D'] = 'Off'
	end
elseif (time.month == 6) then
	if otherdevices ["D.M.: Juni D"] == 'Off' then
		commandArray['D.M.: Januari D'] = 'Off'
		commandArray['D.M.: Februari D'] = 'Off'
		commandArray['D.M.: Maart D'] = 'Off'
		commandArray['D.M.: April D'] = 'Off'
		commandArray['D.M.: Mei D'] = 'Off'
		commandArray['D.M.: Juni D'] = 'On'
		commandArray['D.M.: Juli D'] = 'Off'
		commandArray['D.M.: Augustus D'] = 'Off'
		commandArray['D.M.: September D'] = 'Off'
		commandArray['D.M.: Oktober D'] = 'Off'
		commandArray['D.M.: November D'] = 'Off'
		commandArray['D.M.: December D'] = 'Off'
	end
elseif (time.month == 7) then
	if otherdevices ["D.M.: Juli D"] == 'Off' then
		commandArray['D.M.: Januari D'] = 'Off'
		commandArray['D.M.: Februari D'] = 'Off'
		commandArray['D.M.: Maart D'] = 'Off'
		commandArray['D.M.: April D'] = 'Off'
		commandArray['D.M.: Mei D'] = 'Off'
		commandArray['D.M.: Juni D'] = 'Off'
		commandArray['D.M.: Juli D'] = 'On'
		commandArray['D.M.: Augustus D'] = 'Off'
		commandArray['D.M.: September D'] = 'Off'
		commandArray['D.M.: Oktober D'] = 'Off'
		commandArray['D.M.: November D'] = 'Off'
		commandArray['D.M.: December D'] = 'Off'
	end
elseif (time.month == 8) then
	if otherdevices ["D.M.: Augustus D"] == 'Off' then
		commandArray['D.M.: Januari D'] = 'Off'
		commandArray['D.M.: Februari D'] = 'Off'
		commandArray['D.M.: Maart D'] = 'Off'
		commandArray['D.M.: April D'] = 'Off'
		commandArray['D.M.: Mei D'] = 'Off'
		commandArray['D.M.: Juni D'] = 'Off'
		commandArray['D.M.: Juli D'] = 'Off'
		commandArray['D.M.: Augustus D'] = 'On'
		commandArray['D.M.: September D'] = 'Off'
		commandArray['D.M.: Oktober D'] = 'Off'
		commandArray['D.M.: November D'] = 'Off'
		commandArray['D.M.: December D'] = 'Off'
	end
elseif (time.month == 9) then
	if otherdevices ["D.M.: September D"] == 'Off' then
		commandArray['D.M.: Januari D'] = 'Off'
		commandArray['D.M.: Februari D'] = 'Off'
		commandArray['D.M.: Maart D'] = 'Off'
		commandArray['D.M.: April D'] = 'Off'
		commandArray['D.M.: Mei D'] = 'Off'
		commandArray['D.M.: Juni D'] = 'Off'
		commandArray['D.M.: Juli D'] = 'Off'
		commandArray['D.M.: Augustus D'] = 'Off'
		commandArray['D.M.: September D'] = 'On'
		commandArray['D.M.: Oktober D'] = 'Off'
		commandArray['D.M.: November D'] = 'Off'
		commandArray['D.M.: December D'] = 'Off'
	end
elseif (time.month == 10) then
	if otherdevices ["D.M.: Oktober D"] == 'Off' then
		commandArray['D.M.: Januari D'] = 'Off'
		commandArray['D.M.: Februari D'] = 'Off'
		commandArray['D.M.: Maart D'] = 'Off'
		commandArray['D.M.: April D'] = 'Off'
		commandArray['D.M.: Mei D'] = 'Off'
		commandArray['D.M.: Juni D'] = 'Off'
		commandArray['D.M.: Juli D'] = 'Off'
		commandArray['D.M.: Augustus D'] = 'Off'
		commandArray['D.M.: September D'] = 'Off'
		commandArray['D.M.: Oktober D'] = 'On'
		commandArray['D.M.: November D'] = 'Off'
		commandArray['D.M.: December D'] = 'Off'
	end
elseif (time.month == 11) then
	if otherdevices ["D.M.: November D"] == 'Off' then
		commandArray['D.M.: Januari D'] = 'Off'
		commandArray['D.M.: Februari D'] = 'Off'
		commandArray['D.M.: Maart D'] = 'Off'
		commandArray['D.M.: April D'] = 'Off'
		commandArray['D.M.: Mei D'] = 'Off'
		commandArray['D.M.: Juni D'] = 'Off'
		commandArray['D.M.: Juli D'] = 'Off'
		commandArray['D.M.: Augustus D'] = 'Off'
		commandArray['D.M.: September D'] = 'Off'
		commandArray['D.M.: Oktober D'] = 'Off'
		commandArray['D.M.: November D'] = 'On'
		commandArray['D.M.: December D'] = 'Off'
	end
elseif (time.month == 12) then
	if otherdevices ["D.M.: December D"] == 'Off' then
		commandArray['D.M.: Januari D'] = 'Off'
		commandArray['D.M.: Februari D'] = 'Off'
		commandArray['D.M.: Maart D'] = 'Off'
		commandArray['D.M.: April D'] = 'Off'
		commandArray['D.M.: Mei D'] = 'Off'
		commandArray['D.M.: Juni D'] = 'Off'
		commandArray['D.M.: Juli D'] = 'Off'
		commandArray['D.M.: Augustus D'] = 'Off'
		commandArray['D.M.: September D'] = 'Off'
		commandArray['D.M.: Oktober D'] = 'Off'
		commandArray['D.M.: November D'] = 'Off'
		commandArray['D.M.: December D'] = 'On'
	end
else
   print('Er is iets mis in het script van Maanden :)')
end
return commandArray
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests