fruggy83 / openocean

27 stars 12 forks source link

Add PTM200 messages to rollershutter #51

Closed fruggy83 closed 5 years ago

fruggy83 commented 5 years ago

I am working on this.

dominikkv commented 5 years ago

I'd also like to send PTM200 messages to my devices, in this case to the FUD61NPN to activate light alarm clock. Right now I am using a GenericThing with a transformation map. Would you please also add this to a switching thing type (RockerSwitch ? ). Implementation of sending data in PTM200Message.java could look like this:

@Override
protected void convertFromCommandImpl(String channelId, String channelTypeId, Command command, State currentState,
        Configuration config) {
    if (command instanceof OnOffType) {
        setData((OnOffType) command == OnOffType.ON ? On : Off);
    } else if (command instanceof PercentType) {
        setData((PercentType) command == PercentType.ZERO ? Up : Down);
    } else if (command instanceof OpenClosedType) {
        setData((OpenClosedType) command == OpenClosedType.OPEN ? Open : Closed);
    }
}
fruggy83 commented 5 years ago

Hi @dominikkv,

currently all actuators can only handle one sendingEEP but many receivingEEPs. I would suggest to implement a Funkschaltuhr thing like a FSU14, which sends PTM messages for ON and OFF. However the timing when this thing should send a signal should be managed by a rule. Is this ok?

Best regards Daniel