Here is the complete rule.
It’s quiet long because it is the rule for all RF Code incoming on my Sonoff BRIDGE
But, I made another test whith a sitemap switch (so no rules now) and it does the same thing
I’ll post more log this evening
Aymeric
rule "SONOFF BRIDGE"
when
Item SONOFF_BRIDGE_RfReceive changed
then
if (SONOFF_BRIDGE_RfReceive.state == NULL)
{
logInfo("rule SONOFF BRIDGE", "Item is null, cancelling...")
return;
}
var rfData = SONOFF_BRIDGE_RfReceive.state.toString
logInfo("rule SONOFF BRIDGE", "Code RF recu: " + rfData)
switch (rfData) {
case "0332DE" :
{
logInfo("rule SONOFF BRIDGE", "-> Courrier Reçu")
// Reset Dernier Code Re�u
rfData=""
SONOFF_BRIDGE_RfReceive.postUpdate(rfData)
}
case "066661",
case "4A5014":
{
if (SONOFF_LAMPE_TABLE.state == ON)
{
logInfo("rule SONOFF BRIDGE", "-> SONOFF_LAMPE_TABLE.sendCommand(OFF)")
SONOFF_LAMPE_TABLE.sendCommand(OFF)
}
else
{
logInfo("rule SONOFF BRIDGE", "-> SONOFF_LAMPE_TABLE.sendCommand(ON)")
SONOFF_LAMPE_TABLE.sendCommand(ON)
}
// Reset Dernier Code Re�u
rfData=""
SONOFF_BRIDGE_RfReceive.postUpdate(rfData)
}
case "066662",
case "DC8572",
case "4A5018":
{
if (SONOFF_LAMPE_SALON.state == ON)
{
logInfo("rule SONOFF BRIDGE", "-> SONOFF_LAMPE_SALON.sendCommand(OFF)")
SONOFF_LAMPE_SALON.sendCommand(OFF)
}
else
{
logInfo("rule SONOFF BRIDGE", "-> SONOFF_LAMPE_SALON.sendCommand(ON)")
SONOFF_LAMPE_SALON.sendCommand(ON)
}
// Reset Dernier Code Re�u
rfData=""
SONOFF_BRIDGE_RfReceive.postUpdate(rfData)
}
case "066668",
case "A59E78",
case "DC8574",
case "4A5012":
{
if (SONOFF_LAMPE_TV.state == ON)
{
logInfo("rule SONOFF BRIDGE", "-> SONOFF_LAMPE_TV.sendCommand(OFF)")
SONOFF_LAMPE_TV.sendCommand(OFF)
Wifiled_1.sendCommand(OFF)
}
else
{
logInfo("rule SONOFF BRIDGE", "-> SONOFF_LAMPE_TV.sendCommand(ON)")
SONOFF_LAMPE_TV.sendCommand(ON)
Wifiled_1.sendCommand(ON)
}
// Reset Dernier Code Re�u
rfData=""
SONOFF_BRIDGE_RfReceive.postUpdate(rfData)
}
case "B0DE44":
{
logInfo("rule SONOFF BRIDGE", "-> SONOFF_LAMPE_TABLE.sendCommand(OFF)")
SONOFF_LAMPE_TABLE.sendCommand(OFF)
logInfo("rule SONOFF BRIDGE", "-> SONOFF_LAMPE_TV.sendCommand(OFF)")
SONOFF_LAMPE_TV.sendCommand(OFF)
Wifiled_1.sendCommand(OFF)
logInfo("rule SONOFF BRIDGE", "-> SONOFF_LAMPE_SALON.sendCommand(OFF)")
SONOFF_LAMPE_SALON.sendCommand(OFF)
// Reset Dernier Code Re�u
rfData=""
SONOFF_BRIDGE_RfReceive.postUpdate(rfData)
Samsung_TV_IR_Remote.sendCommand("SAMSUNG_POWER_OFF")
}
case "065171" :
{
if (SONOFF_LAMPE_CHAMBRE.state == ON)
{
logInfo("rule SONOFF BRIDGE", "-> SONOFF_LAMPE_CHAMBRE.sendCommand(OFF)")
SONOFF_LAMPE_CHAMBRE.sendCommand(OFF)
}
else
{
logInfo("rule SONOFF BRIDGE", "-> SONOFF_LAMPE_CHAMBRE.sendCommand(ON)")
SONOFF_LAMPE_CHAMBRE.sendCommand(ON)
}
// Reset Dernier Code Re�u
rfData=""
SONOFF_BRIDGE_RfReceive.postUpdate(rfData)
}
case "061AE1":
{
logInfo("rule SONOFF BRIDGE", Wifiled_2.state.toString())
if (Wifiled_2.state == ON)
{
logInfo("rule SONOFF BRIDGE", "-> Wifiled_2.sendCommand(OFF)")
Wifiled_2.sendCommand(OFF)
}
else
{
logInfo("rule SONOFF BRIDGE", "-> Wifiled_2.sendCommand(ON)")
// SONOFF_LAMPE_RGB_1_Color_RGBCW.sendCommand("000000FFFF")
Wifiled_2.sendCommand(ON)
}
// Reset Dernier Code Re�u
rfData=""
SONOFF_BRIDGE_RfReceive.postUpdate(rfData)
}
// case "061AE1":
// {
// logInfo("rule SONOFF BRIDGE", SONOFF_LAMPE_RGB_1.state.toString())
// if (SONOFF_LAMPE_RGB_1.state == ON)
// {
// logInfo("rule SONOFF BRIDGE", "-> SONOFF_LAMPE_RGB_1.sendCommand(OFF)")
// SONOFF_LAMPE_RGB_1.sendCommand(OFF)
// }
// else
// {
// logInfo("rule SONOFF BRIDGE", "-> SONOFF_LAMPE_RGB_1.sendCommand(ON)")
// SONOFF_LAMPE_RGB_1_Color_RGBCW.sendCommand("000000FFFF")
// SONOFF_LAMPE_RGB_1.sendCommand(ON)
// }
// // Reset Dernier Code Re�u
// rfData=""
// SONOFF_BRIDGE_RfReceive.postUpdate(rfData)
// }
////////////////// WIFILED
case "000F01",case "000F02",case "000F03",case "000F04",case "000F05",
case "000F06",case "000F07",case "000F08",case "000F09",case "000F0A",
case "000F0B",case "000F0C",case "000F0D",case "000F0E",case "000F0F",
case "000F10",case "000F11",case "000F12",case "000F13",case "000F14",case "000F15" :
{
Telecommande_LED1.sendCommand(rfData)
rfData=""
SONOFF_BRIDGE_RfReceive.postUpdate(rfData)
}
}
end