{"id":506,"date":"2017-06-09T19:33:26","date_gmt":"2017-06-09T19:33:26","guid":{"rendered":"https:\/\/test.warrensoft.co.uk\/wp-test\/home-hub\/?p=506"},"modified":"2018-12-08T07:29:28","modified_gmt":"2018-12-08T07:29:28","slug":"controller-statistics","status":"publish","type":"post","link":"https:\/\/test.warrensoft.co.uk\/wp-test\/2017\/06\/09\/controller-statistics\/","title":{"rendered":"Controller &#8211; Statistics"},"content":{"rendered":"<p>Now we are collecting data on a regular basis it would be a shame not to record some simple statistics, maximum and minimum values, for each of our measurements. This is what the controller statistics module does.<\/p>\n<p>Download the python script&#8230;<\/p>\n<pre>wget -P \/usr\/local\/bin\/code\/controller http:\/\/www.warrensoft.co.uk\/home-hub\/code\/controller\/statistics.py<\/pre>\n<p>and uncomment lines 22, 195 and line 206 of main_sched.py to enable the statistics features. Restart the controller.<\/p>\n<p>A summary of the highs and lows appears, not surprisingly, on the Statistics page. In addition, a daily summary of changes can be delivered by email.<\/p>\n<p>There are a couple of User Settings we need to take care of to complete the configuration. First, there is the <em>Admin Recipient<\/em>: this is the email address of the occupant who will receive the daily summary report, and secondly <em>Summary Enabled<\/em> needs to be set to true.<\/p>\n<p>With the configuration completed, \u00a0a report will be sent detailing any new highs and lows for the day to the admin user.<\/p>\n<pre>From:\r\nDate: 9 Jun 2017 01:00\r\nSubject: Daily Highs and Lows from the Hub 2017-06-09\r\nTo: user@example.com\r\nCc:\r\n\r\n The following highest values have been recorded today:\r\n\r\n * Test Temperature 33.6 degrees C<span class=\"aBn\" tabindex=\"0\" data-term=\"goog_442182794\"><span class=\"aQJ\"> at 23:25 08\/06\/<\/span><\/span>2017\r\n * Sinewave Angle 1.0 uni<span class=\"aBn\" tabindex=\"0\" data-term=\"goog_442182795\"><span class=\"aQJ\">ts at 23:15 08\/0<\/span><\/span>6\/2017\r\n\r\n The following lowest values have been recorded today:\r\n\r\n * Test Temperature 20.5 deg<span class=\"aBn\" tabindex=\"0\" data-term=\"goog_442182796\"><span class=\"aQJ\">rees C at 00:00 <\/span><\/span>09\/06\/2017\r\n * Sinewave Angle -1<span class=\"aBn\" tabindex=\"0\" data-term=\"goog_442182797\"><span class=\"aQJ\">.0 units at 23:4<\/span><\/span>5 08\/06\/2017<\/pre>\n<p>Not all sensor readings generate meaningful statistics, so the feature can be disabled on the Sensor form. Be aware that disabling a sensor&#8217;s statistics will delete any history.<\/p>\n<p>With statistics implemented we have completed all the milestones in the project plan. In the next post we will reflect on what we have achieved, and consider the next steps.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Now we are collecting data on a regular basis it would be a shame not to record some simple statistics, maximum and minimum values, for each of our measurements. This is what the controller statistics module does. Download the python script&#8230; wget -P \/usr\/local\/bin\/code\/controller http:\/\/www.warrensoft.co.uk\/home-hub\/code\/controller\/statistics.py and uncomment lines 22, 195 and line 206 of main_sched.py &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/test.warrensoft.co.uk\/wp-test\/2017\/06\/09\/controller-statistics\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Controller &#8211; Statistics&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-506","post","type-post","status-publish","format-standard","hentry","category-hub-software-controller"],"_links":{"self":[{"href":"https:\/\/test.warrensoft.co.uk\/wp-test\/wp-json\/wp\/v2\/posts\/506","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/test.warrensoft.co.uk\/wp-test\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/test.warrensoft.co.uk\/wp-test\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/test.warrensoft.co.uk\/wp-test\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/test.warrensoft.co.uk\/wp-test\/wp-json\/wp\/v2\/comments?post=506"}],"version-history":[{"count":7,"href":"https:\/\/test.warrensoft.co.uk\/wp-test\/wp-json\/wp\/v2\/posts\/506\/revisions"}],"predecessor-version":[{"id":700,"href":"https:\/\/test.warrensoft.co.uk\/wp-test\/wp-json\/wp\/v2\/posts\/506\/revisions\/700"}],"wp:attachment":[{"href":"https:\/\/test.warrensoft.co.uk\/wp-test\/wp-json\/wp\/v2\/media?parent=506"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/test.warrensoft.co.uk\/wp-test\/wp-json\/wp\/v2\/categories?post=506"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/test.warrensoft.co.uk\/wp-test\/wp-json\/wp\/v2\/tags?post=506"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}