Page 1 of 1
Alarm clock
Posted: Thursday 24 December 2020 15:56
by kar12
Alarm clock
Hello all
Do you know how to setup an alarm clock to action a switch ?
I'd like when the alarm in on , switch on a device like a coffee machine.
Do you know any device to do that?
Re: Alarm clock
Posted: Thursday 24 December 2020 16:48
by wkossen
Interesting idea. i'm no coder, but my hunch is that you could create a script that runs every day at a specific time.
to start you might try something like:
Code: Select all
return {
on = {
timer = {
'at 6:30 on mon, tue, wed, thu, fri',
'at 8:00 on sat, sun',
},
},
execute = function(domoticz, device)
if (devices.on) then
domoticz.notify('Time to get up!', 'Time to get up...', PRIORITY_HIGH, nil, nil)
end
end
}
then you could try creating a user specified parameter with get up times and get data from those in the script. and instead of notifications you could do commands to turn on lights, sockets or other devices. haven't done that yet, so i have no example code, but there is plenty on the forum, i guess. Hope this helps you get going. And I'll follow this to implement it myself as well
Cheers
Re: Alarm clock
Posted: Friday 25 December 2020 9:52
by kiddigital
kar12 wrote:Alarm clock
Hello all
Do you know how to setup an alarm clock to action a switch ?
I'd like when the alarm in on , switch on a device like a coffee machine.
Do you know any device to do that?
Take a look at devices that have a ‘timer’ option. Most switches and other devices that can ‘set’ things.
For example your ‘coffeemachine’ switch could have its own timer.
If you want to ‘react’ to another device, than you can make use of the ‘notification’ system.
Should be possible to achieve this without the need to ‘program’ anything.
You can also look at Blockly/dzVents possibilities.
Let us know if and how you succeeded.