giannello / addon-warema-bridge

20 stars 23 forks source link

Please register blinds of Type 21 (WMS Actuator UP) via function registerDevice() - Proposal inside #5

Closed surfbavaria closed 3 years ago

surfbavaria commented 3 years ago

Hello Giuseppe,

I took the liberty to look at the code in “bridge.js” to see what might be causing the following error messages:

Scanned devices.
Registering 716909
Adding device 716909 (type 06)
Registering 468442
Unrecognized device type: 21
Registering 476665
Unrecognized device type: 21
Registering 476881
Unrecognized device type: 21
Registering 525475
Unrecognized device type: 21
Registering 544087
Unrecognized device type: 21

Am I correct with my assumption that the add-on currently only handles devices of type 20 and 25?

Would you consider adding the handling of type 21 devices (element.type = 21) in the function “registerDevice()”, by expanding the switch statement? From what I understand, the "WMS Actuator UP" (Type 21) is used quite a bit, so this might significantly improve the usefulness for this integration.

From looking at the documentation for "warema-wms-venetian-blinds" type 21 devices should be supported: https://www.npmjs.com/package/warema-wms-venetian-blinds?activeTab=readme#supported-warema-wms-device-types

If I can be so bold, I would like to propose augmenting the code in “registerDevice()” with the following “case” to also support “WMS Actuator UP” devices. Please let me know if I can help in any way.

    case 21:
      model = 'Actuator UP'
      payload = {
        ...base_payload,
        device: {
          ...base_device,
          model: model
        },
        position_open: 0,
        position_closed: 100,
        command_topic: 'warema/' + element.snr + '/set',
        position_topic: 'warema/' + element.snr + '/position',
        tilt_status_topic: 'warema/' + element.snr + '/tilt',
        set_position_topic: 'warema/' + element.snr + '/set_position',
        tilt_command_topic: 'warema/' + element.snr + '/set_tilt',
        tilt_closed_value: -100,
        tilt_opened_value: 100,
        tilt_min: -100,
        tilt_max: 100,
      }
      break

Greetings from Bavaria, Germany Surfdoggie

Plug Receiver vs Actuator UP

giannello commented 3 years ago

@surfbavaria thanks for reporting and suggesting a fix. It's been applied to master and a new version of the image has been release. Please update and let me know :)