Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Introduction

It is possible to add a Camera to the system. Here we will have a small overview as how the device configuration should be done in the SiteController.



On this page:

Sensor Config

Here is an example of the sensor section of the configuration. In this example we show how to check for motion.

<sensor sensor_id="Axis_Motion_Detection">
	<description>The motion detection of the camera</description>
		<sensor_class>boolean</sensor_class>
			<state_evaluation_expressions>
                <state_evaluation_expression>
                    <expression>value == '1'</expression>					# If anything changes with the camera feed, then the value will change to 1 and thus motion will be detected.
                    <true volatile="true" severity="200">Motion</true>		# Severity changes to 200 and gives us the state "Motion".
                    <false severity="0">No Motion</false>
                </state_evaluation_expression>
            </state_evaluation_expressions>
            <sensor_gateway sensor_gateway_id="gw_Axis_Camera">
                <demux>
                    <keys>
                        <key>motion</key>
                    </keys>
                </demux>
            </sensor_gateway>   
</sensor>

Device Configuration

Here is an example of the device configuration of the camera being used in the example above.

<device device_id="Axis_Camera">
	<camera_device>
		<ip_settings>
			<address>192.168.200.160</address>
		</ip_settings>
	</camera_device>
	<sensor_gateways>
		<sensor_gateway sensor_gateway_id="gw_Axis_Camera">
			<http_notification>
				<keys>
					<key>motion</key>
				</keys>
			</http_notification>
		</sensor_gateway>
	</sensor_gateways>
</device>

Motion detection rule

For the motion detection to work properly, we require an additional Automation Rule.

<rule rule_id="Axis_Motion_Control">
            <triggers>
                <trigger sensor_id="Axis_Motion_Detection" trigger_topic="events" value_name="motion_detected" value_type="string"/>
            </triggers>
            <timers>
                <timer delay="5" timer_id="T1"/>
            </timers>
            <conditions>
                <condition expr="motion_detected == 'Motion'">
                    <true>
                        <result_list>
                            <result result_value="0" sensor_id="Axis_Motion_Detection" timer="T1" value_type="decimal"/>
                        </result_list>
                        <state_list>
                            <state state_name="motion_detected" state_value="0"/>
                        </state_list>
                    </true>
                </condition>
            </conditions>
        </rule>










  • No labels