Basic rule/rule file acting temperamental, again.


  • Hardware Contributor

    Good morning, my demo.rules, default.items and default.sitemap files are added below here. I had it working perfect last night, then i changed the naming scheme i had for the groups and items inside of default.items, so then i went and changed the rules and sitemap to follow suit. The sitemap works perfectly now, however the rules are not being triggered. I have checked my OpenHAB logs, its reading "2015-11-29 07:54:04.829 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'demo.rules'". It might be some silly little error that I don't see after a couple hours of sifting through.

    demo.rules (I plan on condensing this when i get it work again).

    rule "LightOn"
    when
    	Item cinemaroom_switch01 changed
    then
    	if (cinemaroom_light01.state == OFF){
    		sendCommand(cinemaroom_light01, ON)
    	}
    end
    	
    rule "LightOff"
    when
    	Item cinemaroom_switch01 changed
    then
    	if (cinemaroom_light01.state == ON){
    		sendCommand(cinemaroom_light01, OFF)
    	}
    end
    

    default.sitemap (Some have caps some don't the ones that don't is for these testing purposes so I don't make a basics error on capitalization.)

    sitemap default label="Main Menu"
    {
    	Frame label="Cinema Room" {
    		Text item=CinemaRoom_Temp01
    		Text item=CinemaRoom_Hum01
    		Text item=CinemaRoom_Motion01
    		Text item=cinemaroom_switch01
    		Switch item=cinemaroom_light01
    	}
    }
    

    default.items

    Group All
    
    // Sensor Types
    Group gTemperature (All) // Contains all temperature sensors
    Group gHumidity (All) // Contains all humidity sensors
    Group gMotion (All) // Contains all motion sensors
    Group gLight (All) // Contains all lighting circuits
    Group gSwitch (All) // Contains all switches
    
    // Floor Mappings
    Group gOD (All) // Outdoor
    Group gGF (All) // Ground Floor
    Group gFF (All) // First Floor
    Group gSF (All) // Second Floor
    
    // Room Mappings
    Group OD_Front "Front Outdoors" <garden> (gOD)
    Group OD_Rear "Rear Outdoors" <garden> (gOD)
    Group GF_Hallway "Hallway" <frontdoor> (gGF)
    Group GF_Stairs "Stairs" <groundfloor> (gGF)
    Group GF_LivingRoom "Living Room" <sofa> (gGF)
    Group GF_Kitchen "Kitchen" <kitchen> (gGF)
    Group GF_Conservatory "Conservatory" <terrace> (gGF)
    Group FF_Landing "Landing" <secondfloor> (gFF)
    Group FF_Bathroom "Bathroom" <bath> (gFF)
    Group FF_SpareBedroom "Spare Bedroom" <bedroom> (gFF)
    Group FF_MasterBedroom "Master Bedroom" <bedroom> (gFF)
    Group FF_Office "Office" <office> (gFF)
    Group SF_CinemaRoom "Cinema Room" <video> (gSF)
    
    
    
    // Item Mappings
    
    // Add other rooms and nodes here
    
    // Cinema Room
    Number	CinemaRoom_Temp01			"Temperature [%.1f °C]"				<temperature>	(SF_CinemaRoom, gTemperature)	{mqtt="<[mymosquitto:Gateway1-out/1/1/1/0/0:state:default]"}
    Number	CinemaRoom_Hum01			"Humidity [%.1f %%]"				<temperature>	(SF_CinemaRoom, gHumidity)		{mqtt="<[mymosquitto:Gateway1-out/1/0/1/0/1:state:default]"}
    Number	CinemaRoom_Motion01			"Motion [MAP(motion.map):%s]"		<shield>		(SF_CinemaRoom, gMotion)		{mqtt="<[mymosquitto:Gateway1-out/2/1/1/0/16:state:default]"}
    Number	cinemaroom_switch01			"Light Switch [MAP(switch.map):%s]"	<shield>		(SF_CinemaRoom, gSwitch)		{mqtt="<[mymosquitto:Gateway1-out/3/3/1/0/16:state:default]"}
    Switch	cinemaroom_light01			"Ceiling Lights"					<light>			(SF_CinemaRoom, gLight)			{mqtt=">[mymosquitto:Gateway1-in/4/1/1/0/2:command:ON:1],>[mymosquitto:Gateway1-in/4/1/1/0/2:command:OFF:0]"}
    
    

  • Hardware Contributor

    The rule is now working, i have not changed a thing, just retried it after around 5 hours of leaving it alone. No restart since this morning or anything, just started to work for no reason.

    If an admin would like to remove this post due to unknown fix then you are more than welcome.
    Thank you, Sam.


Log in to reply
 

Suggested Topics

  • 22
  • 19
  • 135
  • 4
  • 132
  • 5

15
Online

11.4k
Users

11.1k
Topics

112.7k
Posts