<?xml version="1.0" encoding="UTF-8"?>        <rss version="2.0"
             xmlns:atom="http://www.w3.org/2005/Atom"
             xmlns:dc="http://purl.org/dc/elements/1.1/"
             xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
             xmlns:admin="http://webns.net/mvcb/"
             xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
             xmlns:content="http://purl.org/rss/1.0/modules/content/">
        <channel>
            <title>
									SW | Configuration and programming - SmartHome.Exposed Forum				            </title>
            <link>https://smarthome.exposed/community/sw-configuration-and-programming/</link>
            <description>SmartHome.Exposed Discussion Board</description>
            <language>en-US</language>
            <lastBuildDate>Wed, 15 Apr 2026 23:39:23 +0000</lastBuildDate>
            <generator>wpForo</generator>
            <ttl>60</ttl>
							                    <item>
                        <title>Regular data backup from Loxone Miniserver to Synology NAS</title>
                        <link>https://smarthome.exposed/community/sw-configuration-and-programming/regular-data-backup-from-loxone-miniserver-to-synology-nas/</link>
                        <pubDate>Mon, 20 Aug 2018 10:53:34 +0000</pubDate>
                        <description><![CDATA[I just found very nice post about how to backup data through FTP to Synology. It is well applicable for Loxone as well, so if you are interested, you can find it here.I don&#039;t want to steal a...]]></description>
                        <content:encoded><![CDATA[<p>I just found very nice post about how to backup data through FTP to Synology. It is well applicable for Loxone as well, so if you are interested, you can find it <a href="https://evotec.xyz/how-to-backup-ftp-to-synology/">here</a>.</p><p><img class="align-left" src="https://smarthome.exposed/sites/default/files/inline-images/task_scheduler.jpg" alt="Task Scheduler" width="70" height="50" />I don't want to steal anyone else's ideas, but just for case the original posts dissapears, here is the custom two line script doing the trick. In the task scheduler (Control Panel / Task Scheduler) you create regular task with the following user-defined script pasted in the Run Command box:</p><table><tbody><tr><td><pre>wget -m ftp://&lt;username&gt;:&lt;password&gt;@&lt;server_ip&gt;/* -P /volume1/SecureBackups

tar -zcvf /volume1/SecureBackups/backup-$(date +%Y-%m-%d-%H-%M-%S).tar.gz /volume1/SecureBackups/&lt;server_ip&gt;/</pre></td></tr></tbody></table><p> </p><p><img class="align-center" src="https://smarthome.exposed/sites/default/files/inline-images/task_scheduler_miniserver_backup_script.jpg" alt="task scheduler miniserver backup script" /></p><p>What it does is that wget command mirrors the content of the FTP site (see <a href="https://www.gnu.org/software/wget/manual/wget.html">documentation to wget here for more details</a>) and stores these data to the directory listed after the -P parameter (locally at Synology storage). The beauty of this command is that with the next runs it only re-downloads the differences, so you don't need to transfer all the data over and over.</p><p>Then the next line creates compressed package of the whole structure downloaded, with date stamped filename. In my case, these are around 30MB for the whole miniserver structure compressed.</p><p>Please note that FTP is very old internet protocol and transfers plain username and password over the network. You should use this only on your local network, otherwise you're at risk of attacking your system by someone stealing these credentials. Also, your credentials are visible in the script in the Synology task details so please consider these factors when applying this solution.</p><p>However, this provides nice and simple solution how to schedule regular backup of the data from Loxone Miniserver to your local storage. Thanks a lot to Evotec for the idea.</p>]]></content:encoded>
						                            <category domain="https://smarthome.exposed/community/sw-configuration-and-programming/">SW | Configuration and programming</category>                        <dc:creator>Kops</dc:creator>
                        <guid isPermaLink="true">https://smarthome.exposed/community/sw-configuration-and-programming/regular-data-backup-from-loxone-miniserver-to-synology-nas/</guid>
                    </item>
				                    <item>
                        <title>Camera snapshot from Surveillance Station sent via email triggered by Loxone</title>
                        <link>https://smarthome.exposed/community/sw-configuration-and-programming/camera-snapshot-from-surveillance-station-sent-via-email-triggered-by-loxone/</link>
                        <pubDate>Mon, 20 Aug 2018 10:48:43 +0000</pubDate>
                        <description><![CDATA[If you use Synology NAS and have some IP cameras installed, this might be interesting topic for you. I was looking for a way how to get snapshot from the camera on certain events from Loxone...]]></description>
                        <content:encoded><![CDATA[<p>If you use Synology NAS and have some IP cameras installed, this might be interesting topic for you. I was looking for a way how to get snapshot from the camera on certain events from Loxone. In <a href="http://forum.universal-devices.com/topic/14890-synology-surveillance-station-and-rest/page-3">this forum</a> someone found a way how to get the actual image from Surveillance Station. All you need is to have PHP interpreter package installed on your Synology and <a title="External link" href="https://github.com/PHPMailer/PHPMailer" rel="nofollow external">PHPMailer</a> downloaded to your web folder. Whenever you call the script below, it sends an email to defined recipients with attached image from the IP camera.</p><p>I just slightly modified the script to allow more than one recipient of the mail. To make this work for you just change the location of the PHPMailer according to your location in the web directory tree, replace all placeholders like &lt;synology_ip&gt;, &lt;port&gt; usually 5000, &lt;login&gt;, &lt;password&gt;, smtp server address, email recipients, subject, body of the message and few other details. Next place this updated PHP script in the folder of your web server on Synology.</p><p> </p><table><tbody><tr><td><p>&lt;?php</p><p><strong>require</strong> '../PHPMailer/PHPMailerAutoload.php'; <em>// Path to the PHPMailer script</em></p><p>$cookieFile = "session_cookie.txt";</p><p>$ch = curl_init();</p><p>curl_setopt($ch, CURLOPT_COOKIEJAR, $cookieFile);</p><p>curl_setopt($ch, CURLOPT_URL,"http://&lt;synology_ip&gt;:&lt;port&gt;/webapi/auth.cgi?api=SYNO.API.Auth&amp;method=Login&amp;version=1&amp;account=&lt;login&gt;&amp;passwd=&lt;password&gt;&amp;session=SurveillanceStation");</p><p>curl_exec ($ch);</p><p>curl_close ($ch);</p><p><strong>unset</strong>($ch);</p><p> </p><p> </p><p>$ch = curl_init('http://&lt;synology_ip&gt;:&lt;port&gt;/webapi/_______________________________________________________entry.cgi?api=SYNO.SurveillanceStation.Camera&amp;method=GetSnapshot&amp;version=1&amp;cameraId=&lt;id&gt;');</p><p>curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);</p><p>curl_setopt($ch, CURLOPT_COOKIEFILE, $cookieFile);</p><p>$fp = fopen('camera_snapshot.jpg', 'wb');</p><p>curl_setopt($ch, CURLOPT_FILE, $fp);</p><p>curl_setopt($ch, CURLOPT_HEADER, 0);</p><p>curl_exec($ch);</p><p>curl_close($ch);</p><p>fclose($fp);</p><p><strong>unset</strong>($ch);</p><p> </p><p>$fileatt = "camera_snapshot.jpg"; <em>// Path to the file</em></p><p>$fileatt_type = "image/jpg"; <em>// File Type</em></p><p>$fileatt_name = "camera_snapshot.jpg"; <em>// Filename that will be used for the file as the attachment</em></p><p>$email_from = "&lt;email name&gt;"; <em>// Who the email is from</em></p><p> </p><p>$mail = <strong>new</strong> PHPMailer;</p><p> </p><p><em>//$mail-&gt;SMTPDebug = 3;                               // Enable verbose debug output</em></p><p> </p><p>$mail-&gt;isSMTP();                                      <em>// Set mailer to use SMTP</em></p><p>$mail-&gt;Host = '&lt;smtp_server&gt;';  <em>// Specify main and backup SMTP servers</em></p><p>$mail-&gt;SMTPAuth = <strong>false</strong>;                               <em>// Enable SMTP authentication</em></p><p>$mail-&gt;Username = '';                 <em>// SMTP username</em></p><p>$mail-&gt;Password = '';                           <em>// SMTP password</em></p><p>$mail-&gt;SMTPSecure = 'tls';                            <em>// Enable TLS encryption, `ssl` also accepted</em></p><p>$mail-&gt;Port = 25;                                    <em>// TCP port to connect to</em></p><p> </p><p>$mail-&gt;From = '&lt;from_email&gt;';</p><p>$mail-&gt;FromName = '&lt;from_name&gt;';</p><p>$mail-&gt;addAddress('&lt;to_email_1&gt;', '&lt;to_name_1&gt;');     <em>// Add a recipient 1</em></p><p>$mail-&gt;addAddress('&lt;to_email_2&gt;', '&lt;to_name_2&gt;');     <em>// Add a recipient 2</em></p><p> </p><p>$datum = Date("j-m-Y_H:i:s", Time());</p><p> </p><p>$mail-&gt;addAttachment('camera_snapshot.jpg', 'snapshot_'.$datum.'.jpg');    <em>// Optional name</em></p><p>$mail-&gt;isHTML(<strong>false</strong>);                                  <em>// Set email format to HTML</em></p><p> </p><p>$mail-&gt;Subject = '&lt;email_subject&gt;';</p><p>$mail-&gt;Body    = '&lt;email_body_text&gt;';</p><p>$mail-&gt;SMTPOptions = <strong>array</strong>(</p><p>    'ssl' =&gt; <strong>array</strong>(</p><p>        'verify_peer' =&gt; <strong>false</strong>,</p><p>        'verify_peer_name' =&gt; <strong>false</strong>,</p><p>        'allow_self_signed' =&gt; <strong>true</strong></p><p>    )</p><p>);</p><p> </p><p><strong>if</strong>(!$mail-&gt;send()) {</p><p>    <strong>echo</strong> 'Message could not be sent.';</p><p>    <strong>echo</strong> 'Mailer Error: ' . $mail-&gt;ErrorInfo;</p><p>} <strong>else</strong> {</p><p>    <strong>echo</strong> 'Message has been sent';</p><p>}</p><p> </p><p>$ch = curl_init();</p><p>curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);</p><p>curl_setopt($ch, CURLOPT_COOKIEFILE, $cookieFile);</p><p>curl_setopt($ch, CURLOPT_URL,"http://&lt;synology_ip&gt;:&lt;port&gt;/webapi/auth.cgi?api=SYNO.API.Auth&amp;method=Logout&amp;version=1&amp;session=SurveillanceStation");</p><p>curl_exec ($ch);</p><p>curl_close ($ch);</p><p><strong>unset</strong>($ch);</p><p> </p><p>unlink($cookieFile);</p><p>unlink($fileatt);</p><p>?&gt;</p><p> </p></td></tr></tbody></table><p>Now you can try to debug and test this by executing the script from your browser. If all works, next part is to create virtual output in Loxone Config to be able to trigger the script by certain events.</p><p><img src="https://smarthome.exposed/sites/default/files/inline-images/camera_capture2.jpg" alt="Create new virtual output" /></p><p>Just add new virtual output, modify your IP address of the Synology NAS, and add the path tho the script to be executed when this output is ON. </p><p><img src="https://smarthome.exposed/sites/default/files/inline-images/camera_capture1.jpg" alt="Command to execute the script" /></p><p>Now you can trigger this output by any action you like, for instance when the door is open, movement registered, alarm disarmed, anything you like.</p>]]></content:encoded>
						                            <category domain="https://smarthome.exposed/community/sw-configuration-and-programming/">SW | Configuration and programming</category>                        <dc:creator>Kops</dc:creator>
                        <guid isPermaLink="true">https://smarthome.exposed/community/sw-configuration-and-programming/camera-snapshot-from-surveillance-station-sent-via-email-triggered-by-loxone/</guid>
                    </item>
							        </channel>
        </rss>
		