<?xml version="1.0" ?>
<config>
	<objects>
                <object id="light_sensor" type="1.001" gad="0/0/17">Ljussensor</object>
                <object id="external_lights" type="1.001" gad="0/0/19">Ytterbelysning</object>

                <object type="11.001" id="cur_date" gad="0/0/25" flags="cwtuf">Current Date</object>
                <object type="10.001" id="cur_time" gad="0/0/26">Current Time</object>

                <object id="temp" type="9.xxx" gad="0/1/0">Temperatur</object>
                <object id="time" type="10.001" gad="0/1/1">Tid</object>
		<object id="light_kitchen" type="1.001" gad="0/1/2">Belysning kök</object>
		<object id="light_kitchen_dim" type="3.007" gad="0/1/3">Belysning kök dimmer</object>
                <object id="light_kitchen_ind" type="5.xxx" gad="0/1/4">Belysning kök dimmer värde</object>
                <object id="light_kitchentable" type="1.001" gad="0/1/5">Belysning kök</object>
                <object id="light_kitchentable_dim" type="3.007" gad="0/1/6">Belysning kök dimmer</object>
                <object id="light_kitchentable_ind" type="5.xxx" gad="0/1/7">Belysning kök dimmer värde</object> 
		<object id="light_stove" type="1.001" gad="0/1/8">Belysning kök underskåp</object>
                <object id="light_stove_ind" type="5.xxx" gad="0/1/9">Belysning kök underskåp ind</object>
                <object id="light_stovestore"   type="1.001" gad="0/1/10">Belysning kök vitrinskåp</object>
                <object id="light_stovestore_ind" type="5.xxx" gad="0/1/11">Belysning kök vitrinskåp ind</object>
                <object id="windowlight_kitchen"   type="1.001" gad="0/1/12">Uttag köksfönster</object>
                <object id="windowlight_kitchen_ind" type="5.xxx" gad="0/1/13">Uttag köksfönster ind</object>
                <object id="light_dinnertable"   type="1.001" gad="0/1/19">Belysning köksbord</object>
                <object id="light_dinnertable_dim" type="3.007" gad="0/1/20">Belysning köksbord dimmer</object>
                <object id="light_dinnertable_ind" type="5.xxx" gad="0/1/21">Belysning köksbord dimmer värde</object> 
                <object id="windowlight_dinnertable_se"   type="1.001" gad="0/1/22">Fönsterbelysning kök sydöst</object>
                <object id="windowlight_dinnertable_se_ind" type="5.xxx" gad="0/1/23">Fönsterbelysning kök sydöst ind</object>
                <object id="plug_kitchen_se"   type="1.001" gad="0/1/24">Uttag kök sydöst</object>
                <object id="plug_kitchen_se_ind" type="5.xxx" gad="0/1/25">Uttag kök sydöst ind</object>
                <object id="light_porch"   type="1.001" gad="0/1/26">Belysning altan</object>
                <object id="light_porch_ind" type="5.xxx" gad="0/1/27">Belysning altan ind</object>
                <object id="windowlight_kitchen_e" type="1.001" gad="0/1/28">Fönsterbelysning kök öst</object>
                <object id="plug_kitchen_e"   type="1.001" gad="0/1/29">Uttag kök öst</object>
                <object id="light_livingroom"   type="1.001" gad="0/1/32">Belysning vardagsrum</object>
                <object id="light_livingroom_dim" type="3.007" gad="0/1/33">Belysning vardagsrum dimmer</object>
                <object id="light_livingroom_ind" type="5.xxx" gad="0/1/34">Belysning vardagsrum dimmer värde</object> 
                <object id="light_livingroom_oriel" type="1.001" gad="0/1/35">Belysning burspråk vardagsrum</object>
                <object id="light_livingroom_oriel_dim" type="3.007" gad="0/1/36">Belysning burspråk vardagsrum dimmer</object>
                <object id="light_livingroom_oriel_ind" type="5.xxx" gad="0/1/37">Belysning burspråk vardagsrum dimmer värde</object> 


                <object id="light_library_roof" type="1.001" gad="0/1/47">Belysning tak bibliotek</object>
                <object id="light_library_roof_dim" type="3.007" gad="0/1/48">Belysning tak bibliotek dimmer</object>
                <object id="light_library_roof_ind" type="5.xxx" gad="0/1/49">Belysning tak bibliotek dimmer värde</object> 
                <object id="light_library_walls"   type="1.001" gad="0/1/50">Belysning väggar bibliotek</object>
                <object id="light_library_walls_dim" type="3.007" gad="0/1/51">Belysning väggar bibliotek dimmer</object>
                <object id="light_library_walls_ind" type="5.xxx" gad="0/1/52">Belysning väggar bibliotek dimmer värde</object> 


                <object id="plug_library"   type="1.001" gad="0/1/53">Uttag bibliotek</object>
                <object id="plug_library_ind" type="5.xxx" gad="0/1/54">Uttag bibliotek ind</object>


                <object id="light_hall_roof"   type="1.001" gad="0/1/59">Belysning tak hall</object>
                <object id="light_hall_roof_dim" type="3.007" gad="0/1/60">Belysning tak hall dimmer</object>
                <object id="light_hall_roof_ind" type="5.xxx" gad="0/1/61">Belysning tak hall dimmer värde</object> 

                <object id="light_stairs"   type="1.001" gad="0/1/62">Belysning trapp</object>
                <object id="light_stairs_dim" type="3.007" gad="0/1/63">Belysning trapp dimmer</object>
                <object id="light_stairs_ind" type="5.xxx" gad="0/1/64">Belysning trapp dimmer värde</object> 

                <object id="windowlight_hall"   type="1.001" gad="0/1/65">Fönsterbelysning hall</object>
                <object id="windowlight_hall_ind" type="5.xxx" gad="0/1/66">Fönsterbelysning hall ind</object>

                <object id="plug_hall"   type="1.001" gad="0/1/68">Uttag hall</object>
                <object id="plug_hall_ind" type="5.xxx" gad="0/1/69">Uttag hall ind</object>


                <object id="light_passage"   type="1.001" gad="0/1/74">Belysning mellangång</object>
                <object id="light_passage_dim" type="3.007" gad="0/1/75">Belysning mellangång dimmer</object>
                <object id="light_passage_ind" type="5.xxx" gad="0/1/76">Belysning mellangång dimmer värde</object>

                <object id="light_passage_closet"   type="1.001" gad="0/1/77">Belysning garderob mellangång</object>
                <object id="light_passage_closet_ind" type="5.xxx" gad="0/1/78">Belysning garderob mellangång ind</object>

                <object id="light_laundry"   type="1.001" gad="0/1/83">Belysning tvättstuga</object>
                <object id="light_laundry_ind" type="5.xxx" gad="0/1/84">Belysning tvättstuga ind</object>

                <object id="light_rough_entrance"  flags="cwtu" type="1.001" gad="0/1/91">Belysning groventré</object>
                <object id="light_rough_entrance_dim" type="3.007" gad="0/1/92">Belysning groventré dimmer</object>
                <object id="light_rough_entrance_ind" type="5.xxx" gad="0/1/93">Belysning groventré dimmer värde</object>

                <object id="light_app"   type="1.001" gad="0/1/100">Belysning apparatrum</object>
                <object id="light_app_ind" type="5.xxx" gad="0/1/101">Belysning apparatrum ind</object>
                <object id="external_light_app"   type="1.001" gad="0/1/102">Ytterbelysning apparatrum</object>
                <object id="external_light_app_ind" type="5.xxx" gad="0/1/103">Ytterbelysning apparatrum ind</object>

                <object id="light_hobby"   type="1.001" gad="0/1/108">Belysning hobbyrum</object>
                <object id="light_hobby_ind" type="5.xxx" gad="0/1/109">Belysning hobbyrum ind</object>

                <object id="light_garage"   type="1.001" gad="0/1/110">Belysning garage</object>
                <object id="light_garage_ind" type="5.xxx" gad="0/1/111">Belysning garage ind</object>


                <object id="light_hobby_test"   type="1.001" gad="0/1/112">Belysning hobbyrum test</object>
                <object id="light_hobby_test_ind" type="5.xxx" gad="0/1/113">Belysning hobbyrum test ind</object>


                <object id="light_parents_roof"   type="1.001" gad="0/1/116">Belysning föräldrar tak</object>
                <object id="light_parents_roof_dim" type="3.007" gad="0/1/117">Belysning föräldrar tak dimmer</object>
                <object id="light_parents_roof_ind" type="5.xxx" gad="0/1/118">Belysning föräldrar tak dimmer värde</object>
                <object id="windowlight_parents"   type="1.001" gad="0/1/119">Fönsterbelysning föräldrar</object>
                <object id="windowlight_parents_ind" type="5.xxx" gad="0/1/120">Fönsterbelysning föräldrar ind</object>



                <object id="light_elin_roof"   type="1.001" gad="0/1/125">Belysning Elin tak</object>
                <object id="light_elin_roof_dim" type="3.007" gad="0/1/126">Belysning Elin tak dimmer</object>
                <object id="light_elin_roof_ind" type="5.xxx" gad="0/1/127">Belysning Elin tak dimmer värde</object>
                <object id="windowlight_elin"   type="1.001" gad="0/1/128">Fönsterbelysning Elin</object>
                <object id="windowlight_elin_ind" type="5.xxx" gad="0/1/129">Fönsterbelysning Elin ind</object>

                <object id="light_tilde_roof"   type="1.001" gad="0/1/130">Belysning Tilde tak</object>
                <object id="light_tilde_roof_dim" type="3.007" gad="0/1/131">Belysning Tilde tak dimmer</object>
                <object id="light_tilde_roof_ind" type="5.xxx" gad="0/1/132">Belysning Tilde tak dimmer värde</object>
                <object id="windowlight_tilde"   type="1.001" gad="0/1/133">Fönsterbelysning Tilde</object>
                <object id="windowlight_tilde_ind" type="5.xxx" gad="0/1/134">Fönsterbelysning Tilde ind</object>

                <object id="light_livingroom_up_1"   type="1.001" gad="0/1/135">Belysning övre vardagsrum 1</object>
                <object id="light_livingroom_up_1_dim" type="3.007" gad="0/1/136">Belysning övre vardagsrum 1 dimmer</object>
                <object id="light_livingroom_up_1_ind" type="5.xxx" gad="0/1/137">Belysning övre vardagsrum 1 dimmer värde</object>
                <object id="light_livingroom_up_2"   type="1.001" gad="0/1/138">Belysning övre vardagsrum 2</object>
                <object id="light_livingroom_up_2_dim" type="3.007" gad="0/1/139">Belysning övre vardagsrum 2 dimmer</object>
                <object id="light_livingroom_up_2_ind" type="5.xxx" gad="0/1/140">Belysning övre vardagsrum 2 dimmer värde</object>
                <object id="windowlight_livingroom_up"   type="1.001" gad="0/1/141">Fönsterbelysning övre vardagsrum</object>
                <object id="windowlight_livingroom_up_ind" type="5.xxx" gad="0/1/142">Fönsterbelysning övre vardagsrum ind</object>
                <object id="plug_livingroom_up"   type="1.001" gad="0/1/143">Uttag övre vardagsrum</object>
                <object id="plug_livingroom_up_ind" type="5.xxx" gad="0/1/144">Uttag övre vardagsrum ind</object>

                <object id="light_toilet_up"   type="1.001" gad="0/1/145">Belysning övre toalett</object>
                <object id="light_toilet_up_dim" type="3.007" gad="0/1/146">Belysning övre toalett dimmer</object>
                <object id="light_toilet_up_ind" type="5.xxx" gad="0/1/147">Belysning övre toalett dimmer värde</object>
                <object id="light_toilet_mirror_up"   type="1.001" gad="0/1/148">Belysning spegel övre toalett</object>
                <object id="light_toilet_mirror_up_ind" type="5.xxx" gad="0/1/149">Belysning spegel övre toalett ind</object>

                <object id="light_toilet_down"   type="1.001" gad="0/1/150">Belysning toalett nere</object>
                <object id="light_toilet_down_dim" type="3.007" gad="0/1/151">Belysning toalett nere dimmer</object>
                <object id="light_toilet_down_ind" type="5.xxx" gad="0/1/152">Belysning toalett nere dimmer värde</object>
                <object id="light_toilet_mirror_down"   type="1.001" gad="0/1/153">Belysning spegel nedre toalett</object>
                <object id="light_toilet_mirror_down_ind" type="5.xxx" gad="0/1/154">Belysning spegel nedre toalett ind</object>

                <object id="car_heater_1_17" type="1.001" gad="0/1/155">Motorvärmare 1 (17)</object>
                <object id="car_heater_2_17" type="1.001" gad="0/1/156">Motorvärmare 2 (17)</object>
                <object id="car_heater_1_22" type="1.001" gad="0/1/157">Motorvärmare 1 (22)</object>
                <object id="car_heater_2_22" type="1.001" gad="0/1/158">Motorvärmare 2 (22)</object>


                <object id="windowlight_livingroom_up2"   type="1.001" gad="0/1/161">Fönsterbelysning övre vardagsrum mot gatan</object>
                <object id="windowlight_livingroom_up2_ind" type="5.xxx" gad="0/1/163">Belysning spegel nedre toalett ind</object>


                <object id="light_master" type="1.001" gad="0/1/170" init="on">Huvudströmbrytare</object>


                <object id="heating_1" type="20.102" gad="0/3/0" >Värme Zon 1</object>
                <object id="heating_2" type="20.102" gad="0/3/1" >Värme Zon 2</object>
                <object id="heating_3" type="20.102" gad="0/3/2" >Värme Zon 3</object>





	</objects>
	<rules>
          <rule id="cur_time_date">
            <condition type="timer" trigger="true">
                <every>60</every>
            </condition>
            <actionlist>
                <action type="set-value" id="cur_time" value="now" />
                <action type="set-value" id="cur_date" value="now" />
            </actionlist>
          </rule>

          <rule id="light_toilet_up_auto_off">
            <condition type="object" id="light_toilet_up" value="on" trigger="true"/>
            <actionlist>
              <action type="set-value" id="light_toilet_up" delay="40m" value="off"/>
            </actionlist>
            
          </rule>
          <rule id="auto_on_plug_kitchen_se">
            <condition type="object" id="plug_kitchen_se" value="off" trigger="true"/>
            <actionlist>
              <action type="set-value" id="plug_kitchen_se" delay="1s" value="on"/>
            </actionlist>

          </rule>
          <rule id="auto_on_plug_kitchen_e">
            <condition type="object" id="plug_kitchen_e" value="off" trigger="true"/>
            <actionlist>
              <action type="set-value" id="plug_kitchen_e" delay="1s" value="on"/>
            </actionlist>

          </rule>
          <rule id="auto_on_plug_library">
            <condition type="object" id="plug_library" value="off" trigger="true"/>
            <actionlist>
              <action type="set-value" id="plug_library" delay="1s" value="on"/>
            </actionlist>

          </rule>

          <rule id="light_master_off">
            <condition type="object" id="light_master" value="off" trigger="true"/>
            <actionlist>
              <action type="set-value" id="light_parents_roof" value="off"/>
              <action type="set-value" id="external_lights" value="off"/>
              <action type="set-value" id="light_kitchen" value="off"/>
              <action type="set-value" id="light_kitchentable" value="off"/>
              <action type="set-value" id="light_stove" value="off"/>
              <action type="set-value" id="light_stovestore" value="off"/>
              <action type="set-value" id="windowlight_kitchen" value="off"/>
              <action type="set-value" id="light_dinnertable" value="off"/>
              <action type="set-value" id="windowlight_dinnertable_se" value="off"/>
              <action type="set-value" id="plug_kitchen_se" value="off"/>
              <action type="set-value" id="light_porch" value="off"/>
              <action type="set-value" id="windowlight_kitchen_e" value="off"/>
              <action type="set-value" id="plug_kitchen_e" value="off"/>
              <action type="set-value" id="light_livingroom" value="off"/>
              <action type="set-value" id="light_livingroom_oriel" value="off"/>
              <action type="set-value" id="light_library_roof" value="off"/>
              <action type="set-value" id="light_library_walls" value="off"/>
              <action type="set-value" id="plug_library" value="off"/>
              <action type="set-value" id="light_hall_roof" value="off"/>
              <action type="set-value" id="light_stairs" value="off"/>
              <action type="set-value" id="windowlight_hall" value="off"/>
              <action type="set-value" id="plug_hall" value="off"/>
              <action type="set-value" id="light_passage" value="off"/>
              <action type="set-value" id="light_passage_closet" value="off"/>
              <action type="set-value" id="light_laundry" value="off"/>
              <action type="set-value" id="light_rough_entrance" value="off"/>
              <action type="set-value" id="light_app" value="off"/>
              <action type="set-value" id="external_light_app" value="off"/>
              <action type="set-value" id="light_hobby" value="off"/>
              <action type="set-value" id="light_garage" value="off"/>
              <action type="set-value" id="light_hobby_test" value="off"/>
              <action type="set-value" id="light_parents_roof" value="off"/>
              <action type="set-value" id="windowlight_parents" value="off"/>
              <action type="set-value" id="light_elin_roof" value="off"/>
              <action type="set-value" id="windowlight_elin" value="off"/>
              <action type="set-value" id="light_tilde_roof" value="off"/>
              <action type="set-value" id="windowlight_tilde" value="off"/>
              <action type="set-value" id="light_livingroom_up_1" value="off"/>
              <action type="set-value" id="light_livingroom_up_2" value="off"/>
              <action type="set-value" id="windowlight_livingroom_up" value="off"/>
              <action type="set-value" id="plug_livingroom_up" value="off"/>
              <action type="set-value" id="light_toilet_up" value="off"/>
              <action type="set-value" id="light_toilet_mirror_up" value="off"/>
              <action type="set-value" id="light_toilet_down" value="off"/>
              <action type="set-value" id="light_toilet_mirror_down" value="off"/>

              <!-- Now reset master switch to "on" again -->
              <action type="set-value" id="light_master" value="on"/>
            </actionlist>
          </rule>


	</rules>
	<services>
		<knxconnection url="ip:127.0.0.1" />
		<xmlserver type="inet" port="1028" />
		<persistence type="file" path="/usr/knx/linknx/persist"/>
                <location lon="20.46436812" lat="63.84247227"/>
	</services>
</config>

