{"id":419,"date":"2017-07-15T11:11:55","date_gmt":"2017-07-15T09:11:55","guid":{"rendered":"http:\/\/www.maxx.net.ua\/?p=419"},"modified":"2017-07-15T11:11:55","modified_gmt":"2017-07-15T09:11:55","slug":"openhab-%d0%bc%d0%be%d0%bd%d1%96%d1%82%d0%be%d1%80%d1%96%d0%bd%d0%b3-%d0%bd%d0%b0%d0%bf%d1%80%d1%83%d0%b3%d0%b8-%d0%b2-%d0%bc%d0%b5%d1%80%d0%b5%d0%b6%d1%96","status":"publish","type":"post","link":"https:\/\/www.maxx.net.ua\/?p=419","title":{"rendered":"OpenHAB &#8211; \u043c\u043e\u043d\u0456\u0442\u043e\u0440\u0456\u043d\u0433 \u043d\u0430\u043f\u0440\u0443\u0433\u0438 \u0443 \u043c\u0435\u0440\u0435\u0436\u0456"},"content":{"rendered":"<h1>\u0412\u0438\u043c\u043e\u0433\u0438<\/h1>\n<ul>\n<li>Openhab \u043d\u0430 ubuntu<\/li>\n<li>Back-UPS XS 1100CI (\u043c\u043e\u0436\u043d\u0430 \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0432\u0430\u0442\u0438 \u0431\u0443\u0434\u044c-\u044f\u043a\u0438\u0439 \u0456\u043d\u0448\u0438\u0439, \u0430\u043b\u0435 \u0432 \u043c\u0435\u043d\u0435 \u0441\u0430\u043c\u0435 \u0442\u0430\u043a\u0438\u0439)<\/li>\n<\/ul>\n<h1>\u041f\u0456\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430<\/h1>\n<h2>\u0412\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044f Apcupsd<\/h2>\n<p>\u0406\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0456\u044e \u043c\u043e\u0436\u043d\u0430 \u0437\u043d\u0430\u0439\u0442\u0438 \u043d\u0430\u043f\u0440\u0438\u043a\u043b\u0430\u0434 \u0437\u0430 <a href=\"https:\/\/www.cyberciti.biz\/faq\/debian-ubuntu-centos-rhel-install-apcups\/\">\u0446\u0438\u043c<\/a> \u043f\u043e\u0441\u0438\u043b\u0430\u043d\u043d\u044f\u043c.<\/p>\n<p>\u042f\u043a \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043c\u0438 \u043f\u043e\u0432\u0438\u043d\u043d\u0456 \u043c\u0430\u0442\u0438 \u0437\u043c\u043e\u0433\u0443 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 apcaccess, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u0438\u0432\u043e\u0434\u0443 \u043a\u043e\u0442\u0440\u043e\u0457 \u043c\u0438 \u0439 \u0431\u0443\u0434\u0435\u043c\u043e \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0432\u0430\u0442\u0438<\/p>\n<pre class=\"nums:false lang:default decode:true \">pi@openhab:\/etc\/openhab2 $ apcaccess\nAPC      : 001,036,0868\nDATE     : 2017-07-15 12:12:51 +0300\nHOSTNAME : openhab\nVERSION  : 3.14.12 (29 March 2014) debian\nUPSNAME  : openhab\nCABLE    : USB Cable\nDRIVER   : USB UPS Driver\nUPSMODE  : Stand Alone\nSTARTTIME: 2017-07-15 11:02:42 +0300\nMODEL    : Back-UPS XS 1100CI\nSTATUS   : ONLINE\nLINEV    : 236.0 Volts\nLOADPCT  : 1.0 Percent\nBCHARGE  : 100.0 Percent\nTIMELEFT : 269.3 Minutes\nMBATTCHG : 5 Percent\nMINTIMEL : 3 Minutes\nMAXTIME  : 0 Seconds\nSENSE    : Medium\nLOTRANS  : 155.0 Volts\nHITRANS  : 280.0 Volts\nALARMDEL : No alarm\nBATTV    : 27.2 Volts\nLASTXFER : No transfers since turnon\nNUMXFERS : 0\nTONBATT  : 0 Seconds\nCUMONBATT: 0 Seconds\nXOFFBATT : N\/A\nSELFTEST : NO\nSTATFLAG : 0x05000008\nSERIALNO : XBXXXXX0XXXX\nBATTDATE : 2015-03-17\nNOMINV   : 230 Volts\nNOMBATTV : 24.0 Volts\nNOMPOWER : 660 Watts\nFIRMWARE : 920.T4 .I USB FW:T4\nEND APC  : 2017-07-15 12:12:51 +0300\n<\/pre>\n<p>&nbsp;<\/p>\n<h2>\u041f\u0456\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 OpenHAB<\/h2>\n<p>\u0412\u0456\u0434\u043a\u0440\u0438\u0454\u043c\u043e \u043f\u0430\u043d\u0435\u043b\u044c \u043a\u043e\u043d\u0444\u0456\u0433\u0443\u0440\u0443\u0432\u0430\u043d\u043d\u044f OpenHAB \u0442\u0430 \u0432\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c\u043e<\/p>\n<section id=\"documentation\" class=\"text content-wrapper\">\n<div class=\"container\">\n<div class=\"content\">\n<p id=\"exec-binding\" style=\"text-align: left;\"><a href=\"http:\/\/docs.openhab.org\/addons\/bindings\/exec\/readme.html\">Exec Binding<\/a><\/p>\n<p><a href=\"http:\/\/www.maxx.net.ua\/wp-content\/uploads\/2017\/07\/apc-monitor-step-1.png\"><img loading=\"lazy\" class=\"alignnone wp-image-420 size-large\" src=\"http:\/\/www.maxx.net.ua\/wp-content\/uploads\/2017\/07\/apc-monitor-step-1-1024x494.png\" alt=\"\" width=\"640\" height=\"309\" srcset=\"https:\/\/www.maxx.net.ua\/wp-content\/uploads\/2017\/07\/apc-monitor-step-1-1024x494.png 1024w, https:\/\/www.maxx.net.ua\/wp-content\/uploads\/2017\/07\/apc-monitor-step-1-300x145.png 300w, https:\/\/www.maxx.net.ua\/wp-content\/uploads\/2017\/07\/apc-monitor-step-1-768x371.png 768w, https:\/\/www.maxx.net.ua\/wp-content\/uploads\/2017\/07\/apc-monitor-step-1-1568x757.png 1568w, https:\/\/www.maxx.net.ua\/wp-content\/uploads\/2017\/07\/apc-monitor-step-1.png 1693w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<\/div>\n<\/div>\n<\/section>\n<p style=\"text-align: left;\"><a href=\"http:\/\/docs.openhab.org\/addons\/transformations\/regex\/readme.html\">RegEx Transformation<\/a><\/p>\n<p><a href=\"http:\/\/www.maxx.net.ua\/wp-content\/uploads\/2017\/07\/apc-monitor-step-2.png\"><img loading=\"lazy\" class=\"wp-image-421 size-large alignnone\" src=\"http:\/\/www.maxx.net.ua\/wp-content\/uploads\/2017\/07\/apc-monitor-step-2-1024x533.png\" alt=\"\" width=\"640\" height=\"333\" srcset=\"https:\/\/www.maxx.net.ua\/wp-content\/uploads\/2017\/07\/apc-monitor-step-2-1024x533.png 1024w, https:\/\/www.maxx.net.ua\/wp-content\/uploads\/2017\/07\/apc-monitor-step-2-300x156.png 300w, https:\/\/www.maxx.net.ua\/wp-content\/uploads\/2017\/07\/apc-monitor-step-2-768x400.png 768w, https:\/\/www.maxx.net.ua\/wp-content\/uploads\/2017\/07\/apc-monitor-step-2-1568x817.png 1568w, https:\/\/www.maxx.net.ua\/wp-content\/uploads\/2017\/07\/apc-monitor-step-2.png 1688w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<h1>\u041a\u043e\u043d\u0444\u0456\u0433\u0443\u0440\u0443\u0432\u0430\u043d\u043d\u044f OpenHAB<\/h1>\n<h2>things<\/h2>\n<p>\u0421\u0442\u0432\u043e\u0440\u0438\u043c\u043e \u0444\u0430\u0439\u043b\u00a0\/etc\/openhab2\/things\/system.things<\/p>\n<pre class=\"nums:false lang:sh decode:true \">Thing exec:command:apc [command=\"\/sbin\/apcaccess -p LINEV\", transform=\"REGEX((\\\\d+.\\\\d+).*)\", interval=5, timeout=1, autorun=true]<\/pre>\n<h2>items<\/h2>\n<p>\u0421\u0442\u0432\u043e\u0440\u0438\u043c\u043e \u0444\u0430\u0439\u043b\u00a0\/etc\/openhab2\/items\/system.items<\/p>\n<pre class=\"nums:false lang:sh decode:true\">String SYSTEM_APC_VOLTAGE \"[%s]\" (SYSTEM) {channel=\"exec:command:apc:output\"}\nNumber SYSTEM_APC_VOLTAGE_DOUBLE \"\u041d\u0430\u043f\u0440\u0443\u0433\u0430 [%.1f\u0412]\" &lt;energy&gt; (SYSTEM)<\/pre>\n<p>Item SYSTEM_APC_VOLTAGE_DOUBLE \u0442\u0440\u0435\u0431\u0430 \u0447\u0435\u0440\u0435\u0437 \u0442\u0435, \u0449\u043e exec \u043f\u043e\u0432\u0435\u0440\u0442\u0430\u0454 \u0441\u0442\u0440\u043e\u043a\u0443, \u0430 \u043d\u0430\u043c \u0442\u0440\u0435\u0431\u0430 \u0447\u0438\u0441\u043b\u043e. \u0421\u0442\u0432\u043e\u0440\u0438\u043c\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0442\u0432\u043e\u0440\u0435\u043d\u043d\u044f \u0441\u0442\u0440\u043e\u043a\u0438 \u0434\u043e \u0447\u0438\u0441\u043b\u0430<\/p>\n<h2>rules<\/h2>\n<p>\u0421\u0442\u0432\u043e\u0440\u0438\u043c\u043e \u0444\u0430\u0439\u043b\u00a0\/etc\/openhab2\/rules\/system.rules<\/p>\n<pre class=\"nums:false lang:default decode:true \">rule \"Convert System APC voltage\"\nwhen\n  Item SYSTEM_APC_VOLTAGE changed\nthen\n   SYSTEM_APC_VOLTAGE_DOUBLE.postUpdate(SYSTEM_APC_VOLTAGE.state.toString)\nend<\/pre>\n<h2>persist<\/h2>\n<p>\u0421\u0442\u0432\u043e\u0440\u0438\u043c\u043e \u043a\u043e\u043d\u0444\u0456\u0433\u0443\u0440\u0430\u0446\u0456\u044e \u0434\u043b\u044f \u0437\u0431\u0435\u0440\u0456\u0433\u0430\u043d\u043d\u044f \u043d\u0430\u043f\u0440\u0443\u0433\u0438 \u0434\u043e \u0431\u0430\u0437\u0438 \u0434\u0430\u043d\u0438\u0445. \u0414\u043e\u0434\u0430\u043c\u043e \u0441\u0442\u0440\u043e\u043a\u0443<\/p>\n<pre class=\"lang:default decode:true \">        SYSTEM_APC_VOLTAGE_DOUBLE : strategy = everyMinute<\/pre>\n<p>\u0443 \u0444\u0430\u0439\u043b \/etc\/openhab2\/persistence\/jdbc.persist<\/p>\n<h2>sitemap<\/h2>\n<p>\u0421\u0442\u0432\u043e\u0440\u0438\u043c\u043e \u0433\u0440\u0430\u0444\u0456\u043a \u0434\u043b\u044f \u0432\u0456\u0434\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f \u0456\u0441\u0442\u043e\u0440\u0456\u0447\u043d\u0438\u0445 \u0434\u0430\u043d\u0438\u0445<\/p>\n<p>\u0414\u043e\u0434\u0430\u043c\u043e \u0441\u0442\u0440\u043e\u043a\u0443<\/p>\n<pre class=\"nums:false lang:default decode:true \">Chart label=\"Voltage\" item=SYSTEM_APC_VOLTAGE_DOUBLE period=12h refresh=300<\/pre>\n<p>\u0443 \u0444\u0430\u0439\u043b\u00a0\/etc\/openhab2\/sitemaps\/house.sitemap<\/p>\n<p>\u042f\u043a \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043c\u0430\u0454\u043c\u043e \u0442\u0430\u043a\u0438\u0439 \u0433\u0440\u0430\u0444\u0456\u043a:<\/p>\n<p><a href=\"http:\/\/www.maxx.net.ua\/wp-content\/uploads\/2017\/07\/apc-monitor-graph.png\"><img loading=\"lazy\" class=\"alignnone wp-image-428 size-full\" src=\"http:\/\/www.maxx.net.ua\/wp-content\/uploads\/2017\/07\/apc-monitor-graph.png\" alt=\"\" width=\"525\" height=\"250\" srcset=\"https:\/\/www.maxx.net.ua\/wp-content\/uploads\/2017\/07\/apc-monitor-graph.png 525w, https:\/\/www.maxx.net.ua\/wp-content\/uploads\/2017\/07\/apc-monitor-graph-300x143.png 300w\" sizes=\"(max-width: 525px) 100vw, 525px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0412\u0438\u043c\u043e\u0433\u0438 Openhab \u043d\u0430 ubuntu Back-UPS XS 1100CI (\u043c\u043e\u0436\u043d\u0430 \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0432\u0430\u0442\u0438 \u0431\u0443\u0434\u044c-\u044f\u043a\u0438\u0439 \u0456\u043d\u0448\u0438\u0439, \u0430\u043b\u0435 \u0432 \u043c\u0435\u043d\u0435 \u0441\u0430\u043c\u0435 \u0442\u0430\u043a\u0438\u0439) \u041f\u0456\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0412\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044f Apcupsd \u0406\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0456\u044e \u043c\u043e\u0436\u043d\u0430 \u0437\u043d\u0430\u0439\u0442\u0438 \u043d\u0430\u043f\u0440\u0438\u043a\u043b\u0430\u0434 \u0437\u0430 \u0446\u0438\u043c \u043f\u043e\u0441\u0438\u043b\u0430\u043d\u043d\u044f\u043c. \u042f\u043a \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043c\u0438 \u043f\u043e\u0432\u0438\u043d\u043d\u0456 \u043c\u0430\u0442\u0438 \u0437\u043c\u043e\u0433\u0443 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 apcaccess, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u0438\u0432\u043e\u0434\u0443 \u043a\u043e\u0442\u0440\u043e\u0457 \u043c\u0438 \u0439 \u0431\u0443\u0434\u0435\u043c\u043e \u0432\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u043e\u0432\u0443\u0432\u0430\u0442\u0438 pi@openhab:\/etc\/openhab2 $ apcaccess APC : 001,036,0868 DATE : 2017-07-15 12:12:51 +0300 HOSTNAME : [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[6],"tags":[],"_links":{"self":[{"href":"https:\/\/www.maxx.net.ua\/index.php?rest_route=\/wp\/v2\/posts\/419"}],"collection":[{"href":"https:\/\/www.maxx.net.ua\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.maxx.net.ua\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.maxx.net.ua\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.maxx.net.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=419"}],"version-history":[{"count":0,"href":"https:\/\/www.maxx.net.ua\/index.php?rest_route=\/wp\/v2\/posts\/419\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.maxx.net.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=419"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.maxx.net.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=419"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.maxx.net.ua\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=419"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}