I am totally new to all of this and have been trying to create a small rule which I can build on,
So the devices I am using are sonoff th16 and a sonoff pow r2,
the rule is as follows,
rule “Outside Temp below 10”
when
Item so5_temp Changed
then
if(so5_temp.state as Number < 11) {
SoPow1_SW_ON_OFF.sendCommand(ON)
}
end
and then in the log file the warning is
Configuration model ‘Outside Temp Below 11.4.rules’ has errors, therefore ignoring it: [3,3]: no viable alternative at input ‘Changed’
[5,31]: no viable alternative at input ‘11’
Obviously the word “changed” is some how incorrect and the number 11 is also,
anyone able to shed light on what may be needed here, please ignore the title of the file as I have realized decimal places do not work.
rule “Outside Temp below 11”
when
Item so5_temp Changed
then
if(so5_temp.state as Number < 11) {
SoPow1_SW_ON_OFF.sendCommand(ON)
}
end
and the error
WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model ‘Outside Temp Below 11.4.rules’ has errors, therefore ignoring it: [3,3]: no viable alternative at input ‘Changed’
[5,31]: no viable alternative at input ‘11’
So I have replaced the quotations and the rule looks like this
rule “Outside Temp below 11”
when
Item so5_temp changed
then
if(so5_temp.state as Number< 11) {
SoPow1_SW_ON_OFF.sendCommand(ON)
}
end
and now the error looks like
[WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model ‘Outside Temp Below 11.4.rules’ has errors, therefore ignoring it: [5,30]: no viable alternative at input ‘11’
Not sure what is going wrong here
anyone help with this ?
so i have made the rule simple, and it still does not turn sopow1_SW_ON_OFF off,
Please can someone help?
where am I going wrong
rule “Outside Temp below 12”
when
Item so5_temp changed
then
if((so5_temp.state as Number) < 12) {
SoPow1_SW_ON_OFF.sendCommand(OFF)
rule "“Temperature switching"
when
Time cron "10 * * * * ?"
then
if((Light_TH_Temperature.state as Number) < 10) {
logInfo("Testrule", "Low Temperature={}",Light_TH_Temperature.state )
Light_TH.sendCommand(OFF)
} else
{
logInfo("Testrule", "High Temperature= {}",Light_TH_Temperature.state)
Light_TH.sendCommand(ON)
}
end
and it is working!
my log shows: 2019-04-07 11:03:10.037 [INFO ] [ipse.smarthome.model.script.Testrule] - Low Temperature= 17.3
Where is your problem? Check if all item names are spelled correctly (so5_temp versus SoPow1_SW_ON_OFF) The use of lower and upper case does matter!
Use some logInfo lines as in my example in order to see what is going on.
This all assumes that you can switch the device using the item SoPow1_SW_ON_OFF.
Actually I have just found out the else if does not work at all? given I have copied examples of the forum and am very new to this I am not sure where I may have gone wrong?
so i have the switching rule working, now i am trying to get a temperature change rule working and am struggling with this, It all seems to be in order but have no results …
any suggestions
rule “Heat Transfer Fan on/off”
when
Item Sonoff_TH16_3_temperature changed
then
if(Sonoff_TH16_3_temperature.state > 20){
SoPow1_SW_ON_OFF.sendCommand(ON)
}
end
what is incorrect in this rule
I am using a sonoff th16 with tasmota firmware.