{"id":228,"date":"2017-05-14T07:07:03","date_gmt":"2017-05-14T07:07:03","guid":{"rendered":"https:\/\/test.warrensoft.co.uk\/wp-test\/home-hub\/?p=228"},"modified":"2018-12-08T07:32:18","modified_gmt":"2018-12-08T07:32:18","slug":"controller-current-values","status":"publish","type":"post","link":"https:\/\/test.warrensoft.co.uk\/wp-test\/2017\/05\/14\/controller-current-values\/","title":{"rendered":"Controller &#8211; Current Values"},"content":{"rendered":"<p>The core function of the controller is to read current values from the sensors, and this is done in the <a href=\"http:\/\/www.warrensoft.co.uk\/home-hub\/code\/controller\/current_values.py\" target=\"_blank\" rel=\"noopener noreferrer\">current_values<\/a> module. In order to make the design extensible, the sensor types are handled by sensor helper modules dropped into the <a href=\"http:\/\/www.warrensoft.co.uk\/home-hub\/code\/controller\/sensor_helpers\" target=\"_blank\" rel=\"noopener noreferrer\">sensor_helpers<\/a> directory. The <a href=\"http:\/\/www.warrensoft.co.uk\/home-hub\/code\/controller\/sensor_helpers\/__init__.py\">__init.py__<\/a> file just has to be updated to include the reference to the new sensor type.<\/p>\n<p>The skeleton controller includes one sensor type &#8211; evaluate, which enables us to read the virtual sensor described in a <a href=\"https:\/\/test.warrensoft.co.uk\/wp-test\/home-hub\/2017\/04\/11\/website-home-page\/\">previous post<\/a>. To run the controller, without rebooting the pi, use the following command:<\/p>\n<pre>sudo su - -c \/etc\/rc.local<\/pre>\n<p>and inspect the logfile for any errors:<\/p>\n<pre>cat \/var\/log\/hub\/hub.log<\/pre>\n<p>and view the statistics on the website:<\/p>\n<p><a href=\"http:\/\/home-hub\/home.php?page=Statistics\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/home-hub\/home.php?page=Statistics<\/a><\/p>\n<p>You should now see the sensor value changing every minute. It should be tracing out a sine wave, but we will need the graph features in later modules to prove this! \u00a0What we should do now is connect up a real sensor.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The core function of the controller is to read current values from the sensors, and this is done in the current_values module. In order to make the design extensible, the sensor types are handled by sensor helper modules dropped into the sensor_helpers directory. The __init.py__ file just has to be updated to include the reference &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/test.warrensoft.co.uk\/wp-test\/2017\/05\/14\/controller-current-values\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Controller &#8211; Current Values&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-228","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\/228","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=228"}],"version-history":[{"count":9,"href":"https:\/\/test.warrensoft.co.uk\/wp-test\/wp-json\/wp\/v2\/posts\/228\/revisions"}],"predecessor-version":[{"id":251,"href":"https:\/\/test.warrensoft.co.uk\/wp-test\/wp-json\/wp\/v2\/posts\/228\/revisions\/251"}],"wp:attachment":[{"href":"https:\/\/test.warrensoft.co.uk\/wp-test\/wp-json\/wp\/v2\/media?parent=228"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/test.warrensoft.co.uk\/wp-test\/wp-json\/wp\/v2\/categories?post=228"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/test.warrensoft.co.uk\/wp-test\/wp-json\/wp\/v2\/tags?post=228"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}