Skip to content
This repository was archived by the owner on Aug 30, 2025. It is now read-only.
This repository was archived by the owner on Aug 30, 2025. It is now read-only.

Learning doesn't seem to work #3

@alexmuntean

Description

@alexmuntean

Hi,

I really like the idea but I can't get it working.
I want to achieve exactly what you're describing - "IFTTT" :)

I've tried using http://localhost:1880/learn/a/192.168.1.108 while index is


const BroadlinkServer = require('broadlink-rm-http');
const commands = require('./commands');

const port = process.env.PORT || 1880;
const key = "a";

const rooms = [];
rooms["ROOM_NAME"] = {host:"192.168.1.108",groups:["GROUP_A", "GROUP_B"]};

let app = BroadlinkServer(commands, key, rooms);
app.listen(port);

console.log('Server running, go to http://localhost:' + port);

but it isn't working

The output of index.js is "Discovered Broadlink RM device at 77:0f:78:18:02:e8 (192.168.1.108)" which actually is a broadlink rm pro plus or something like that...

For RF learning I saw that it has to be in 2 steps because the device has is scanning 2 bands - one for 300-something RF and one for 433 mhz (the one I need)

I finally managed to use your server and it works ok but the learning isn't.
I do the rf433 learning like this:

"use strict";

let Broadlink = require('broadlinkjs-rm');

const bl = new Broadlink();
bl.discover();

bl.on("deviceReady", (device) => {
    console.log(device);

    device.on("rawData", (message) => {
        console.log("rawData", message.toString('hex'));
        device.cancelLearn();
    });

    device.on("rawRFData", (message) => {
        console.log("rawRFData", message.toString('hex'));

        device.enterLearning();
        setTimeout(() => {
            device.checkData();
        }, 1000);

    });

    setTimeout(() => {
        console.log("entering sweep mode");
        device.enterRFSweep();

        setTimeout(() => {
            console.log("checking rf data - press multiple times longer");
            device.checkRFData();
        }, 5000);

    }, 2000);


});

Thanks a lot for your contribution,
Alex

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions