Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ElerotransmitterStick] Add further commands #8662

Open
micro-bot opened this issue Oct 4, 2020 · 1 comment
Open

[ElerotransmitterStick] Add further commands #8662

micro-bot opened this issue Oct 4, 2020 · 1 comment
Labels
awaiting feedback enhancement An enhancement or new feature for an existing add-on

Comments

@micro-bot
Copy link

Hi,

I have an idea/request but not the possibility/capability to do it - hope the community can help:

I have a Centero Transmitter Stick built 11.19 paired with my Elero shutters.
With current addon of ElerotransmitterStick I can just move single step and not till upper or lower end.
Some quick tests showed that there are auto-up and auto-down movements implemented in my elero stick:
the commands are 0x21 and 0x41, in general the protocol has not changed but extended / those are not documented in the API from Elero.

My request:
Please add support for auto movement. I checked the code, it would be pretty simple, but I do not have the dev environment to do a pull request. Two files would need a change:

/******** 1st change section in CommandType.java ************/

public enum CommandType {
UP,
UPAUTO,
INTERMEDIATE,
VENTILATION,
DOWN,
DOWNAUTO,
STOP,
INFO,
CHECK,
NONE;

public static CommandType getForPercent(int percentage) {
    if (percentage == 0) {
        return UP;
    }
    
    if (percentage == 10) {
        return UPAUTO;
    }

    if (percentage == 25) {
        return CommandType.INTERMEDIATE;
    }

    if (percentage == 75) {
        return CommandType.VENTILATION;
    }
    
    if (percentage == 90) {
        return DOWNAUTO;
    }
    
    if (percentage == 100) {
        return CommandType.DOWN;
    }

    return null;
}

}

/****** 2nd change: section in CommandUtil.java ******/

private static byte getCommandByte(CommandType command) {
    switch (command) {
        case DOWN:
            return (byte) 0x40;
        case DOWNAUTO:
            return (byte) 0x41;
        case INTERMEDIATE:
            return (byte) 0x44;
        case STOP:
            return (byte) 0x10;
        case UP:
            return (byte) 0x20;
        case UPAUTO:
            return (byte) 0x21;
        case VENTILATION:
            return (byte) 0x24;
        default:
            throw new IllegalArgumentException("Unhandled command type " + command);

    }
}

Thank you in advance!

@micro-bot micro-bot added the enhancement An enhancement or new feature for an existing add-on label Oct 4, 2020
@lsiepel
Copy link
Contributor

lsiepel commented Jan 13, 2023

Long standing request that I might fix with a PR. Before I spend time on it, some checks.
@micro-bot can you confirm this issue exists for openHAB 3.4.1 and you are able to perform tests?
Maybe @vbier as codeowner can make a general comment at the suggested code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting feedback enhancement An enhancement or new feature for an existing add-on
Projects
None yet
Development

No branches or pull requests

2 participants