{"id":157,"date":"2021-06-18T13:59:03","date_gmt":"2021-06-18T13:59:03","guid":{"rendered":"https:\/\/csiag.eu\/?p=157"},"modified":"2022-12-31T15:09:01","modified_gmt":"2022-12-31T15:09:01","slug":"create-smarthome-programs","status":"publish","type":"post","link":"https:\/\/csiag.eu\/en\/blog\/2021\/06\/18\/smarthome-programme-erstellen\/","title":{"rendered":"SmartHome \u2013 create programs"},"content":{"rendered":"<span class=\"span-reading-time rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">Reading time<\/span> <span class=\"rt-time\"> 3<\/span> <span class=\"rt-label rt-postfix\">minutes<\/span><\/span>\n<p class=\"wp-block-paragraph\">SmartHome programs are used to individually map scenarios that cannot be implemented with direct links. The overview of the programs can be accessed in the menu under \u201cPrograms and shortcuts\u201d \u2013 \u201cPrograms &amp; control panel shortcuts\u201d.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"112\" src=\"https:\/\/csiag.eu\/wp-content\/uploads\/2021\/06\/image-28-1024x112.png\" alt=\"\" class=\"wp-image-158\" srcset=\"https:\/\/csiag.eu\/wp-content\/uploads\/2021\/06\/image-28-1024x112.png 1024w, https:\/\/csiag.eu\/wp-content\/uploads\/2021\/06\/image-28-300x33.png 300w, https:\/\/csiag.eu\/wp-content\/uploads\/2021\/06\/image-28-768x84.png 768w, https:\/\/csiag.eu\/wp-content\/uploads\/2021\/06\/image-28-1536x169.png 1536w, https:\/\/csiag.eu\/wp-content\/uploads\/2021\/06\/image-28-2048x225.png 2048w, https:\/\/csiag.eu\/wp-content\/uploads\/2021\/06\/image-28-1560x171.png 1560w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">A new program is created by clicking on the \u201cNew\u201d button at the bottom left. An existing one can be edited by clicking on the \u201cEdit\u201d button on the right in the line of the respective program.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"313\" src=\"https:\/\/csiag.eu\/wp-content\/uploads\/2021\/06\/image-29-1024x313.png\" alt=\"\" class=\"wp-image-163\" srcset=\"https:\/\/csiag.eu\/wp-content\/uploads\/2021\/06\/image-29-1024x313.png 1024w, https:\/\/csiag.eu\/wp-content\/uploads\/2021\/06\/image-29-300x92.png 300w, https:\/\/csiag.eu\/wp-content\/uploads\/2021\/06\/image-29-768x235.png 768w, https:\/\/csiag.eu\/wp-content\/uploads\/2021\/06\/image-29-1536x470.png 1536w, https:\/\/csiag.eu\/wp-content\/uploads\/2021\/06\/image-29-2048x627.png 2048w, https:\/\/csiag.eu\/wp-content\/uploads\/2021\/06\/image-29-1560x477.png 1560w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#039;s look at the first program listed here &quot;A_EI_KY_Unlocked_Presence&quot; by clicking on the &quot;Edit&quot; button:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"263\" src=\"https:\/\/csiag.eu\/wp-content\/uploads\/2021\/06\/image-30-1024x263.png\" alt=\"\" class=\"wp-image-165\" srcset=\"https:\/\/csiag.eu\/wp-content\/uploads\/2021\/06\/image-30-1024x263.png 1024w, https:\/\/csiag.eu\/wp-content\/uploads\/2021\/06\/image-30-300x77.png 300w, https:\/\/csiag.eu\/wp-content\/uploads\/2021\/06\/image-30-768x197.png 768w, https:\/\/csiag.eu\/wp-content\/uploads\/2021\/06\/image-30-1536x394.png 1536w, https:\/\/csiag.eu\/wp-content\/uploads\/2021\/06\/image-30-2048x525.png 2048w, https:\/\/csiag.eu\/wp-content\/uploads\/2021\/06\/image-30-1560x400.png 1560w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">According to the nomenclature mentioned at the beginning, this is apartment A, entrance, door lock, which should switch to the \u201cunlocked\u201d position when someone is present.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here, the system variable \u201cPresence\u201d was first selected from the list of system variables by clicking on the \u201cSystem status\u201d button. The drop-down menus allow different scenarios, such as \u201con \/ not on\u201d, \u201cpresent \/ not present\u201d, \u201ctrigger on update \/ check \/ trigger on change\u201d. Here, the condition should be formulated in the IF branch that when the status changes from \u201cnot present\u201d to \u201cpresent\u201d, the action(s) defined in the THEN branch are carried out.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The check box \u201cBefore executing\u2026\u201d usually remains activated in order to reset processes that may have been delayed by other programs with regard to the same components and to ensure that the program runs smoothly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The THEN branch defines the intended action, which involves executing a script that sends an email (e.g. that the person is now present) and unlocking the door lock.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The program, which works in contrast to this, locks the door if the person is recognized as \u201cnot present\u201d. In this way, insurance law aspects are protected and the insurance company will settle any break-in that occurs because the door can be proven to have been properly locked (via email and the system log).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The drop-down menu offers the variants \u201cDevice selection, System variable, Script\u201d. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Scripts can be created in the so-called script editor and tested by clicking on the \u201cRun\u201d button. The script editor opens automatically as soon as the \u201cScript\u201d option is selected.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"289\" src=\"https:\/\/csiag.eu\/wp-content\/uploads\/2021\/06\/image-31-1024x289.png\" alt=\"\" class=\"wp-image-166\" srcset=\"https:\/\/csiag.eu\/wp-content\/uploads\/2021\/06\/image-31-1024x289.png 1024w, https:\/\/csiag.eu\/wp-content\/uploads\/2021\/06\/image-31-300x85.png 300w, https:\/\/csiag.eu\/wp-content\/uploads\/2021\/06\/image-31-768x217.png 768w, https:\/\/csiag.eu\/wp-content\/uploads\/2021\/06\/image-31-1536x433.png 1536w, https:\/\/csiag.eu\/wp-content\/uploads\/2021\/06\/image-31-2048x578.png 2048w, https:\/\/csiag.eu\/wp-content\/uploads\/2021\/06\/image-31-1560x440.png 1560w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The script content:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><kbd>string stdout;<br>string stderr;<br>system.Exec(&quot;\/etc\/config\/addons\/email\/email 20&quot;, &amp;stdout, &amp;stderr);<\/kbd><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Except for the \u201c20\u201d on the third line, everything is \u201cstandard\u201d code. Only \u201c20\u201d refers to the email template number 20, the content of which is the email message \u201cPerson x is present\u201d. Mail delivery is always initiated in this way.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The drop-down menu \u201cimmediately \/ delayed at\u201d determines whether the action is carried out immediately or with a time delay (s, m, h).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In the \u201cLock unlocked\u201d drop-down menu, the options \u201clock locked \/ open door \/ automatically lock after time\u201d are available to choose from.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The script is saved by clicking on the \u201cOK\u201d button at the bottom left. The program is then saved by clicking on the \u201cOK\u201d button at the bottom left and is then available for immediate execution when the event occurs.<\/p>","protected":false},"excerpt":{"rendered":"<p><span class=\"span-reading-time rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\">Reading time<\/span> <span class=\"rt-time\"> 3<\/span> <span class=\"rt-label rt-postfix\">minutes<\/span><\/span>SmartHome programs are used to individually map scenarios that cannot be implemented with direct links. The overview of the programs can be called up in the menu under \"Programs and shortcuts\" - \"Programs &amp; central unit shortcuts\". A new program is created by clicking on the \"New\" button at the bottom left. An existing program can be edited by clicking on the \"Edit\" button...&nbsp;<a href=\"https:\/\/csiag.eu\/en\/blog\/2021\/06\/18\/smarthome-programme-erstellen\/\" rel=\"bookmark\">Read More \"<span class=\"screen-reader-text\">SmartHome \u2013 create programs<\/span><\/a><\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","footnotes":""},"categories":[346,353],"tags":[736,734,737,732,735,730,462,371,738,370,731,373,733],"class_list":["post-157","post","type-post","status-publish","format-standard","hentry","category-smarthome","category-smarthome-programme-erstellen","tag-anwesenheit","tag-dann","tag-geraeteauswahl","tag-komponenten","tag-nomenklatur","tag-programme","tag-programmierung","tag-skript","tag-skript-editor","tag-smarthome","tag-systemprotokoll","tag-systemvariable","tag-wenn"],"modified_by":"Achim Goerner","_links":{"self":[{"href":"https:\/\/csiag.eu\/en\/wp-json\/wp\/v2\/posts\/157","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/csiag.eu\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/csiag.eu\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/csiag.eu\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/csiag.eu\/en\/wp-json\/wp\/v2\/comments?post=157"}],"version-history":[{"count":0,"href":"https:\/\/csiag.eu\/en\/wp-json\/wp\/v2\/posts\/157\/revisions"}],"wp:attachment":[{"href":"https:\/\/csiag.eu\/en\/wp-json\/wp\/v2\/media?parent=157"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/csiag.eu\/en\/wp-json\/wp\/v2\/categories?post=157"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/csiag.eu\/en\/wp-json\/wp\/v2\/tags?post=157"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}