Koenkk / zigbee2mqtt

Zigbee 🐝 to MQTT bridge 🌉, get rid of your proprietary Zigbee bridges 🔨
https://www.zigbee2mqtt.io
GNU General Public License v3.0
12.13k stars 1.68k forks source link

Ikea Outlet Switch Support (E1743) #997

Closed Curtisjk closed 5 years ago

Curtisjk commented 5 years ago

Is there any main reason why the switch that comes bundled with the Ikea Tradfri Outlet (https://www.ikea.com/gb/en/products/lighting/smart-lighting/trådfri-control-outlet-kit-art-10364797/) is not supported yet? I'm going to be buying some of these outlets and was wondering whether to get the switches at the same time as they are not sold separately.

I know the other Ikea Tradfri remote only got support added recently due to it using Zigbee groups and random IDs (#102) - would there be similar issues with this switch, or does it just need the converters writing?

There was a discussion in #607 but no PR was ever created.

Many thanks!

Koenkk commented 5 years ago

AFAIK only some simple modifications to zigbee-shepherd are needed (I can help with this). Let me know once you have the device

Koenkk commented 5 years ago

@HamsterHauge can you pair the device and provide the output?

Curtisjk commented 5 years ago

I have just found out this is out of stock all over the UK so may not be able to help get it integrated just yet!

On Sat, 2 Feb 2019 at 14:17, Koen Kanters notifications@github.com wrote:

@HamsterHauge https://github.com/HamsterHauge can you pair the device and provide the output?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Koenkk/zigbee2mqtt/issues/997#issuecomment-459968551, or mute the thread https://github.com/notifications/unsubscribe-auth/ACAfYla-NdvLN6YhvKhTK97q9P8lcEi4ks5vJZ3egaJpZM4afjOf .

antti365 commented 5 years ago

Hello everyone, finally delivered to Finland outlets with switches, bought, ready for testing. :)

antti365 commented 5 years ago

Immediately the question is, not quite on the switch, until I connected only the outlet ... Outlet and should respond in duplicate, or something is not working correctly for me?

zigbee2mqtt/0x000d6ffffe9a85bd/set {"state":"ON"} zigbee2mqtt/0x000d6ffffe9a85bd {"state":"ON","linkquality":102,"last_seen":1549303848269,"elapsed":10430} zigbee2mqtt/0x000d6ffffe9a85bd {"state":"ON","linkquality":97,"last_seen":1549303901772,"elapsed":53503} zigbee2mqtt/0x000d6ffffe9a85bd/set {"state":"OFF"} zigbee2mqtt/0x000d6ffffe9a85bd {"state":"OFF","linkquality":97,"last_seen":1549303901772,"elapsed":53503} zigbee2mqtt/0x000d6ffffe9a85bd {"state":"OFF","linkquality":102,"last_seen":1549303918991,"elapsed":17219}

Koenkk commented 5 years ago

@antti365 this can be ignored, the first one is a made by zigbee2mqtt, the second one comes from the device

antti365 commented 5 years ago

@Koenkk I understand correctly, for the switch need firmware that supports the group? (to use groups, at least firmware version 20181224 is required!) Because the switch successfully communicates with the outlet, but absolutely does not want to contact the stick, there is silence in the log file ... Unfortunately, my programmer has not reached me yet ... :(

Koenkk commented 5 years ago

That shouldnt be needed, can you share your database.db with the device paired?

antti365 commented 5 years ago

@Koenkk So the fact of the matter is that the switch does not even begin the process of pairing with the stick. First, I factory reset by pressing the button 4 times, then I wait for it to stop glowing, and hold the pairing button for> 10 seconds and nothing happens at all, and there is nothing in the log file at all ...

HamsterHauge commented 5 years ago

Absolutely the same here.

antti365 commented 5 years ago

@Koenkk @HamsterHauge I removed the outlet from the database, reset the stick and switch and tried again, records appeared in the log file! :)

Feb 04 22:11:29 raspberrypi3 npm[20780]: zigbee2mqtt:info 2/4/2019, 10:11:29 PM Connecting with device... Feb 04 22:11:29 raspberrypi3 npm[20780]: zigbee2mqtt:info 2/4/2019, 10:11:29 PM MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"pairing","message":"connecting with device"}' Feb 04 22:11:30 raspberrypi3 npm[20780]: zigbee2mqtt:info 2/4/2019, 10:11:30 PM Connecting with device... Feb 04 22:11:30 raspberrypi3 npm[20780]: zigbee2mqtt:info 2/4/2019, 10:11:30 PM MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"pairing","message":"connecting with device"}' Feb 04 22:11:34 raspberrypi3 npm[20780]: zigbee2mqtt:info 2/4/2019, 10:11:34 PM Connecting with device... Feb 04 22:11:34 raspberrypi3 npm[20780]: zigbee2mqtt:info 2/4/2019, 10:11:34 PM MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"pairing","message":"connecting with device"}' Feb 04 22:11:36 raspberrypi3 npm[20780]: zigbee2mqtt:info 2/4/2019, 10:11:36 PM Connecting with device... Feb 04 22:11:36 raspberrypi3 npm[20780]: zigbee2mqtt:info 2/4/2019, 10:11:36 PM MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"pairing","message":"connecting with device"}' Feb 04 22:11:38 raspberrypi3 npm[20780]: zigbee2mqtt:info 2/4/2019, 10:11:38 PM Connecting with device... Feb 04 22:11:38 raspberrypi3 npm[20780]: zigbee2mqtt:info 2/4/2019, 10:11:38 PM MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"pairing","message":"connecting with device"}' Feb 04 22:11:40 raspberrypi3 npm[20780]: zigbee2mqtt:info 2/4/2019, 10:11:40 PM Connecting with device... Feb 04 22:11:40 raspberrypi3 npm[20780]: zigbee2mqtt:info 2/4/2019, 10:11:40 PM MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"pairing","message":"connecting with device"}' Feb 04 22:11:44 raspberrypi3 npm[20780]: zigbee2mqtt:info 2/4/2019, 10:11:44 PM Connecting with device... Feb 04 22:11:44 raspberrypi3 npm[20780]: zigbee2mqtt:info 2/4/2019, 10:11:44 PM MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"pairing","message":"connecting with device"}' Feb 04 22:11:46 raspberrypi3 npm[20780]: zigbee2mqtt:info 2/4/2019, 10:11:46 PM Connecting with device... Feb 04 22:11:46 raspberrypi3 npm[20780]: zigbee2mqtt:info 2/4/2019, 10:11:46 PM MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"pairing","message":"connecting with device"}' Feb 04 22:11:51 raspberrypi3 npm[20780]: zigbee2mqtt:info 2/4/2019, 10:11:51 PM Connecting with device... Feb 04 22:11:51 raspberrypi3 npm[20780]: zigbee2mqtt:info 2/4/2019, 10:11:51 PM MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"pairing","message":"connecting with device"}' Feb 04 22:11:53 raspberrypi3 npm[20780]: zigbee2mqtt:info 2/4/2019, 10:11:53 PM Connecting with device... Feb 04 22:11:53 raspberrypi3 npm[20780]: zigbee2mqtt:info 2/4/2019, 10:11:53 PM MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"pairing","message":"connecting with device"}' Feb 04 22:11:57 raspberrypi3 npm[20780]: zigbee2mqtt:info 2/4/2019, 10:11:57 PM Connecting with device... Feb 04 22:11:57 raspberrypi3 npm[20780]: zigbee2mqtt:info 2/4/2019, 10:11:57 PM MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"pairing","message":"connecting with device"}' Feb 04 22:11:59 raspberrypi3 npm[20780]: zigbee2mqtt:info 2/4/2019, 10:11:59 PM Connecting with device... Feb 04 22:11:59 raspberrypi3 npm[20780]: zigbee2mqtt:info 2/4/2019, 10:11:59 PM MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"pairing","message":"connecting with device"}' Feb 04 22:11:59 raspberrypi3 npm[20780]: zigbee2mqtt:info 2/4/2019, 10:11:59 PM Device incoming... Feb 04 22:11:59 raspberrypi3 npm[20780]: zigbee2mqtt:info 2/4/2019, 10:11:59 PM MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"pairing","message":"device incoming"}' Feb 04 22:11:59 raspberrypi3 npm[20780]: zigbee2mqtt:info 2/4/2019, 10:11:59 PM New device with address 0x000d6ffffeb1d3c5 connected! Feb 04 22:11:59 raspberrypi3 npm[20780]: zigbee2mqtt:info 2/4/2019, 10:11:59 PM MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"device_connected","message":"0x000d6ffffeb1d3c5"}' Feb 04 22:11:59 raspberrypi3 npm[20780]: zigbee2mqtt:warn 2/4/2019, 10:11:59 PM Device with modelID 'TRADFRI on/off switch' is not supported. Feb 04 22:11:59 raspberrypi3 npm[20780]: zigbee2mqtt:warn 2/4/2019, 10:11:59 PM Please see: https://koenkk.github.io/zigbee2mqtt/how_tos/how_to_support_new_devices.html Feb 04 22:11:59 raspberrypi3 npm[20780]: zigbee2mqtt:warn 2/4/2019, 10:11:59 PM Device with modelID 'TRADFRI on/off switch' is not supported. Feb 04 22:11:59 raspberrypi3 npm[20780]: zigbee2mqtt:warn 2/4/2019, 10:11:59 PM Please see: https://koenkk.github.io/zigbee2mqtt/how_tos/how_to_support_new_devices.html

antti365 commented 5 years ago

@Koenkk database.db.zip

Attila-FIN commented 5 years ago

I've been also playing with CC2531 and zigbee2mqtt for two days now, I have successfully paired and controlled Tradfri Control outlet E1603 from Node-RED, paired and received messages from the 5 button Tradfri Remote E1524 (however I had to update node packages, especially zigbee-shepherd-converters, with npm update). Unfortunately I could not make the Tradfri ON/OFF Switch E1743 working. I could pair it after re-inserting the CC2531 stick and restarting zigbee2mqtt. After pairing, in Wireshark I could also see ON and OFF commands sent by the switch (btw, there is also move UP and DOWN commands when buttons are kept pushed). In Wireshark I could also see, that group number is always 0x0000 for the switch, unlike in the case of E1524, where it is randomly generated. I guess that means no group. I have created a new entry in the devices.js if the zigbee-shepherd-converters package:

    {
        zigbeeModel: ['TRADFRI on/off switch'],
        model: 'E1743',
        vendor: 'IKEA',
        description: 'Remote with ON/OFF buttons',
        supports: '',
        fromZigbee: [],
        toZigbee: [],
    },

However I haven't seen anything in the zigbee2mqtt console. I believe there might be some configure section needed for the new device, but I do not know what would be needed there.

Koenkk commented 5 years ago

Can you try with:

    {
        zigbeeModel: ['TRADFRI on/off switch'],
        model: 'E1743',
        vendor: 'IKEA',
        description: 'Remote with ON/OFF buttons',
        supports: '',
        fromZigbee: [],
        toZigbee: [],
            const device = shepherd.find(ieeeAddr, 1);
            const actions = [
                (cb) => device.bind('genOnOff', coordinator, cb),
            ];

            execute(device, actions, callback);
    },

In case that doesn't work

    {
        zigbeeModel: ['TRADFRI on/off switch'],
        model: 'E1743',
        vendor: 'IKEA',
        description: 'Remote with ON/OFF buttons',
        supports: '',
        fromZigbee: [],
        toZigbee: [],
            const device = shepherd.find(ieeeAddr, 1);
            const actions = [
                (cb) => device.bind('genOnOff', 99, cb),
            ];

            execute(device, actions, callback);
    },

and with sniffing verify that the remote now uses group 99?

Attila-FIN commented 5 years ago

Thanks @Koenkk , I tried both with the same results (the "configure: ..." part had to be added). In Wireshark I can see the bind request is sent to the remote and there is successful response, but I don't get any message like "WARN No converter available for..." in zigbee2mqtt output. Please see the Wireshark capture file about bind request and ON/OFF commands: Tradfri E1743 binding to group 99.zip Earlier. while trying to reuse configure sections from other devices, I managed to get the battery level reported for every button press, at least that what it saw, but values were strange. Perhaps the ON/OFF values were incorrectly parsed.

Koenkk commented 5 years ago

@Attila-FIN please update to the latest dev branch, the coordinator will now be added to group 99 where it should receive commands of the remote.

Attila-FIN commented 5 years ago

@Koenkk , I pulled the latest dev and used the following devices.js entry for the E1743 remote:

    {
        zigbeeModel: ['TRADFRI ON/OFF Switch'],
        model: 'E1743',
        vendor: 'IKEA',
        description: 'Remote with ON/OFF buttons',
        supports: '',
        fromZigbee: [],
        toZigbee: [],
        configure: (ieeeAddr, shepherd, coordinator, callback) => {
                const device = shepherd.find(ieeeAddr, 1);
                const actions = [
                        (cb) => device.bind('genOnOff', 99, cb),
                ];

            execute(device, actions, callback);
        },
    },

Now commands from remote are shown in the zigbee2mqtt output:

No converter available for 'E1743' with cid 'genOnOff', type 'cmdOff' and data '{"cid":"genOnOff","data":{}}'
No converter available for 'E1743' with cid 'genOnOff', type 'cmdOn' and data '{"cid":"genOnOff","data":{}}'
No converter available for 'E1743' with cid 'genLevelCtrl', type 'cmdMove' and data '{"cid":"genLevelCtrl","data":{"movemode":1,"rate":83}}'
No converter available for 'E1743' with cid 'genLevelCtrl', type 'cmdStopWithOnOff' and data '{"cid":"genLevelCtrl","data":{}}'
No converter available for 'E1743' with cid 'genLevelCtrl', type 'cmdMoveWithOnOff' and data '{"cid":"genLevelCtrl","data":{"movemode":0,"rate":83}}'
No converter available for 'E1743' with cid 'genLevelCtrl', type 'cmdStopWithOnOff' and data '{"cid":"genLevelCtrl","data":{}}'

Now, only the right converters needed to be picked/created.

Koenkk commented 5 years ago

When are those genLevelCtrl commands send?

Attila-FIN commented 5 years ago

I played around a bit with converters, I created new ones, which correspond more to the Wireshark interpreted command description. Unfortunately my understanding of the architecture and generally Zigbee is not very deep yet. so certain things look mysterious to me:

Anyway, here are the converters, I hope they can be used for something:

    E1743_on: {
        cid: 'genOnOff',
        type: 'cmdOn',
        convert: (model, msg, publish, options) => {
            return {click: 'on'};
        },
    },
    E1743_off: {
        cid: 'genOnOff',
        type: 'cmdOff',
        convert: (model, msg, publish, options) => {
            return {click: 'off'};
        },
    },
    E1743_move_down: {
        cid: 'genLevelCtrl',
        type: 'cmdMove',
        convert: (model, msg, publish, options) => {
            const direction = msg.data.data.movemode === 1 ? 'down' : 'up';
            return {action: `move_${direction}`, rate: msg.data.data.rate};
        },
    },
    E1743_move_up: {
        cid: 'genLevelCtrl',
        type: 'cmdMoveWithOnOff',
        convert: (model, msg, publish, options) => {
            const direction = msg.data.data.movemode === 1 ? 'down' : 'up';
            return {action: `move_${direction}`, rate: msg.data.data.rate};
        },
    },
    E1743_move_stop: {
        cid: 'genLevelCtrl',
        type: 'cmdStopWithOnOff',
        convert: (model, msg, publish, options) => {
            return {action: 'move_stop'};
        },
    },
Koenkk commented 5 years ago

@Attila-FIN experimental support is in https://github.com/Koenkk/zigbee-shepherd-converters/tree/E1743 now.

vke commented 5 years ago

@Koenkk could you please add both variants of sensor name? 'TRADFRI ON/OFF Switch', 'TRADFRI on/off switch', because of my sensor called "TRADFRI on/off switch".

'{"click":"brightness_down","linkquality":105}'
'{"click":"brightness_stop","linkquality":105}'
'{"click":"brightness_up","linkquality":105}'
'{"click":"brightness_stop","linkquality":105}'
'{"click":"on","linkquality":105}'
'{"click":"off","linkquality":105}'

As for the rest, it began to work, thank you so much!

antti365 commented 5 years ago

Great job! It remains only to add the value of the battery ... :)

Attila-FIN commented 5 years ago

@vke , sorry that way my mistake. only the label printed on the box is with capital, the correct zigbee model ID is in fact NOT with capital letter, so the correct one is: 'TRADFRI on/off switch'

Koenkk commented 5 years ago

Updated https://github.com/Koenkk/zigbee-shepherd-converters/tree/E1743, please try.

If everything works, we can merge this.

vke commented 5 years ago

I see also that IKEA devices report their model (like E1743) and battery level both as percents and as voltage:

    Frame Control Field: Profile-wide (0x18)
        .... ..00 = Frame Type: Profile-wide (0x0)
        .... .0.. = Manufacturer Specific: False
        .... 1... = Direction: Server to Client
        ...1 .... = Disable Default Response: True
    Sequence Number: 99
    Command: Read Attributes Response (0x01)
    Status Record, Octets: 45:31:37:34:33
        Attribute: Unknown (0x000a)
        Status: Success (0x00)
        Data Type: Octet String (0x41)
        Octet String: 45:31:37:34:33
    Status Record, String: 
        Attribute: Unknown (0x000b)
        Status: Success (0x00)
        Data Type: Character String (0x42)
        String: 
    Status Record, String: 2.0.020
        Attribute: Software Build Id (0x4000)
        Status: Success (0x00)
        Data Type: Character String (0x42)
        String: 2.0.020
    Status Record, Uint16: 1
        Attribute: Unknown (0xfffd)
        Status: Success (0x00)
        Data Type: 16-Bit Unsigned Integer (0x21)
        Uint16: 1 (0x0001)
    Frame Control Field: Profile-wide (0x18)
        .... ..00 = Frame Type: Profile-wide (0x0)
        .... .0.. = Manufacturer Specific: False
        .... 1... = Direction: Server to Client
        ...1 .... = Disable Default Response: True
    Sequence Number: 166
    Command: Read Attributes Response (0x01)
    Status Record
        Attribute: Battery Voltage (0x0020)
        Status: Success (0x00)
        Data Type: 8-Bit Unsigned Integer (0x20)
        Measured Battery Voltage: 2.9 [V]
    Status Record
        Attribute: Battery Percentage Remaining (0x0021)
        Status: Success (0x00)
        Data Type: 8-Bit Unsigned Integer (0x20)
        Remaining Battery Percentage: 43.5 [%]
    Status Record, Uint16: 1
        Attribute: Unknown (0xfffd)
        Status: Success (0x00)
        Data Type: 16-Bit Unsigned Integer (0x21)
        Uint16: 1 (0x0001)
vke commented 5 years ago

Oh, 1-minute late, thanks, I will test right now

Koenkk commented 5 years ago

@vke If you want to do a quick sanity check, change https://koenkk.github.io/zigbee2mqtt/configuration/configuration.html repInterval.MAX to 3 (it should report every 3 seconds then).

vke commented 5 years ago

@Koenkk thank you very much! Everything is working as expected.

{"battery":87,"linkquality":110,"click":"on"}
{"battery":87,"linkquality":107,"click":"off"}
{"battery":87,"linkquality":110,"click":"brightness_up"}
{"battery":87,"linkquality":110,"click":"brightness_down"}
{"battery":87,"linkquality":110,"click":"brightness_stop"}
Attila-FIN commented 5 years ago

Thanks @Koenkk for the explanations. I have tried the E1743 branch of the zigbee-shepherd-converters and the latest dev branch of zigbee2mqtt. I reset the remote and re-paired with zigbee2mqtt. Commands are coming and translated to MQTT well, however I still see the strange "brightness":255. I must do something wrong. After restarting zigbee2mqtt , there were also unhandled 'genPowerCfg' messages coming for the first few button presses with strange batteryPercentageRemaining values:

  zigbee2mqtt:info 2019-2-10 00:10:37 MQTT publish: topic 'zigbee2mqtt/IKEA_ONOFF_Switch_01', payload '{"battery":47,"linkquality":94,"brightness":255,"click":"off"}'
  zigbee2mqtt:info 2019-2-10 00:10:40 MQTT publish: topic 'zigbee2mqtt/IKEA_ONOFF_Switch_01', payload '{"battery":21,"linkquality":94,"brightness":255}'
  zigbee2mqtt:warn 2019-2-10 00:10:40 No converter available for 'E1743' with cid 'genPowerCfg', type 'devChange' and data '{"cid":"genPowerCfg","data":{"batteryPercentageRemaining":21}}'
  zigbee2mqtt:warn 2019-2-10 00:10:40 Please see: https://koenkk.github.io/zigbee2mqtt/how_tos/how_to_support_new_devices.html.
  zigbee2mqtt:info 2019-2-10 00:10:40 MQTT publish: topic 'zigbee2mqtt/IKEA_ONOFF_Switch_01', payload '{"battery":21,"linkquality":94,"brightness":255,"click":"off"}'
  zigbee2mqtt:info 2019-2-10 00:10:44 MQTT publish: topic 'zigbee2mqtt/IKEA_ONOFF_Switch_01', payload '{"battery":47,"linkquality":76,"brightness":255}'
  zigbee2mqtt:warn 2019-2-10 00:10:44 No converter available for 'E1743' with cid 'genPowerCfg', type 'devChange' and data '{"cid":"genPowerCfg","data":{"batteryPercentageRemaining":47}}'
  zigbee2mqtt:warn 2019-2-10 00:10:44 Please see: https://koenkk.github.io/zigbee2mqtt/how_tos/how_to_support_new_devices.html.
  zigbee2mqtt:info 2019-2-10 00:10:44 MQTT publish: topic 'zigbee2mqtt/IKEA_ONOFF_Switch_01', payload '{"battery":47,"linkquality":78,"brightness":255,"click":"on"}'
  zigbee2mqtt:info 2019-2-10 00:10:46 MQTT publish: topic 'zigbee2mqtt/IKEA_ONOFF_Switch_01', payload '{"battery":60,"linkquality":70,"brightness":255}'
  zigbee2mqtt:warn 2019-2-10 00:10:46 No converter available for 'E1743' with cid 'genPowerCfg', type 'devChange' and data '{"cid":"genPowerCfg","data":{"batteryPercentageRemaining":60}}'
  zigbee2mqtt:warn 2019-2-10 00:10:46 Please see: https://koenkk.github.io/zigbee2mqtt/how_tos/how_to_support_new_devices.html.
  zigbee2mqtt:info 2019-2-10 00:10:46 MQTT publish: topic 'zigbee2mqtt/IKEA_ONOFF_Switch_01', payload '{"battery":60,"linkquality":76,"brightness":255,"click":"on"}'
  zigbee2mqtt:info 2019-2-10 00:10:47 MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"devices","message":[{"ieeeAddr":"0x000d6ffffeb2bb92","type":"EndDevice","model":"E1743","friendly_name":"IKEA_ONOFF_Switch_01"}]}'
  zigbee2mqtt:info 2019-2-10 00:10:47 MQTT publish: topic 'zigbee2mqtt/IKEA_ONOFF_Switch_01', payload '{"battery":47,"linkquality":94,"brightness":255}'
  zigbee2mqtt:warn 2019-2-10 00:10:47 No converter available for 'E1743' with cid 'genPowerCfg', type 'devChange' and data '{"cid":"genPowerCfg","data":{"batteryPercentageRemaining":47}}'
  zigbee2mqtt:warn 2019-2-10 00:10:47 Please see: https://koenkk.github.io/zigbee2mqtt/how_tos/how_to_support_new_devices.html.

Afterwards, the translated MQTT messages looked good (except the "brightness" part):

MQTT publish: topic 'zigbee2mqtt/IKEA_ONOFF_Switch_01', payload '{"battery":47,"linkquality":92,"brightness":255,"click":"off"}'
MQTT publish: topic 'zigbee2mqtt/IKEA_ONOFF_Switch_01', payload '{"battery":47,"linkquality":99,"brightness":255,"click":"on"}'
MQTT publish: topic 'zigbee2mqtt/IKEA_ONOFF_Switch_01', payload '{"battery":47,"linkquality":89,"brightness":255,"click":"brightness_up"}'
MQTT publish: topic 'zigbee2mqtt/IKEA_ONOFF_Switch_01', payload '{"battery":47,"linkquality":92,"brightness":255,"click":"brightness_stop"}'
MQTT publish: topic 'zigbee2mqtt/IKEA_ONOFF_Switch_01', payload '{"battery":47,"linkquality":94,"brightness":255,"click":"brightness_down"}'
MQTT publish: topic 'zigbee2mqtt/IKEA_ONOFF_Switch_01', payload '{"battery":47,"linkquality":94,"brightness":255,"click":"brightness_stop"}'
Koenkk commented 5 years ago
Curtisjk commented 5 years ago

Thanks for this - I look forward to using it when I finally get my hands on one of the kits!

Attila-FIN commented 5 years ago

@Koenkk , thanks! That was really my problem in the data/state.json file. I perhaps had that state stored there while playing with different converters. I removed the entry of the remote and now the correct messages are published. Also unhandled 'genPowerCfg' messages are gone now. It is really nice to have the battery level reported in every MQTT message, perhaps that cold be also implemented for the 5 button E1524 remote too, but that is off topic.

vke commented 5 years ago

@Attila-FIN @Koenkk yes, E1524 remote is working exactly as this E1743 with battery. Just tried.

Koenkk commented 5 years ago

Merged! will be supported in the dev branch within a few hours. Thanks all for helping!

patriot1889 commented 5 years ago

I feel like the long press clicks are the wrong way around?

"brightness_up" is called when holding down the off button. "brightness_down" is called when holding the on button.

Surely it should be the other way around? Or is this based on information actually coming from the device?

EDIT: Just noticed that the off button is at the top, so it kind of makes sense for it to be the brightness up button. I might mount mine upside down and use "brightness_down" as up.

EDIT2: I seem to keep getting the following error: PM Failed to configure 0xd0cf5efffed6e27b (0xd0cf5efffed6e27b) ('Error: Timed out after 10000 ms') (attempt #1)

EDIT3: All sorted now. However, the button physically sticks when pressed “on”. Which is very unfortunate. Looks like I will have to get a replacement.

patriot1889 commented 5 years ago

Ok. I thought everything was fine and dandy but I keep getting the following errors; PM Failed to configure IkeaSwitch1 (0xd0cf5efffed6ef5c) ('Error: Timed out after 10000 ms') (attempt #1)

I fixed it by removing the battery and re-inserting. Then the button works again. Maybe it went to sleep? I will keep an eye on it.

Any thoughts?

KidFoxXL commented 5 years ago

I tried to connect the button but I can't get it to work. I noticed, that not every button click is recognized and there is no long press click. The MQTT payload has no "click" message. Mar 06 19:35:44 openHABianPi npm[505]: zigbee2mqtt:info 3/6/2019, 7:35:44 PM MQTT publish: topic 'zigbee2mqtt/0x000d6ffffed16ff8', payload '{"battery":100,"linkquality":42}'

Am I doing something wrong?

cedricous commented 5 years ago

Same for me, the MQTT payload has no "click" message. I use the edge version of the zigbee2mqtt on the Hass.io, put the parameter "zigbee_shepherd_devices": true, and put the devices.js from the zigbee-shepherd-converters github in the share/zigbee2mqtt directory. Maybe I forgot something ?

cedricous commented 5 years ago

In fact the mqtt message is received only one time after the button is paired, after that even if I click on the button nothing appeard : Here the log of the paired

zigbee2mqtt:info 3/8/2019, 4:54:57 PM MQTT publish: topic 'zigbee2mqtt/bridge/config', payload '{"log_level":"info","permit_join":true}' zigbee2mqtt:info 3/8/2019, 4:55:32 PM New device 'undefined' with address 0x000d6ffffe2f1753 connected! zigbee2mqtt:info 3/8/2019, 4:55:32 PM MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"device_connected","message":"0x000d6ffffe2f1753","meta":{}}' zigbee2mqtt:warn 3/8/2019, 4:55:32 PM Device with modelID 'undefined' is not supported. zigbee2mqtt:warn 3/8/2019, 4:55:32 PM Please see: https://www.zigbee2mqtt.io/how_tos/how_to_support_new_devices.html zigbee2mqtt:warn 3/8/2019, 4:55:33 PM Failed to configure 0x000d6ffffe2ce7ca (0x000d6ffffe2ce7ca) ('Error: Timed out after 10000 ms') (attempt #1) zigbee2mqtt:warn 3/8/2019, 4:55:33 PM This can be ignored if the device is working properly zigbee2mqtt:info 3/8/2019, 4:55:35 PM MQTT publish: topic 'homeassistant/sensor/0x000d6ffffe2f1753/click/config', payload '{"icon":"mdi:toggle-switch","value_template":"{{ value_json.click }}","expire_after":1,"state_topic":"zigbee2mqtt/0x000d6ffffe2f1753","json_attributes_topic":"zigbee2mqtt/0x000d6ffffe2f1753","name":"0x000d6ffffe2f1753_click","unique_id":"0x000d6ffffe2f1753_click_zigbee2mqtt","device":{"identifiers":"zigbee2mqtt_0x000d6ffffe2f1753","name":"0x000d6ffffe2f1753","sw_version":"Zigbee2mqtt 1.1.1","model":"TRADFRI ON/OFF switch (E1743)","manufacturer":"IKEA"},"availability_topic":"zigbee2mqtt/bridge/state"}' zigbee2mqtt:info 3/8/2019, 4:55:35 PM MQTT publish: topic 'homeassistant/sensor/0x000d6ffffe2f1753/battery/config', payload '{"unit_of_measurement":"%","device_class":"battery","value_template":"{{ value_json.battery }}","state_topic":"zigbee2mqtt/0x000d6ffffe2f1753","json_attributes_topic":"zigbee2mqtt/0x000d6ffffe2f1753","name":"0x000d6ffffe2f1753_battery","unique_id":"0x000d6ffffe2f1753_battery_zigbee2mqtt","device":{"identifiers":"zigbee2mqtt_0x000d6ffffe2f1753","name":"0x000d6ffffe2f1753","sw_version":"Zigbee2mqtt 1.1.1","model":"TRADFRI ON/OFF switch (E1743)","manufacturer":"IKEA"},"availability_topic":"zigbee2mqtt/bridge/state"}' zigbee2mqtt:info 3/8/2019, 4:55:35 PM MQTT publish: topic 'homeassistant/sensor/0x000d6ffffe2f1753/linkquality/config', payload '{"unit_of_measurement":"-","value_template":"{{ value_json.linkquality }}","state_topic":"zigbee2mqtt/0x000d6ffffe2f1753","json_attributes_topic":"zigbee2mqtt/0x000d6ffffe2f1753","name":"0x000d6ffffe2f1753_linkquality","unique_id":"0x000d6ffffe2f1753_linkquality_zigbee2mqtt","device":{"identifiers":"zigbee2mqtt_0x000d6ffffe2f1753","name":"0x000d6ffffe2f1753","sw_version":"Zigbee2mqtt 1.1.1","model":"TRADFRI ON/OFF switch (E1743)","manufacturer":"IKEA"},"availability_topic":"zigbee2mqtt/bridge/state"}' zigbee2mqtt:info 3/8/2019, 4:55:45 PM MQTT publish: topic 'zigbee2mqtt/0x000d6ffffe2f1753', payload '{"battery":100,"linkquality":128}' zigbee2mqtt:warn 3/8/2019, 4:56:01 PM Failed to configure 0x000d6ffffe2f1753 (0x000d6ffffe2f1753) ('Error: AF data request fails, status code: 240. MAC transaction expired.') (attempt #1) zigbee2mqtt:warn 3/8/2019, 4:56:01 PM This can be ignored if the device is working properly zigbee2mqtt:info 3/8/2019, 4:56:05 PM Device incoming... zigbee2mqtt:info 3/8/2019, 4:56:05 PM MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"pairing","message":"device incoming"}' zigbee2mqtt:info 3/8/2019, 4:56:12 PM Successfully configured 0x000d6ffffe2f1753 (0x000d6ffffe2f1753) zigbee2mqtt:info 3/8/2019, 4:56:29 PM MQTT publish: topic 'zigbee2mqtt/0x000d6ffffe2f1753', payload '{"battery":60,"linkquality":120}'