{"id":1477,"date":"2016-01-31T16:32:50","date_gmt":"2016-01-31T16:32:50","guid":{"rendered":"http:\/\/grodansparadis.com\/wordpress\/?p=1477"},"modified":"2016-01-31T16:44:14","modified_gmt":"2016-01-31T16:44:14","slug":"how-to-schedule-eventsschemas-with-the-daemon-iot-m2m-vscp","status":"publish","type":"post","link":"https:\/\/grodansparadis.com\/wordpress\/?p=1477","title":{"rendered":"How to schedule events\/schemas with the daemon #Iot #m2m #vscp"},"content":{"rendered":"<p>I got the following question from a VSCP users<\/p>\n<ul>\n<li>How to turn on lights at sunset.<\/li>\n<li>How to turn off the lights at a specified time (either sunset + x hrs, or for example at YY:ZZ).<\/li>\n<li>How to turn on at a certain time.<\/li>\n<li>How to turn off at sunrise.<\/li>\n<\/ul>\n<p>So the easiest way to demonstrate this capability of the <a href=\"http:\/\/www.vscp.org\/docs\/vscpd\/doku.php?id=start\">VSCP daemon<\/a>\u00a0 is to show the setup I have here in our house for this. Oh well part of it of course, we should not go to far away from the topic.<\/p>\n<p><strong>Some background<\/strong><\/p>\n<p>Yes I use VSCP based devices for some things here in the house but just as the shoemakers children have holes in there shoes I am often stuck at fixing things for others before I can do something for myself.\u00a0 So here it is a lot of\u00a0 my setups are test setups that are replaced by other test setups that are replaced by even other test setups\u00a0 etc in a never ending story. Its the just the way it is\u00a0 for makers I guess.<\/p>\n<p>But some things I use here at least and that is I schedule the lamps in the house so they turn on at sunset and turn off at sunrise and some other things. So the questions above is easily by explaining my own setup.<\/p>\n<p>Now I could have used a <a href=\"http:\/\/www.grodansparadis.com\/paris\/paris.html\">Paris module<\/a> to control lamps and I actually do here in the office but just in a test setup . In our house and for lamps on the\u00a0 outside I use low cost wireless modules from Nexa and Proove<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/large.jpeg\" rel=\"attachment wp-att-1478\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1478\" data-permalink=\"https:\/\/grodansparadis.com\/wordpress\/?attachment_id=1478\" data-orig-file=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/large.jpeg?fit=500%2C500&amp;ssl=1\" data-orig-size=\"500,500\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"large\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/large.jpeg?fit=500%2C500&amp;ssl=1\" class=\"alignnone size-full wp-image-1478\" src=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/large.jpeg?resize=500%2C500\" alt=\"large\" width=\"500\" height=\"500\" srcset=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/large.jpeg?w=500&amp;ssl=1 500w, https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/large.jpeg?resize=150%2C150&amp;ssl=1 150w, https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/large.jpeg?resize=300%2C300&amp;ssl=1 300w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/nexa-infalld-fjarrstrombrytare-1000-w.jpeg\" rel=\"attachment wp-att-1479\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1479\" data-permalink=\"https:\/\/grodansparadis.com\/wordpress\/?attachment_id=1479\" data-orig-file=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/nexa-infalld-fjarrstrombrytare-1000-w.jpeg?fit=220%2C220&amp;ssl=1\" data-orig-size=\"220,220\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"nexa-infalld-fjarrstrombrytare-1000-w\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/nexa-infalld-fjarrstrombrytare-1000-w.jpeg?fit=220%2C220&amp;ssl=1\" class=\"alignnone size-full wp-image-1479\" src=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/nexa-infalld-fjarrstrombrytare-1000-w.jpeg?resize=220%2C220\" alt=\"nexa-infalld-fjarrstrombrytare-1000-w\" width=\"220\" height=\"220\" srcset=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/nexa-infalld-fjarrstrombrytare-1000-w.jpeg?w=220&amp;ssl=1 220w, https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/nexa-infalld-fjarrstrombrytare-1000-w.jpeg?resize=150%2C150&amp;ssl=1 150w\" sizes=\"auto, (max-width: 220px) 100vw, 220px\" \/><\/a><\/p>\n<p>Well you all recognize them. Low cost single way communication modules working over 433 MHz.\u00a0 Reliable enough for lights IMO. But they could of course equally well have been Z-Wave, KNX, X10 or some other solution.<\/p>\n<p>The <strong>CAN4VSCP Roma<\/strong> module will control these things and it sits on my desk at the moment working pretty well. It will be available in the store also one day I hope.<\/p>\n<p>At the moment I us a Tellstick\u00a0 from <a href=\"http:\/\/www.telldus.se\/\">Telldus AB<\/a> to control\u00a0 lights connected this way. There are other similar products available and Arduino solutions that can do it as well<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/TellStick_1-600x600_0.jpg\" rel=\"attachment wp-att-1480\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1480\" data-permalink=\"https:\/\/grodansparadis.com\/wordpress\/?attachment_id=1480\" data-orig-file=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/TellStick_1-600x600_0.jpg?fit=600%2C600&amp;ssl=1\" data-orig-size=\"600,600\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"TellStick_1-600x600_0\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/TellStick_1-600x600_0.jpg?fit=580%2C580&amp;ssl=1\" class=\"alignnone size-full wp-image-1480\" src=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/TellStick_1-600x600_0.jpg?resize=580%2C580\" alt=\"TellStick_1-600x600_0\" width=\"580\" height=\"580\" srcset=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/TellStick_1-600x600_0.jpg?w=600&amp;ssl=1 600w, https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/TellStick_1-600x600_0.jpg?resize=150%2C150&amp;ssl=1 150w, https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/TellStick_1-600x600_0.jpg?resize=300%2C300&amp;ssl=1 300w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<p>Well this solution just let me execute a binary on a Linux machine to turn on\/off a group of lamps.\u00a0 There are similar devices available for all other vertical solutions. So to control KNX units with the VSCP daemon find an executable that can do that and the same for Z-Wave (<a href=\"http:\/\/www.google.se\/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=1&amp;cad=rja&amp;uact=8&amp;ved=0ahUKEwjd-Zqvp9TKAhWCBywKHRtFAUgQFggfMAA&amp;url=http%3A%2F%2Fwww.openzwave.com%2F&amp;usg=AFQjCNHLcksjEN1mqKHkkeVcUt3S781c0Q&amp;sig2=uJyrnDHtbAZcYT1Dptq-Yg\">OpenZwave<\/a>) or whatever solution you want to integrate. Or write your own script or executable that does it. It is usually not a big deal.<\/p>\n<p>But it of course does not end with an executable. The VSCP daemon can do many other things. Call an URL\/send events\/start timers etc etc. You can add anything and you should be able to add everything because the world consist and will consist of many different things,<\/p>\n<p><strong>Turn on lights at sunset<\/strong><\/p>\n<p>So lets look at the first point. This can be done in many ways of course but if you enter the coordinates for your location in the VSCP <a href=\"http:\/\/www.vscp.org\/docs\/vscpd\/doku.php?id=configuring_the_vscp_daemon\">daemon configuration file<\/a>\u00a0 (dm.xml) in the <a href=\"http:\/\/www.vscp.org\/docs\/vscpd\/doku.php?id=configuring_the_vscp_daemon#automation\">Automation section<\/a>\u00a0 the decision matrix will be feed with two events that are of interest for this\u00a0 type of control<\/p>\n<p><a href=\"http:\/\/www.vscp.org\/docs\/vscpspec\/doku.php?id=class1.information#type_45_0x2d_sunset\">CLASS1.INFORMATION, Type=45, Sunset<\/a><\/p>\n<p>Sent when astronomical sunset happens at the location set by the coordinates.<\/p>\n<p><a href=\"http:\/\/www.vscp.org\/docs\/vscpspec\/doku.php?id=class1.information#type_53_0x35_civil_sunset_twilight_time\">CLASS1.INFORMATION, Type=35, Sunset-Twilight<\/a><\/p>\n<p>Sent when astronomical sunset-twilight happens at the location set by the coordinates. The definition of twilight is<\/p>\n<blockquote><p>Nautical twilight is the period when the center of the Sun is between 6 and 12 degrees below the horizon, when bright stars are still visible in clear weather and the horizon is becoming visible. It is too dark to do outdoor activities without additional lighting.<\/p><\/blockquote>\n<p>You have to enable the events also if they are disabled in the configuration file.<\/p>\n<p>Restating the VSCP daemon with<\/p>\n<blockquote><p>\/etc\/init.d\/vscpd restart<\/p><\/blockquote>\n<p>and then opening<\/p>\n<blockquote><p>http:\/\/192.168.1.6:8080\/vscp\/configure<\/p><\/blockquote>\n<p>in your web browser (replacing 192.168.1.6 with your server ip) will show you the calculated times<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/Screenshot-from-2016-01-31-161753.png\" rel=\"attachment wp-att-1481\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1481\" data-permalink=\"https:\/\/grodansparadis.com\/wordpress\/?attachment_id=1481\" data-orig-file=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/Screenshot-from-2016-01-31-161753.png?fit=373%2C287&amp;ssl=1\" data-orig-size=\"373,287\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot from 2016-01-31 16:17:53\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/Screenshot-from-2016-01-31-161753.png?fit=373%2C287&amp;ssl=1\" class=\"alignnone size-full wp-image-1481\" src=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/Screenshot-from-2016-01-31-161753.png?resize=373%2C287\" alt=\"Screenshot from 2016-01-31 16:17:53\" width=\"373\" height=\"287\" srcset=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/Screenshot-from-2016-01-31-161753.png?w=373&amp;ssl=1 373w, https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/Screenshot-from-2016-01-31-161753.png?resize=300%2C231&amp;ssl=1 300w\" sizes=\"auto, (max-width: 373px) 100vw, 373px\" \/><\/a><\/p>\n<p>We see that today when this is written the sunset is at 15:57 and the sunset twilight is at 16:44 two times one can use to turn on lights because it&#8217;s getting dark outside.<\/p>\n<p>For indoor light I use sunset and for outdoor light I use twilight sunset for this.\u00a0 It all of course depends on how dark one want it to be before lights are turned on.<\/p>\n<p>So setting this up in the web interface<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/Screenshot-from-2016-01-31-162523.png\" rel=\"attachment wp-att-1482\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1482\" data-permalink=\"https:\/\/grodansparadis.com\/wordpress\/?attachment_id=1482\" data-orig-file=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/Screenshot-from-2016-01-31-162523.png?fit=756%2C623&amp;ssl=1\" data-orig-size=\"756,623\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot from 2016-01-31 16:25:23\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/Screenshot-from-2016-01-31-162523.png?fit=580%2C478&amp;ssl=1\" class=\"alignnone size-full wp-image-1482\" src=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/Screenshot-from-2016-01-31-162523.png?resize=580%2C478\" alt=\"Screenshot from 2016-01-31 16:25:23\" width=\"580\" height=\"478\" srcset=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/Screenshot-from-2016-01-31-162523.png?w=756&amp;ssl=1 756w, https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/Screenshot-from-2016-01-31-162523.png?resize=300%2C247&amp;ssl=1 300w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<p><strong>Priority<\/strong> has flags set to zero so we don&#8217;t care about it.<\/p>\n<p><strong>Class<\/strong> is set to 20 which is CLASS1.INFORMATION and corresponding\u00a0 flags are set to 0xFFFF meaning all bits should be checked.<\/p>\n<p><strong>Type<\/strong> is set to 45 which is Sunset and corresponding\u00a0 flags are set to 0xFFFF meaning all bits should be checked.<\/p>\n<p><strong>GUID<\/strong> has mask all set to zero so we don&#8217;t check it.<\/p>\n<p>On <strong>control<\/strong> we see that we don&#8217;t check <strong>index<\/strong>\/<strong>zone<\/strong>\/<strong>subzone<\/strong> but that we enable this row.<\/p>\n<p>So at this point we say that events of type\u00a0\u00a0\u00a0<a href=\"http:\/\/www.vscp.org\/docs\/vscpspec\/doku.php?id=class1.information#type_45_0x2d_sunset\">CLASS1.INFORMATION, Type=45, Sunset<\/a>\u00a0 will perform what ever action we choose.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/Screenshot-from-2016-01-31-162537.png\" rel=\"attachment wp-att-1483\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1483\" data-permalink=\"https:\/\/grodansparadis.com\/wordpress\/?attachment_id=1483\" data-orig-file=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/Screenshot-from-2016-01-31-162537.png?fit=642%2C304&amp;ssl=1\" data-orig-size=\"642,304\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot from 2016-01-31 16:25:37\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/Screenshot-from-2016-01-31-162537.png?fit=580%2C275&amp;ssl=1\" class=\"alignnone size-full wp-image-1483\" src=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/Screenshot-from-2016-01-31-162537.png?resize=580%2C275\" alt=\"Screenshot from 2016-01-31 16:25:37\" width=\"580\" height=\"275\" srcset=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/Screenshot-from-2016-01-31-162537.png?w=642&amp;ssl=1 642w, https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/Screenshot-from-2016-01-31-162537.png?resize=300%2C142&amp;ssl=1 300w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<p>In the &#8220;when-section&#8221; we select when the action should happen. Her from the beginning of time to the the end of time and all weekdays and all times.\u00a0 As you see it is possible to have different schemas for different weekdays and for different time of year.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/Screenshot-from-2016-01-31-162548.png\" rel=\"attachment wp-att-1484\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1484\" data-permalink=\"https:\/\/grodansparadis.com\/wordpress\/?attachment_id=1484\" data-orig-file=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/Screenshot-from-2016-01-31-162548.png?fit=649%2C325&amp;ssl=1\" data-orig-size=\"649,325\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot from 2016-01-31 16:25:48\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/Screenshot-from-2016-01-31-162548.png?fit=580%2C290&amp;ssl=1\" class=\"alignnone size-full wp-image-1484\" src=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/Screenshot-from-2016-01-31-162548.png?resize=580%2C290\" alt=\"Screenshot from 2016-01-31 16:25:48\" width=\"580\" height=\"290\" srcset=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/Screenshot-from-2016-01-31-162548.png?w=649&amp;ssl=1 649w, https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/Screenshot-from-2016-01-31-162548.png?resize=300%2C150&amp;ssl=1 300w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<p>And then we have the action to perform. In my case I execute an external file and turn on lamps in section 1. But there are <a href=\"http:\/\/www.vscp.org\/docs\/vscpd\/doku.php?id=vscp_daemon_decision_matrix#actions\">many actions<\/a> to choose from and <a href=\"http:\/\/www.vscp.org\/docs\/vscpd\/doku.php?id=vscp_daemon_decision_matrix#send_event\">Send Event<\/a> is one. Typically used in his case to send to a group of Paris modules to instruct them to switch some relays on.<\/p>\n<p>You can have many rows that trigger on the same event and therefore easily mix technology and control KNX, Z-wave, VSCP and other alongside each other.<\/p>\n<p>The XML row for this scenario looks like this<\/p>\n<p>&lt;row enable=&#8221;true&#8221; groupid=&#8221;Tellstick&#8221; &gt;<br \/>\n&lt;mask priority=&#8221;0&#8243;<br \/>\nclass=&#8221;65535&#8243;<br \/>\ntype=&#8221;65535&#8243;<br \/>\nGUID=&#8221; 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00&#8243; &gt; &lt;\/mask&gt;<br \/>\n&lt;filter priority=&#8221;0&#8243;<br \/>\nclass=&#8221;20&#8243;<br \/>\ntype=&#8221;45&#8243;<br \/>\nGUID=&#8221; 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00&#8243; &gt;<br \/>\n&lt;\/filter&gt;<br \/>\n&lt;control&gt;0x0&lt;\/control&gt;<br \/>\n&lt;action&gt;0x10&lt;\/action&gt;<br \/>\n&lt;param&gt;\/usr\/local\/bin\/tdtool &#8211;on 1<br \/>\n&lt;comment&gt;Turn on window ligts when sun goes down&lt;\/comment&gt;<br \/>\n&lt;allowed_from&gt;0000-01-01 00:00:00&lt;\/allowed_from&gt;<br \/>\n&lt;allowed_to&gt;9999-12-31 23:59:59&lt;\/allowed_to&gt;<br \/>\n&lt;allowed_weekdays&gt;mtwtfss&lt;\/allowed_weekdays&gt;<br \/>\n&lt;allowed_time&gt;*-*-* *:*:*&lt;\/allowed_time&gt;<br \/>\n&lt;index bMeasurement=&#8221;false&#8221; &gt; 0&lt;\/index&gt;<br \/>\n&lt;zone&gt;0&lt;\/zone&gt;<br \/>\n&lt;subzone&gt;0&lt;\/subzone&gt;<br \/>\n&lt;\/row&gt;<\/p>\n<p><strong>Turn off at sunrise<\/strong><\/p>\n<p>To turn off lights at sunrise just trigger on <a href=\"http:\/\/www.vscp.org\/docs\/vscpspec\/doku.php?id=class1.information#type_44_0x2c_sunrise\">CLASS1.INFORMATION, Type=44, Sunrise<\/a> or\u00a0 <a href=\"http:\/\/www.vscp.org\/docs\/vscpspec\/doku.php?id=class1.information#type_52_0x34_civil_sunrise_twilight_time\">CLASS1.INFORMATION, Type=52, sunrise twilight time<\/a>.\u00a0 The rest is the same as the above case.<\/p>\n<p><strong>Turn off the lights at a specified time<\/strong><\/p>\n<p>Here in this house I turn of some lights for the night at 02:00 regardless. This is how that is done<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/Screenshot-from-2016-01-31-165511.png\" rel=\"attachment wp-att-1485\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1485\" data-permalink=\"https:\/\/grodansparadis.com\/wordpress\/?attachment_id=1485\" data-orig-file=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/Screenshot-from-2016-01-31-165511.png?fit=779%2C623&amp;ssl=1\" data-orig-size=\"779,623\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot from 2016-01-31 16:55:11\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/Screenshot-from-2016-01-31-165511.png?fit=580%2C464&amp;ssl=1\" class=\"alignnone size-full wp-image-1485\" src=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/Screenshot-from-2016-01-31-165511.png?resize=580%2C464\" alt=\"Screenshot from 2016-01-31 16:55:11\" width=\"580\" height=\"464\" srcset=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/Screenshot-from-2016-01-31-165511.png?w=779&amp;ssl=1 779w, https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/Screenshot-from-2016-01-31-165511.png?resize=300%2C240&amp;ssl=1 300w, https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/Screenshot-from-2016-01-31-165511.png?resize=768%2C614&amp;ssl=1 768w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<p><strong>Priority<\/strong> is not used and therefore it&#8217;s corresponding\u00a0 flags are set to zero.<\/p>\n<p><strong>Class<\/strong> is set t 65535 which is <a href=\"http:\/\/www.vscp.org\/docs\/vscpspec\/doku.php?id=class2.vscpd\">CLASS2.VSCP<\/a>. The corresponding flags are set to all ones or 0xffff.<\/p>\n<p><strong>Type<\/strong> is set to 6 and that means we will trigger on <a href=\"http:\/\/www.vscp.org\/docs\/vscpspec\/doku.php?id=class2.vscpd#type_6_0x0006_minute\">CLASS2.VSCP, Type=6, Minute<\/a> events. This event is feed through the matrix every minute. The corresponding flags are set to all ones or 0xffff.<\/p>\n<p><strong>GUID<\/strong> has mask all set to zero so we don&#8217;t check it.<\/p>\n<p>On <strong>control<\/strong> we see that we don&#8217;t check <strong>index<\/strong>\/<strong>zone<\/strong>\/<strong>subzone<\/strong> but that we enable this row.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/Screenshot-from-2016-01-31-165530.png\" rel=\"attachment wp-att-1487\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1487\" data-permalink=\"https:\/\/grodansparadis.com\/wordpress\/?attachment_id=1487\" data-orig-file=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/Screenshot-from-2016-01-31-165530.png?fit=674%2C301&amp;ssl=1\" data-orig-size=\"674,301\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot from 2016-01-31 16:55:30\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/Screenshot-from-2016-01-31-165530.png?fit=580%2C259&amp;ssl=1\" class=\"alignnone size-full wp-image-1487\" src=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/Screenshot-from-2016-01-31-165530.png?resize=580%2C259\" alt=\"Screenshot from 2016-01-31 16:55:30\" width=\"580\" height=\"259\" srcset=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/Screenshot-from-2016-01-31-165530.png?w=674&amp;ssl=1 674w, https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/Screenshot-from-2016-01-31-165530.png?resize=300%2C134&amp;ssl=1 300w, https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/Screenshot-from-2016-01-31-165530.png?resize=672%2C301&amp;ssl=1 672w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<p>Again in the &#8220;when-section&#8221; we select when the action should happen. Her from the beginning of time to the the end of time and all weekdays.\u00a0 The difference here frm the previous example is the<\/p>\n<blockquote><p>*-*-* 02:00:00\/10\/20\/30\/4\/50<\/p><\/blockquote>\n<p>The<\/p>\n<blockquote><p>*-*-*<\/p><\/blockquote>\n<p>says the action will be triggered on every date.\u00a0 If we want a specific thing to happen just on x-as eve we enter that here.<\/p>\n<blockquote><p>02:00:00\/10\/20\/30\/4\/50<\/p><\/blockquote>\n<p>This part could have just been<\/p>\n<blockquote><p>02:00:00<\/p><\/blockquote>\n<p>meaning trigger at that time. But here we added some more times we now trigger on<\/p>\n<blockquote><p>02:00:00<br \/>\n02:00:10<br \/>\n02:00:20<br \/>\n02:00:30<br \/>\n02:00:40<br \/>\n02:00:50<\/p><\/blockquote>\n<p>that is on several times ten second apart.\u00a0 A way to enter this without having a new DM row for each. This is possible on all fields in allowed time. So it is easy to do things at certain days of the month etc.<\/p>\n<p>For the curious I did this so lights definitely will be turned off as I had some interference with the radio signal some times.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/Screenshot-from-2016-01-31-171219.png\" rel=\"attachment wp-att-1489\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1489\" data-permalink=\"https:\/\/grodansparadis.com\/wordpress\/?attachment_id=1489\" data-orig-file=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/Screenshot-from-2016-01-31-171219.png?fit=650%2C331&amp;ssl=1\" data-orig-size=\"650,331\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot from 2016-01-31 17:12:19\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/Screenshot-from-2016-01-31-171219.png?fit=580%2C295&amp;ssl=1\" class=\"alignnone size-full wp-image-1489\" src=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/Screenshot-from-2016-01-31-171219.png?resize=580%2C295\" alt=\"Screenshot from 2016-01-31 17:12:19\" width=\"580\" height=\"295\" srcset=\"https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/Screenshot-from-2016-01-31-171219.png?w=650&amp;ssl=1 650w, https:\/\/i0.wp.com\/grodansparadis.com\/wordpress\/wp-content\/uploads\/2016\/01\/Screenshot-from-2016-01-31-171219.png?resize=300%2C153&amp;ssl=1 300w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/a><\/p>\n<p>And then again we have the action which in this case turn off section 1 instead of on.<\/p>\n<p>And yes turning on something at a certain time is just the same but with another action and also here one can send events or do other things.<\/p>\n<p>The xml line looks like this<\/p>\n<p>&lt;row enable=&#8221;true&#8221; groupid=&#8221;&#8221; &gt;<br \/>\n&lt;mask\u00a0 priority=&#8221;0&#8243;\u00a0 class=&#8221;65535&#8243;\u00a0 type=&#8221;65535&#8243;\u00a0 GUID=&#8221; 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00&#8243; &gt; &lt;\/mask&gt;<br \/>\n&lt;filter\u00a0 priority=&#8221;0&#8243;\u00a0 class=&#8221;65535&#8243;\u00a0 type=&#8221;6&#8243;\u00a0 GUID=&#8221; 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00&#8243; &gt; &lt;\/filter&gt;<br \/>\n&lt;control&gt;0x0&lt;\/control&gt;<br \/>\n&lt;action&gt;0x10&lt;\/action&gt;<br \/>\n&lt;param&gt;\/usr\/local\/bin\/tdtool &#8211;off 1;<br \/>\n&lt;comment&gt;Turn off window lights @ 02:00&lt;\/comment&gt;<br \/>\n&lt;allowed_from&gt;0000-01-01 00:00:00&lt;\/allowed_from&gt;<br \/>\n&lt;allowed_to&gt;9999-12-31 23:59:59&lt;\/allowed_to&gt;<br \/>\n&lt;allowed_weekdays&gt;mtwtfss&lt;\/allowed_weekdays&gt;<br \/>\n&lt;allowed_time&gt;*-*-* 02:00:00\/10\/20\/30\/40\/50&lt;\/allowed_time&gt;<br \/>\n&lt;index\u00a0 bMeasurement=&#8221;false&#8221;\u00a0 &gt; 0&lt;\/index&gt;<br \/>\n&lt;zone&gt;0&lt;\/zone&gt;<br \/>\n&lt;subzone&gt;0&lt;\/subzone&gt;<br \/>\n&lt;\/row&gt;<\/p>\n<p>&nbsp;<\/p>\n<p><strong>The future<\/strong><\/p>\n<p>Time time is a resource that is limited.\u00a0 When I did the DM of the VSCP daemon a long time ago an external nice and user friendly interface to edit it was planed. Not the web based interface that is available to day which is targeting a technical user.\u00a0 Actually editing is possible remotely also today so it is only the UX code missing.\u00a0 That will probably come in place one day. Giving this functionality the attention and usability it deserves.<\/p>\n<p>An even more exciting feature that will come to this functionality, probably in the next release, is scripting right inside the VSCP daemon. That will make this an extremely cool cat.<\/p>\n<p>Hopefully this gave some lights of the magic\u2019s of the VSCP daemon DM.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I got the following question from a VSCP users How to turn on lights at sunset. How to turn off the lights at a specified time (either sunset + x hrs, or for example at YY:ZZ). How to turn on at a certain time. How to turn off at sunrise. So the easiest way to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[3,46],"tags":[],"class_list":["post-1477","post","type-post","status-publish","format-standard","hentry","category-can4vscp-paris","category-the-vscp-daemon"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p4raCZ-nP","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/grodansparadis.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1477","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/grodansparadis.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/grodansparadis.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/grodansparadis.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/grodansparadis.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1477"}],"version-history":[{"count":3,"href":"https:\/\/grodansparadis.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1477\/revisions"}],"predecessor-version":[{"id":1491,"href":"https:\/\/grodansparadis.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1477\/revisions\/1491"}],"wp:attachment":[{"href":"https:\/\/grodansparadis.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1477"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/grodansparadis.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1477"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/grodansparadis.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1477"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}