Hi,
I’m using OH 2.1 stable and I have couple of rules files. Some rules files, when changed and automatically reloaded generate some errors, but then they are automatically “refreshed” without any errors, and they seem to work ok. This is oh log:
2017-10-17 22:00:56.641 [INFO ] [el.core.internal.ModelRepositoryImpl] - Validation issues found in configuration model 'mpd.rules', using it anyway:
The field Tmp_mpdRules.radioChannelChanged refers to the missing type Object
The field Tmp_mpdRules.multiroomChanged refers to the missing type Object
The field Tmp_mpdRules.radioChannelChanged refers to the missing type Object
The field Tmp_mpdRules.multiroomChanged refers to the missing type Object
The field Tmp_mpdRules.radioChannelChanged refers to the missing type Object
The field Tmp_mpdRules.multiroomChanged refers to the missing type Object
The field Tmp_mpdRules.radioChannelChanged refers to the missing type Object
2017-10-17 22:00:56.651 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'mpd.rules'
2017-10-17 22:01:42.248 [INFO ] [el.core.internal.ModelRepositoryImpl] - Validation issues found in configuration model 'mpd.rules', using it anyway:
The field Tmp_mpdRules.radioChannelChanged refers to the missing type Object
The field Tmp_mpdRules.multiroomChanged refers to the missing type Object
The field Tmp_mpdRules.radioChannelChanged refers to the missing type Object
The field Tmp_mpdRules.multiroomChanged refers to the missing type Object
The field Tmp_mpdRules.radioChannelChanged refers to the missing type Object
The field Tmp_mpdRules.multiroomChanged refers to the missing type Object
The field Tmp_mpdRules.radioChannelChanged refers to the missing type Object
2017-10-17 22:01:42.290 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Error during the execution of startup rule 'Mopidy req': null
2017-10-17 22:01:42.495 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'mpd.rules'
and this is mpd.rules:
import org.eclipse.xtext.xbase.lib.Functions
import org.openhab.core.types.Command
val Functions$Function3<GenericItem, GenericItem, GenericItem, Void> uriChanged = [
uri,
multiroom,
radio_channel |
if (uri.state == "rtsp://livingroom-osmc.local:5004/test") {
multiroom.postUpdate(ON)
}
else {
multiroom.postUpdate(OFF)
}
if (uri.state == "dirble:station:36549") {
radio_channel.postUpdate("antyradio")
}
else if (uri.state == "dirble:station:12786") {
radio_channel.postUpdate("eskarock")
}
else if (uri.state == "dirble:station:12787") {
radio_channel.postUpdate("trojka")
}
else {
radio_channel.postUpdate("OFF")
}
]
val Functions$Function3<Command, GenericItem, GenericItem, Void> multiroomChanged = [
receivedCommand,
uri,
state |
if (receivedCommand == ON) {
uri.sendCommand("rtsp://livingroom-osmc.local:5004/test")
}
else if (receivedCommand == OFF) {
uri.sendCommand("")
state.sendCommand("stopped")
}
]
val Functions$Function3<Command, GenericItem, GenericItem, Void> radioChannelChanged = [
receivedCommand,
uri,
state |
if (receivedCommand == "antyradio") {
uri.sendCommand("dirble:station:36549")
}
else if (receivedCommand == "eskarock") {
uri.sendCommand("dirble:station:12786")
}
else if (receivedCommand == "trojka") {
uri.sendCommand("dirble:station:12787")
}
else {
uri.sendCommand("")
state.sendCommand("stopped")
}
]
/*
* Livingroom rules
*/
rule "Livingroom stop"
when
Item mopidy_livingroom_stop received update OFF
then
mopidy_livingroom_state.sendCommand("stopped")
end
rule "Livingroom uri"
when
Item mopidy_livingroom_uri changed
then
uriChanged.apply(mopidy_livingroom_uri, mopidy_livingroom_multiroom, mopidy_livingroom_radio_channel)
end
rule "Livingroom radio channel"
when
Item mopidy_livingroom_radio_channel received command
then
radioChannelChanged.apply(receivedCommand, mopidy_livingroom_uri, mopidy_livingroom_state)
end
/*
* Kitchen rules
*/
rule "Kitchen stop"
when
Item mopidy_kitchen_stop received update OFF
then
mopidy_kitchen_state.sendCommand("stopped")
end
rule "Kitchen uri"
when
Item mopidy_kitchen_uri changed
then
uriChanged.apply(mopidy_kitchen_uri, mopidy_kitchen_multiroom, mopidy_kitchen_radio_channel)
end
rule "Kitchen multiroom"
when
Item mopidy_kitchen_multiroom received command
then
multiroomChanged.apply(receivedCommand, mopidy_kitchen_uri, mopidy_kitchen_state)
end
rule "Kitchen radio channel"
when
Item mopidy_kitchen_radio_channel received command
then
radioChannelChanged.apply(receivedCommand, mopidy_kitchen_uri, mopidy_kitchen_state)
end
/*
* Large bathroom rules
*/
rule "Large bathroom stop"
when
Item mopidy_bathroom1_stop received update OFF
then
mopidy_bathroom1_state.sendCommand("stopped")
end
rule "Large bathroom uri"
when
Item mopidy_bathroom1_uri changed
then
uriChanged.apply(mopidy_bathroom1_uri, mopidy_bathroom1_multiroom, mopidy_bathroom1_radio_channel)
end
rule "Large bathroom multiroom"
when
Item mopidy_bathroom1_multiroom received command
then
multiroomChanged.apply(receivedCommand, mopidy_bathroom1_uri, mopidy_bathroom1_state)
end
rule "Large bathroom radio channel"
when
Item mopidy_bathroom1_radio_channel received command
then
radioChannelChanged.apply(receivedCommand, mopidy_bathroom1_uri, mopidy_bathroom1_state)
end
rule "Large bathroom scene"
when
Item mysensors_bathroom1_scene received command
then
if (mopidy_bathroom1_state.state != "playing") {
mopidy_bathroom1_radio_channel.sendCommand("antyradio")
mopidy_bathroom1_state.sendCommand("playing")
}
else {
mopidy_bathroom1_state.sendCommand("paused")
}
end
/*
* Small bathroom rules
*/
rule "Small bathroom stop"
when
Item mopidy_bathroom2_stop received update OFF
then
mopidy_bathroom2_state.sendCommand("stopped")
end
rule "Small bathroom uri"
when
Item mopidy_bathroom2_uri changed
then
uriChanged.apply(mopidy_bathroom2_uri, mopidy_bathroom2_multiroom, mopidy_bathroom2_radio_channel)
end
rule "Small bathroom multiroom"
when
Item mopidy_bathroom2_multiroom received command
then
multiroomChanged.apply(receivedCommand, mopidy_bathroom2_uri, mopidy_bathroom2_state)
end
rule "Small bathroom radio channel"
when
Item mopidy_bathroom2_radio_channel received command
then
radioChannelChanged.apply(receivedCommand, mopidy_bathroom2_uri, mopidy_bathroom2_state)
end
/*
* Common rules
*/
rule "Mopidy req"
when
System started or
Time cron "0 0/30 * * * ?"
then
mopidy_livingroom_state_req.sendCommand(OFF);
Thread::sleep(100)
mopidy_livingroom_volume_req.sendCommand(OFF);
Thread::sleep(100)
mopidy_livingroom_uri_req.sendCommand(OFF);
Thread::sleep(100)
mopidy_livingroom_current_req.sendCommand(OFF);
Thread::sleep(100)
mopidy_kitchen_state_req.sendCommand(OFF);
Thread::sleep(100)
mopidy_kitchen_volume_req.sendCommand(OFF);
Thread::sleep(100)
mopidy_kitchen_uri_req.sendCommand(OFF);
Thread::sleep(100)
mopidy_kitchen_current_req.sendCommand(OFF);
Thread::sleep(100)
mopidy_bathroom1_state_req.sendCommand(OFF);
Thread::sleep(100)
mopidy_bathroom1_volume_req.sendCommand(OFF);
Thread::sleep(100)
mopidy_bathroom1_uri_req.sendCommand(OFF);
Thread::sleep(100)
mopidy_bathroom1_current_req.sendCommand(OFF);
Thread::sleep(100)
mopidy_bathroom2_state_req.sendCommand(OFF);
Thread::sleep(100)
mopidy_bathroom2_volume_req.sendCommand(OFF);
Thread::sleep(100)
mopidy_bathroom2_uri_req.sendCommand(OFF);
Thread::sleep(100)
mopidy_bathroom2_current_req.sendCommand(OFF);
end
Is this something wrong with my rules file, or it is normal ?