{"id":191,"date":"2025-07-27T11:44:08","date_gmt":"2025-07-27T08:44:08","guid":{"rendered":"https:\/\/www.kilpio.fi\/?p=191"},"modified":"2025-07-27T11:44:09","modified_gmt":"2025-07-27T08:44:09","slug":"kioskinayton-kaynnistys-webbikameran-avulla","status":"publish","type":"post","link":"https:\/\/www.kilpio.fi\/index.php\/2025\/07\/27\/kioskinayton-kaynnistys-webbikameran-avulla\/","title":{"rendered":"Kioskin\u00e4yt\u00f6n k\u00e4ynnistys webbikameran avulla"},"content":{"rendered":"\n<p>Ohjaan Home Assistant kodinohjausj\u00e4rjestelm\u00e4\u00e4 keitti\u00f6ss\u00e4 sijaitsevalla kosketusn\u00e4yt\u00f6llisell\u00e4 tietokoneella, jossa on Ubuntu 24 LTS k\u00e4ytt\u00f6j\u00e4rjetelm\u00e4 ja Firefox selain kioskimoodissa.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"480\" height=\"640\" src=\"https:\/\/www.kilpio.fi\/wp-content\/uploads\/2025\/07\/IMG_0393-rotated.jpg\" alt=\"\" class=\"wp-image-192\" style=\"width:335px;height:auto\" srcset=\"https:\/\/www.kilpio.fi\/wp-content\/uploads\/2025\/07\/IMG_0393-rotated.jpg 480w, https:\/\/www.kilpio.fi\/wp-content\/uploads\/2025\/07\/IMG_0393-225x300.jpg 225w\" sizes=\"auto, (max-width: 480px) 100vw, 480px\" \/><\/figure>\n\n\n\n<p>Koska haluan n\u00e4yt\u00f6n olevan sammutettuna sillon kun kukaan ei ole sit\u00e4 katsomassa, pimennet\u00e4\u00e4n se kun n\u00e4yt\u00f6n webbikamera ei ole n\u00e4hnyt liikett\u00e4 puoleen tuntiin.<\/p>\n\n\n\n<p>T\u00e4m\u00e4 onnistuu k\u00e4ytt\u00e4m\u00e4ll\u00e4 &#8221;motion&#8221; lis\u00e4osaa, jonka saa asennettua Ubuntuun komennolla &#8221;sudo apt install motion&#8221;. T\u00e4m\u00e4n j\u00e4lkeen konfiguroidaan motion: &#8221;sudo nano \/etc\/motion\/motion.conf&#8221;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Rename this distribution example file to motion.conf\n#\n# This config file was generated by motion 4.6.0\n# Documentation:  \/usr\/share\/doc\/motion\/motion_guide.html\n#\n# This file contains only the basic configuration options to get a\n# system working.  There are many more options available.  Please\n# consult the documentation for the complete list of all options.\n#\n\n############################################################\n# System control configuration parameters\n############################################################\n\n# Start in daemon (background) mode and release terminal.\ndaemon off\n\n# Start in Setup-Mode, daemon disabled.\nsetup_mode off\n\n# File to store the process ID.\n; pid_file value\n\n# File to write logs messages into.  If not defined stderr and syslog is used.\nlog_file \/var\/log\/motion\/motion.log\n\n# Level of log messages &#91;1..9] (EMG, ALR, CRT, ERR, WRN, NTC, INF, DBG, ALL).\nlog_level 6\n\n# Target directory for pictures, snapshots and movies\ntarget_dir \/var\/lib\/motion\n\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\"># Video device (e.g. \/dev\/video0) to be used for capturing.\nvideo_device \/dev\/video0<\/mark>\n\n# Parameters to control video device.  See motion_guide.html\n; video_params value\n\n# The full URL of the network camera stream.\n; netcam_url value\n\n# Name of mmal camera (e.g. vc.ril.camera for pi camera).\n; mmalcam_name value\n\n# Camera control parameters (see raspivid\/raspistill tool documentation)\n; mmalcam_params value\n\n############################################################\n# Image Processing configuration parameters\n############################################################\n\n# Image width in pixels.\nwidth 640\n\n# Image height in pixels.\nheight 480\n\n# Maximum number of frames to be captured per second.\nframerate 15\n\n# Text to be overlayed in the lower left corner of images\ntext_left CAMERA1\n\n# Text to be overlayed in the lower right corner of images.\ntext_right %Y-%m-%d\\n%T-%q\n\n############################################################\n# Motion detection configuration parameters\n############################################################\n\n\n# Always save pictures and movies even if there was no motion.\nemulate_motion off\n\n# Threshold for number of changed pixels that triggers motion.\nthreshold 1500\n\n# Noise threshold for the motion detection.\n; noise_level 32\n\n# Despeckle the image using (E\/e)rode or (D\/d)ilate or (l)abel.\ndespeckle_filter EedDl\n\n# Number of images that must contain motion to trigger an event.\nminimum_motion_frames 1\n\n# Gap in seconds of no motion detected that triggers the end of an event.\nevent_gap 60\n\n# The number of pre-captured (buffered) pictures from before motion.\npre_capture 3\n\n# Number of frames to capture after motion is no longer detected.\npost_capture 0\n\n############################################################\n# Script execution configuration parameters\n############################################################\n\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\"># Command to be executed when an event starts.\non_event_start ydotool key 65<\/mark>\n\n# Command to be executed when an event ends.\n; on_event_end\n\n# Command to be executed when a movie file is closed.\n; on_movie_end value\n\n############################################################\n# Picture output configuration parameters\n############################################################\n\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\"># Output pictures when motion is detected\npicture_output off<\/mark>\n\n# File name(without extension) for pictures relative to target directory\npicture_filename %Y%m%d%H%M%S-%q\n\n############################################################\n# Movie output configuration parameters\n############################################################\n\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\"># Create movies of motion events.\nmovie_output off<\/mark>\n\n# Maximum length of movie in seconds.\nmovie_max_time 60\n\n# The encoding quality of the movie. (0=use bitrate. 1=worst quality, 100=best)\nmovie_quality 45\n\n# Container\/Codec to used for the movie. See motion_guide.html\nmovie_codec mkv\n\n# File name(without extension) for movies relative to target directory\nmovie_filename %t-%v-%Y%m%d%H%M%S\n\n############################################################\n# Webcontrol configuration parameters\n############################################################\n\n# Port number used for the webcontrol.\nwebcontrol_port 8080\n\n# Restrict webcontrol connections to the localhost.\nwebcontrol_localhost on\n\n# Type of configuration options to allow via the webcontrol.\nwebcontrol_parms 0\n\n############################################################\n# Live stream configuration parameters\n############################################################\n\n# The port number for the live stream.\nstream_port 8081\n\n# Restrict stream connections to the localhost.\nstream_localhost off\n\n##############################################################\n# Camera config files - One for each camera.\n##############################################################\n\n; camera \/usr\/etc\/motion\/camera1.conf\n; camera \/usr\/etc\/motion\/camera2.conf\n; camera \/usr\/etc\/motion\/camera3.conf\n; camera \/usr\/etc\/motion\/camera4.conf\n\n##############################################################\n# Directory to read '.conf' files for cameras.\n##############################################################\n; camera_dir \/usr\/etc\/motion\/conf.d<\/code><\/pre>\n\n\n\n<p>Konfiguroinnin j\u00e4lkeen aktivoi ja k\u00e4ynnist\u00e4 motion palvelu:<br>&#8211; systemctl enable motion<br>&#8211; systemctl start motion<\/p>\n\n\n\n<p>Motion palvelun unit tiedosto:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;Unit]\nDescription=Motion detection video capture daemon\nDocumentation=man:motion(1)\n\n&#91;Service]\nType=simple\nUser=root\nExecStart=\/usr\/bin\/motion -n\n\n&#91;Install]\nWantedBy=multi-user.target<\/code><\/pre>\n\n\n\n<p>T\u00e4m\u00e4n j\u00e4lkeen asenna ydotool: sudo yum install ydotool<\/p>\n\n\n\n<p>Motion palvelun konfiguraation m\u00e4\u00e4ritys<br><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\"># Command to be executed when an event starts.<br>on_event_start ydotool key 65<\/mark><\/p>\n\n\n\n<p>aiheuttaa v\u00e4lily\u00f6ntin\u00e4pp\u00e4imen painalluksen webbikameran havaitessa liikett\u00e4.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ohjaan Home Assistant kodinohjausj\u00e4rjestelm\u00e4\u00e4 keitti\u00f6ss\u00e4 sijaitsevalla kosketusn\u00e4yt\u00f6llisell\u00e4 tietokoneella, jossa on Ubuntu 24 LTS k\u00e4ytt\u00f6j\u00e4rjetelm\u00e4 ja Firefox selain kioskimoodissa. Koska haluan n\u00e4yt\u00f6n olevan sammutettuna sillon kun kukaan ei ole sit\u00e4 katsomassa, pimennet\u00e4\u00e4n se kun n\u00e4yt\u00f6n webbikamera ei ole n\u00e4hnyt liikett\u00e4 puoleen tuntiin. T\u00e4m\u00e4 onnistuu k\u00e4ytt\u00e4m\u00e4ll\u00e4 &#8221;motion&#8221; lis\u00e4osaa, jonka saa asennettua Ubuntuun komennolla &#8221;sudo apt install motion&#8221;. &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"https:\/\/www.kilpio.fi\/index.php\/2025\/07\/27\/kioskinayton-kaynnistys-webbikameran-avulla\/\">Jatka lukemista<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,19],"tags":[18,17,16],"class_list":["post-191","post","type-post","status-publish","format-standard","hentry","category-home-assistant","category-ubuntu","tag-kioski","tag-motion","tag-ydotool","item-wrap"],"_links":{"self":[{"href":"https:\/\/www.kilpio.fi\/index.php\/wp-json\/wp\/v2\/posts\/191","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kilpio.fi\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kilpio.fi\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kilpio.fi\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kilpio.fi\/index.php\/wp-json\/wp\/v2\/comments?post=191"}],"version-history":[{"count":3,"href":"https:\/\/www.kilpio.fi\/index.php\/wp-json\/wp\/v2\/posts\/191\/revisions"}],"predecessor-version":[{"id":195,"href":"https:\/\/www.kilpio.fi\/index.php\/wp-json\/wp\/v2\/posts\/191\/revisions\/195"}],"wp:attachment":[{"href":"https:\/\/www.kilpio.fi\/index.php\/wp-json\/wp\/v2\/media?parent=191"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kilpio.fi\/index.php\/wp-json\/wp\/v2\/categories?post=191"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kilpio.fi\/index.php\/wp-json\/wp\/v2\/tags?post=191"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}