And below is the configuration that reads three lm_sensors supported sensors and one 1-Wire sensor (mapped to the file system by owfs-fs) and feeds the data to the rest of the system. If you want to see it, copy & paste somewhere else - there's no way to make it readable here.
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
<!-- Sensors -->
<bean id="temperature_sensor-6EE055000000" class="net.sf.dz3.device.sensor.impl.ShellSensor" init-method="start">
<constructor-arg index="0" value="6EE055000000"/>
<constructor-arg index="1" value="1000"/>
<constructor-arg index="2" value="/bin/cat /mnt/onewire/28.6EE055000000/temperature12|tr -s ' '"/>
</bean>
<bean id="temperature_sensor-cpu1" class="net.sf.dz3.device.sensor.impl.ShellSensor" init-method="start">
<constructor-arg index="0" value="cpu1"/>
<constructor-arg index="1" value="1000"/>
<constructor-arg index="2" value="/usr/bin/sensors|grep Int|tr -s ' '|cut -f 3 -d ' '|tr -d '+°C'"/>
</bean>
<bean id="temperature_sensor-cpu2" class="net.sf.dz3.device.sensor.impl.ShellSensor" init-method="start">
<constructor-arg index="0" value="cpu2"/>
<constructor-arg index="1" value="1000"/>
<constructor-arg index="2" value="/usr/bin/sensors|grep AMD|tr -s ' '|cut -f 3 -d ' '|tr -d '+°C'"/>
</bean>
<bean id="temperature_sensor-mobo" class="net.sf.dz3.device.sensor.impl.ShellSensor" init-method="start">
<constructor-arg index="0" value="mobo"/>
<constructor-arg index="1" value="1000"/>
<constructor-arg index="2" value="/usr/bin/sensors|grep M/B|tr -s ' '|cut -f 3 -d ' '|tr -d '+°C'"/>
</bean>
<!-- Thermostats -->
<bean id="pid_controller_6EE055000000" class="net.sf.dz3.controller.pid.SimplePidController" scope="prototype">
<constructor-arg index="0" value="22.5"/>
<constructor-arg index="1" value="1"/>
<constructor-arg index="2" value="0"/>
<constructor-arg index="3" value="0"/>
<constructor-arg index="4" value="0"/>
</bean>
<bean id="thermostat-6EE055000000" class="net.sf.dz3.device.model.impl.ThermostatModel">
<constructor-arg type="java.lang.String" value="1-Wire 6EE055000000"/>
<constructor-arg type="net.sf.dz3.device.sensor.TemperatureSensor" ref="temperature_sensor-6EE055000000"/>
<constructor-arg type="net.sf.dz3.controller.pid.AbstractPidController" ref="pid_controller_6EE055000000"/>
</bean>
<bean id="pid_controller_cpu1" class="net.sf.dz3.controller.pid.SimplePidController" scope="prototype">
<constructor-arg index="0" value="56"/>
<constructor-arg index="1" value="1"/>
<constructor-arg index="2" value="0"/>
<constructor-arg index="3" value="0"/>
<constructor-arg index="4" value="0"/>
</bean>
<bean id="thermostat-cpu1" class="net.sf.dz3.device.model.impl.ThermostatModel">
<constructor-arg type="java.lang.String" value="CPU1"/>
<constructor-arg type="net.sf.dz3.device.sensor.TemperatureSensor" ref="temperature_sensor-cpu1"/>
<constructor-arg type="net.sf.dz3.controller.pid.AbstractPidController" ref="pid_controller_cpu1"/>
</bean>
<bean id="pid_controller_cpu2" class="net.sf.dz3.controller.pid.SimplePidController" scope="prototype">
<constructor-arg index="0" value="44"/>
<constructor-arg index="1" value="1"/>
<constructor-arg index="2" value="0"/>
<constructor-arg index="3" value="0"/>
<constructor-arg index="4" value="0"/>
</bean>
<bean id="thermostat-cpu2" class="net.sf.dz3.device.model.impl.ThermostatModel">
<constructor-arg type="java.lang.String" value="CPU2"/>
<constructor-arg type="net.sf.dz3.device.sensor.TemperatureSensor" ref="temperature_sensor-cpu2"/>
<constructor-arg type="net.sf.dz3.controller.pid.AbstractPidController" ref="pid_controller_cpu2"/>
</bean>
<bean id="pid_controller_mobo" class="net.sf.dz3.controller.pid.SimplePidController" scope="prototype">
<constructor-arg index="0" value="38"/>
<constructor-arg index="1" value="1"/>
<constructor-arg index="2" value="0"/>
<constructor-arg index="3" value="0"/>
<constructor-arg index="4" value="0"/>
</bean>
<bean id="thermostat-mobo" class="net.sf.dz3.device.model.impl.ThermostatModel">
<constructor-arg type="java.lang.String" value="Motherboard"/>
<constructor-arg type="net.sf.dz3.device.sensor.TemperatureSensor" ref="temperature_sensor-mobo"/>
<constructor-arg type="net.sf.dz3.controller.pid.AbstractPidController" ref="pid_controller_mobo"/>
</bean>
<!-- Dampers: None for now -->
<!-- Zone Controllers -->
<bean id="zone_controller-mx" class="net.sf.dz3.device.model.impl.SimpleZoneController">
<constructor-arg type="java.util.Set">
<set>
<ref bean="thermostat-6EE055000000"/>
<ref bean="thermostat-cpu1"/>
<ref bean="thermostat-cpu2"/>
<ref bean="thermostat-mobo"/>
</set>
</constructor-arg>
</bean>
<!-- HVAC Units -->
<bean id="unit-mx" class="net.sf.dz3.device.model.impl.UnitModel">
<constructor-arg type="java.lang.String" value="mx"/>
<constructor-arg type="net.sf.dz3.device.model.ZoneController" ref="zone_controller-mx"/>
</bean>
<!-- Damper Controllers: None for now -->
</beans>
No comments:
Post a Comment