Control a hood (AEG/Electrolux Hob2hood) using tasmota and YTF IR Bridge

Hey folks, i own a “smart” hood from AEG, which means it should automatically turn on/off when i start cooking.

Unfortunately my AEG stove/oven is not compatible, so i needed to fix that.
I utilize the tasmota Bridge for voice control.
“Hey siri, turn my hood light on/set fan to 0/25/50/75/100%”
My IR Raw codes can be found on pastebin:

The formatted codes (used for receiving) can be found in other repositories:

VENT_1 = 0xE3C01BE2
VENT_2 = 0xD051C301
VENT_3 = 0xC22FFFD7
VENT_4 = 0xB9121B29
VENT_OFF = 0x55303A3
LIGHT_ON = 0xE208293C
LIGHT_OFF = 0x24ACF947

Description for the IR Gateway is here:

The box is quite cheap (<20€) WiFi IR Control Hub for Home Automation Remote Control Compatible with Alexa Google Home, Smart Life Tuya App Control Smart Home Hub for Smartphones: Amazon.de: DIY & Tools
Documentation on how to program it: Pearls WLAN-Universalfernbedienung mit MQTT nutzen | heise online - That’s German :confused:

So for turning on/off the light i use the following ruleset:

var Timer light_CMD1 = null
var Timer light_CMD2 = null

rule "Hob lightswitch"
when
    Item Hob2Hood_Light changed
then
    if(Hob2Hood_Light.state==ON)
    {
        Hob2Hood_cmd.sendCommand("3,718,1472,720,726,1388,752,718,1472,694,750,1390,2994,720,724,720,726,1386")
        light_CMD1 = createTimer(now.plusSeconds(1)) [|
            Hob2Hood_cmd.sendCommand("0,720,1468,722,724,1392,748,722,1470,718,726,1416,2968,696,748,696,748,1388")
            light_CMD1 = null
        ]
        light_CMD2 = createTimer(now.plusSeconds(2)) [|
            Hob2Hood_cmd.sendCommand("0,744,1472,720,724,1414,726,698,1494,718,726,1392,2966,750,722,722,724,1386")
            light_CMD2 = null
        ]
    }
    else
    {
        // Licht aus
        Hob2Hood_cmd.sendCommand("3,684,1488,658,778,684,758,686,2278,660,788,628,1532,688,1504,686,786,658")
        light_CMD1 = createTimer(now.plusSeconds(1)) [|
            Hob2Hood_cmd.sendCommand("0,706,1506,660,782,634,814,660,2250,660,786,686,1532,660,1504,686,786,656")
            light_CMD1 = null
        ]
        light_CMD2 = createTimer(now.plusSeconds(2)) [|
            Hob2Hood_cmd.sendCommand("0,656,1532,686,784,660,758,684,2254,688,758,710,1482,682,1510,682,786,656")
            light_CMD2 = null
        ]
    }
end

I know, that looks ugly, but.. it works :wink:

1 Like

Just an update on the tasmota config.
Unfortunately the tasmota-device was unable to connect to my WiFi, so i experienced a change in the MQTT config (channel)

Important steps:

  1. Use a template or configure device accordingly (GPIO for IR-Send and Receive)
  2. Note/change MQTT Topics, if needed
  3. Apply them in your things file/config:
    ir_hood "Hob2Hood" @ "Kitchen" [availabilityTopic="ESP/tasmota_BA7135/LWT", payloadAvailable="Online", payloadNotAvailable="Offline"]
    	{
    		Channels:
                Type string	: ir_code       "IR GW -IRSEND"         [commandTopic="ESP/tasmota_BA7135/cmnd/IRSEND"]
    			Type number : wifi_rssi     "IR GW WiFi RSSI"       [stateTopic="ESP/tasmota_BA7135/STATE", transformationPattern="JSONPATH:$.Wifi.RSSI"]
    			Type string : wifi_ssid     "IR GW WiFi SSID"       [stateTopic="ESP/tasmota_BA7135/STATE", transformationPattern="JSONPATH:$.Wifi.SSId"]
    			Type string : wifi_downtime "IR GW WiFi downtime"   [stateTopic="ESP/tasmota_BA7135/STATE", transformationPattern="JSONPATH:$.Wifi.Downtime"]
    			Type string : uptime        "IR Gateway uptime"     [stateTopic="ESP/tasmota_BA7135/STATE", transformationPattern="JSONPATH:$.Uptime"]
    			Type string : tasmota_ver   "IR GW SW Version"      [stateTopic="ESP/tasmota_BA7135/INFO1", transformationPattern="JSONPATH:$.Info1.Version"]
    			Type string : tasmota_IP    "IR GW IP Address"      [stateTopic="ESP/tasmota_BA7135/INFO2", transformationPattern="JSONPATH:$.Info2.IPAddress"]            
    	}
    

How do i integrate the raw-IR codes in OH?
That could be done via mapping (for instance)

rule "proxy IR mqtt"
when
    Item Hob2Hood_proxy received command
then
    Hob2Hood_cmd.sendCommand(transform("MAP", "hob2hood.map", receivedCommand.toString))
end

hob2hood.map

//Pastebin: https://pastebin.com/N6kG7Wu5
L1=5,720,1468,722,724,1392,748,722,1470,718,726,1416,2968,696,748,696,748,1388
// Licht aus
L0=5,684,1488,658,778,684,758,686,2278,660,788,628,1532,688,1504,686,786,658
// Stufe 1-4
F1=5,1416,1494,722,1570,1974,1510,722,1468,726,718,724,1468,724,2216,696
F2=5,1444,1470,724,2936,726,2240,3502,2198,2142
F3=5,696,2240,2784,2968,2116,750,724,2216,2114
F4=5,1416,2244,1418,722,1418,2216,1418,1470,724,2216,722,722,1392
// Lüfter aus
F0=5,720,1468,722,1470,2114,1472,722,1470,1416,2218,724,1470,724,720,698