Page 1 of 1

Event for Christmas

Posted: Thursday 07 December 2017 3:59
by kllngtme
Could someone show me a way on getting started with this? How do I create an event to turn on a switch on Christmas at 8:00AM? I've been trying to figure out how to do it with blockly but I'm getting stuck even starting it.

Essentially I want a LMS player to play a certain playlist on Christmas. I figure I can get the player to do what I want, I just need to figure out how to control or specify the date it happens on.

Thanks in advance!

Re: Event for Christmas

Posted: Thursday 07 December 2017 8:08
by jannl
With lua or so you can check the date and the time to activate an event, should not be that hard.

Re: Event for Christmas

Posted: Thursday 07 December 2017 20:09
by kllngtme
I just created a dummy switch to get Christmas going that way. Now for the rest of the programming..

Re: Event for Christmas

Posted: Thursday 07 December 2017 21:07
by EdwinK
Please show the finished product :)

Re: Event for Christmas

Posted: Friday 08 December 2017 4:42
by kllngtme
So I got it going and tested. This turns on my Squeezebox boom in my bathroom and plays a playlist I created in LMS called XmasDay on Christmas morning at 8AM

- I created a virtual switch named Christmas, then went to Switches and selected Manual Light/Switch and created a dummy switch called Xmas Day.
- Then I set a timer on the Xmas Day switch to turn the switch on 12/25/17 at 8:00AM

- I went to Events and created a blockly script.
The blockly script is using an If/Do from Control. It says:
If Xmas Day=On
Do Open url: http://username:[email protected]:90 ... 0:xx:xx:xx

You will need to put in your login credentials before hand or delete that part if you aren't using security on LMS, and you will need to get the player's mac address you want it to play on.

Re: Event for Christmas

Posted: Friday 08 December 2017 6:12
by Egregius
Why didn't you choose a timer for this?
Now you have a script that will check on every device update, or every minute that it is Christmas or not.

Re: Event for Christmas

Posted: Friday 08 December 2017 13:12
by kllngtme
Egregius wrote: Friday 08 December 2017 6:12 Why didn't you choose a timer for this?
Now you have a script that will check on every device update, or every minute that it is Christmas or not.
What do you mean exactly? Put the blockly script on a timer?

Re: Event for Christmas

Posted: Friday 08 December 2017 15:05
by Egregius
I don't use blockly :P
But it should be easy to have a script triggered only by 1 switch, in worst case with the on-action.

Re: Event for Christmas

Posted: Friday 08 December 2017 16:24
by kllngtme
Egregius wrote: Friday 08 December 2017 15:05 I don't use blockly :P
But it should be easy to have a script triggered only by 1 switch, in worst case with the on-action.
LOL - I don't know WHY I did this now that you said that. I just did more work than I needed. LOL. Thanks for the advice!

Re: Event for Christmas

Posted: Sunday 10 December 2017 23:47
by kuifje
It's done in the chapter switches in a switch-timers. There you can choose when a switch is turned on or off on a specific date and time.

Re: Event for Christmas

Posted: Monday 11 December 2017 0:41
by markjgabb
ok obviously im really dense on this one....how do i set a swtich for a specific time and date? im now wanting to do something similar....

Re: Event for Christmas

Posted: Tuesday 12 December 2017 10:14
by markjgabb
Ok have now been through all. Menus on demoticz and I think half of the wiki. But no luck at all. How did you guys resolve this.... I would just like a timer that runs at 7am on the 24th of december

Re: Event for Christmas

Posted: Tuesday 12 December 2017 15:33
by kllngtme
markjgabb wrote: Tuesday 12 December 2017 10:14 Ok have now been through all. Menus on demoticz and I think half of the wiki. But no luck at all. How did you guys resolve this.... I would just like a timer that runs at 7am on the 24th of december
I kinda went over what I did, step by step almost. But the beginning basics to get it going, here you go:

Click setup, click hardware. Under type select Dummy and name it to whatever you want. It will show up under your hardware as what you named it.
Now create the virtual switch. Go to swtiches, click Manual Light/Switch - name it what you want and select the dummy you just created and named in the previous step.

That gets you the instance of a virtual switch. Now create a timer on that switch for an On event. Then you can have or create things to do once that switch turns on based on the timer event.

Re: Event for Christmas

Posted: Tuesday 12 December 2017 21:58
by markjgabb
My apologies for not being clear. I had assumed you had found a solution for Switchibg on a particular date. Or 24/12. Unless I have an issue I can only select day of the week or such things under my timer section

Re: Event for Christmas

Posted: Tuesday 12 December 2017 23:24
by Nautilus
markjgabb wrote: Tuesday 12 December 2017 21:58 My apologies for not being clear. I had assumed you had found a solution for Switchibg on a particular date. Or 24/12. Unless I have an issue I can only select day of the week or such things under my timer section
In the "Type" drop-down menu you should have plenty of options, e.g. "Yearly" where you can set a particular date and time. If for some reason you don't see these you can try clearing cache (also appcache) and/or update to latest (beta) version.

Re: Event for Christmas

Posted: Tuesday 12 December 2017 23:27
by markjgabb
@nautilus champion...that was the exact issue.... cleared chache and options all appeared

thanks for that, this will be magnificent