Man_You
(Man You)
October 16, 2020, 12:18pm
1
How to turn on the heater. off automatically at a temperature of 38 °C
And turn on the fan at a temperature of 38 °C Wait for the heat to decrease And turn off 28 °C
rule “Heater”
when
Item Sonoff3 changed from OFF to ON
then
if (Temperature.state => 38) {
Sonoff3.sendCommand(OFF)
}
end
rule “Fan”
when
Item Temperature changed
then
if (Temperature.state => 38) {
Sonoff2.sendCommand(ON)
} else if(Temperature.state <= 28) {
Sonoff2.sendCommand(OFF)
}
end
rossko57
(Rossko57)
October 16, 2020, 1:36pm
2
You might find this recent post helpful, you need to find out if you have created your Item as a Quantity type with units.
Running in to some problems with a rule.
I have a scripts that turns on a fan if the drawn power is higher than the standby power.
This item I formatted: Number:Energy Xbox_Watt “Xbox Watt [%.0f W]”
Thus, the reading is eg “10 W”
My rule is:
if ((Xbox_Watt.state > 30) || (Denon_Watt.state > 10))
But, this doesnt work because it reads 10 W
How to fix this?
I’m not sure what your "heater"rule is about. It will run only once just as Sonoff3 (whatever that is) gets switched on, then it might or might not switch it back off again depending on Temperature.
The “Fan” rule looks sensible.
1 Like
Hey @Man_You
The trigger for your heater rule will only trigger once in the state change from OFF to ON and is not one that is usable.
You want the rule to trigger when you something has changed and you need to do something maybe.
So lets say I want that when the temp changes I want to check if I need the heater on. So if it is above 38 and the heater is on, turn it off.
rule "Heater"
when
Item Temperature changed
then
if (Temperature.state => 38 && Sonoff3.state == ON) Sonoff3.sendCommand(OFF)
end
1 Like
Man_You
(Man You)
October 20, 2020, 7:07am
6
I don’t know why Rules Inoperative or it type item wrong ?
RafalO
(Rafal)
October 20, 2020, 7:37am
7
You need to change items`s type definition from String into Number I suppose.
Man_You
(Man You)
October 20, 2020, 8:44am
8
Try to change Type “Nubber” Parameter show “NaN”
But if Type “String” Parameter normal show But the rules don’t work.
NaN
Not a Number
What is the value of SonoffS22_Temperature
You have the on off condition of => so it will never be on
rossko57
(Rossko57)
October 20, 2020, 10:31am
10
You can’t just randomly change your Item types when they are linked to channels. The Item type must match the channel type.
You have kept secret your channels, so you are on your own with that.
When your Item types are correct, then we can work the rule to suit the Items.
Man_You
(Man You)
October 20, 2020, 10:49am
12
But now Rules only work Code.
*** mark ( < ) = work ***
*** mark ( > ) = not work ***
[WORK]
rule “Fan”
when
Item Temperature changed
then
if (Temperature.state < 28) {
Fan.sendCommand(OFF)
}
end
[NOT WORK]
rule “Fan”
when
Item Temperature changed
then
if (Temperature.state > 28) {
Fan.sendCommand(OFF)
}
end
I don’t know why
rossko57
(Rossko57)
October 20, 2020, 10:54am
13
Man_You:
I don’t know why
Neither do we, because we have no idea what the conditions are at your end. Let’s guess you’ve changed your Items, again. We don’t know what to, it’s your secret.
Perhaps you can show us just one line from your events.log
that shows your Item named Temperature
changing ?
Man_You
(Man You)
October 20, 2020, 1:00pm
14
NaN
Not a Number
What is the value of SonoffS22_Temperature
You have the on off condition of => so it will never be on
What do you think? I don’t know why I don’t follow the condition (=>) but follow the condition (<). Do you have an example?
Item Name Sonoff_temperature (temperature)
Item Name Sonoff5 (Switch Sonoff)
*** mark ( < ) = work ***
*** mark ( > ) = not work ***
[WORK]
rule “Fan”
when
Item Temperature changed
then
if (Temperature.state < 28) {
Fan.sendCommand(OFF)
}
end
[NOT WORK]
rule “Fan”
when
Item Temperature changed
then
if (Temperature.state > 28) {
Fan.sendCommand(OFF)
}
end
rossko57
(Rossko57)
October 20, 2020, 1:22pm
15
Neither of these items is named Temperature
What is this list? it doesn’t make much sense.
So neither of those Items has anything to do with this rule, which is triggered by an Item named Temperature
.
If you look in your events.log
and find a changed entry for your real temperature Item, we would be able to help you.
1 Like