zigbee2mqtt icon indicating copy to clipboard operation
zigbee2mqtt copied to clipboard

Bticino living now smart

Open basic-steve opened this issue 6 years ago • 73 comments

Hi, In Italy there is this new product which is al lot promising from Bticino, especially if you want to retrofit a not so much old electrical system by adding neutral wires where is needed, instead of re-doing all new wiring.

https://catalogo.bticino.it/prbt/bticino/sistemi-per-edifici-residenziali/living-now/living-now-smart

The problem is that the app is limited and would be cool to integrate it inside home assistant.

Questions of a zigbee noob:

  • Any support for this devices is possible?
  • How they can be put them into pairing mode? On promotional videos it seems that their gateway is required. I bought this module https://catalogo.bticino.it/BTI-K4531C-IT, which is basically a relay and a load meter, and can be connected to zigbee network; tapping on it, shaking or pressing the button, hasn't triggered nothing on zigbee2mqtt, not a unsupported message even.

basic-steve avatar Dec 28 '19 10:12 basic-steve

Are you sure it's zigbee? I see two series on the site: living now and myhome. The myhome has some zigbee in the description. Living now hasn't. Living now has RF on the switch. I associate that with 433 Ghz switches.

nldroid avatar Dec 28 '19 13:12 nldroid

Are you sure it's zigbee? I see two series on the site: living now and myhome. The myhome has some zigbee in the description. Living now hasn't. Living now has RF on the switch. I associate that with 433 Ghz switches.

My home is an old system and runs on bus. The new one, living now smart is based on zigbee as they said.

basic-steve avatar Dec 28 '19 14:12 basic-steve

Here a simple demo of the system: https://www.youtube.com/watch?v=F8DhsWFWS4U. The guy connects all modules to the gateway without the app and touching any device, only by pressing an external button. Auto translations are not too broken, only for first couple minutes.

basic-steve avatar Dec 28 '19 15:12 basic-steve

I find it very hard to find any confirmation that it's Zigbee. I see some Zigbee mentions on their site but not in combination with "Living Now" The best thing you can do is to try to sniff the packages: https://www.zigbee2mqtt.io/how_tos/how_to_sniff_zigbee_traffic.html

nldroid avatar Dec 29 '19 19:12 nldroid

Hi, I can confirm it is Zigbee I have joined today a couple of K3004C to my network with really base configuration following https://www.zigbee2mqtt.io/how_tos/how_to_support_new_devices.html Since Bticino is part of Legrand group, see #2550 and #2399 work by @cemonneau.

keyita avatar Dec 30 '19 02:12 keyita

Hi, Thanks for your feedback, I never heard the name of the brand before but it's good to know the work should be compatible. Do they have other model id/names @keyita ? I could add that to my pushs and PR.

ceneau avatar Dec 30 '19 15:12 ceneau

Hi @cemonneau,

Thanks, that would be great and really nice by you! Since I am new with zigbee2mqtt, please correct me if I am not providing the right information:

I have paired the device by adding the new device as zigbeeModel: [' Light switch with neutral\u0000\u0000\u0000\u0000\u0000'], and onEvent: async (type, data, device) => { await legrand.pairing_security_event(type, data, device); }, My understanding is that this is the only attribute relevant for matching the device?

Maybe the following line from my database.db should be usefull too: {"id":12,"type":"Router","ieeeAddr":"0x000474##########","nwkAddr":######,"manufId":4129,"manufName":" Legrand\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000","powerSource":"Mains (single phase)","modelId":" Light switch with neutral\u0000\u0000\u0000\u0000\u0000","epList":[1],"endpoints":{"1":{"profId":260,"epId":1,"devId":256,"inClusterList":[0,3,6,4,5,15,64513],"outClusterList":[0,64513,25],"clusters":{"genBasic":{"attributes":{"modelId":" Light switch with neutral\u0000\u0000\u0000\u0000\u0000","manufacturerName":" Legrand\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000","powerSource":1,"zclVersion":2,"appVersion":0,"stackVersion":65,"hwVersion":1,"dateCode":" \u000020191002\u0000\u0000\u0000\u0000\u0000","swBuildId":"00b\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000 \u0002\u0000\u0001\u0000 \u0002\u0000\u0002\u0000!\u0012\u0000\u0000\u0000\u0000��\u0003\u0000\u0010\u0002\u0001\u0004\u0000\u0018\u0002\u0000��!"}},"genBinaryInput":{"attributes":{"presentValue":0}},"genIdentify":{"attributes":{"identifyTime":60}},"genOnOff":{"attributes":{"onOff":0}}},"binds":[{"cluster":3,"type":"endpoint","deviceIeeeAddress":"0x00124b00XXXXe028","endpointID":1},{"cluster":6,"type":"endpoint","deviceIeeeAddress":"0x00124b00XXXXe028","endpointID":1},{"cluster":15,"type":"endpoint","deviceIeeeAddress":"0x00124b00XXXXe028","endpointID":1}]}},"appVersion":0,"stackVersion":65,"hwVersion":1,"dateCode":" \u000020191002\u0000\u0000\u0000\u0000\u0000","swBuildId":"00b\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000 \u0002\u0000\u0001\u0000 \u0002\u0000\u0002\u0000!\u0012\u0000\u0000\u0000\u0000��\u0003\u0000\u0010\u0002\u0001\u0004\u0000\u0018\u0002\u0000��!","zclVersion":2,"interviewCompleted":true,"meta":{"configured":2},"lastSeen":1577673957321}

I am still playing around with toZigbee and fromZigbee configurations: It is a two way switch and I did not achieve yet a fully working configuration. product link: https://catalogo.bticino.it/app/webroot/low_res/491606_492825_LE10356AC.pdf https://catalogo.bticino.it/app/webroot/low_res/491606_492825_LE10356AC.pdf

the last part of the link "LE10356AC" seem familiar with some codes of the Céliane serie, but i think there are no 1-to-1 matches on models id.

keyita avatar Dec 31 '19 13:12 keyita

Hi @keyita I looked briefly at the PDFs and your code. The part I was refering to was

zigbeeModel: [' Light switch with neutral\u0000\u0000\u0000\u0000\u0000'],

so that's good. Have you tested to send commands ? What are the physical "buttons" are characteristics (rgb LED ? on/off ? ).

I think it's identical to the product "Dimmer switch w/o neutral" we have here in france/"raw" Legrand.

Could you test that code (please ensure you have the modification from https://github.com/Koenkk/zigbee-herdsman-converters/pull/829/files applied and replace the part by the one bellow). It should enable on/off commands, and LED control (mainly).

        zigbeeModel: [
            ' Dimmer switch w/o neutral\u0000\u0000\u0000\u0000\u0000',
            ' Light switch with neutral\u0000\u0000\u0000\u0000\u0000'
        ],
        model: '067771',
        vendor: 'Legrand',
        // led blink RED when battery is low
        description: 'Wired switch without neutral',
        supports: 'on, off',
        fromZigbee: [
            fz.identify,
            fz.on_off,
        ],
        toZigbee: [
            tz.on_off,
            tz.legrand_settingAlwaysEnableLed,
            tz.legrand_settingEnableLedIfOn,
            tz.legrand_settingEnableDimmer,
            tz.legrand_identify,
        ],
        meta: {configureKey: 2},
        configure: async (device, coordinatorEndpoint) => {
            const endpoint = device.getEndpoint(1);
            await bind(endpoint, coordinatorEndpoint, ['genIdentify', 'genOnOff', 'genLevelCtrl', 'genBinaryInput']);
        },
        onEvent: async (type, data, device) => {
            await legrand.pairing_security_event(type, data, device);
        },
    },

Please report back once you have tested and I will gladly add the zigbeeModel to my push

ceneau avatar Jan 01 '20 12:01 ceneau

EDIT: With the name I dont think your product support dimming. I have (yet) not tested that part that's why the code above should work even if the zigbeeModel I have should support it (but requires an OTA with the official gateway)

ceneau avatar Jan 01 '20 12:01 ceneau

Hi @cemonneau,

This was the complete code I added to devices.js in my really first attempt to send commands when I found your pushes some days ago, I did in fact copy your configuration from the dimmer switch, disabling dimmer part :

{
        zigbeeModel: [' Light switch with neutral\u0000\u0000\u0000\u0000\u0000'], // The model ID from: Device with modelID 'lumi.sens' is not supported.
        model: 'K3004C', // Vendor model number, look on the device for a model number
        vendor: 'BTicino', // Vendor of the device (only used for documentation and startup logging)
        description: 'Light switch with neutral', // Description of the device, copy from vendor site. (only used for documentation and startup logging)
        supports: 'on, off, led color', // Actions this device supports (only used for documentation)
        fromZigbee: [
            fz.identify,
            fz.on_off,
            //fz.state,
        ],
        toZigbee: [
            tz.on_off,
            tz.legrand_settingAlwaysEnableLed,
            tz.legrand_settingEnableLedIfOn,
            tz.legrand_identify,
        ],
        meta: {configureKey: 2},
        configure: async (device, coordinatorEndpoint) => {
            const endpoint = device.getEndpoint(1);
            await bind(endpoint, coordinatorEndpoint, ['genIdentify', 'genOnOff', 'genBinaryInput']);
        },
        onEvent: async (type, data, device) => {
            await legrand.pairing_security_event(type, data, device);
        },
    },

and configuration.yaml:

'0x0004740000XXXXXX':
  friendly_name: 'switchk'
  permanent_led: true

after restart the led from red turned to green, and blinked blu during actions):

So I think I have already tested that configuration.

info  2019-12-30 03:45:17: switchk (0x0004740000XXXXXX): K3004C - BTicino Light switch with neutral (Router)
info  2019-12-30 03:45:54: MQTT publish: topic 'zigbee2mqtt1/switchk', payload '{"linkquality":52,"state":"ON","action":"identify"}'
info  2019-12-30 03:45:54: MQTT publish: topic 'zigbee2mqtt1/switchk', payload '{"linkquality":34,"state":"OFF"}'

The device has a single command button that commutes the phase(L) between the 2 outputs (two-way-switch/va-et-vient) so one of the 2 output is always 'ON', and a little reset/paring button (not accessible when the cover is mounted/during normal operation) + LED. As you can see the device always reports back the state of OFF (but the light is ON)

I am now downloading the ZBOSS utilities to sniff some packets and try to understand what the devices is sending. I hope it sends the output active (1 or 2) and something usefull to understand if there is any watt consumption (means the connected light is on).

Looking at [https://www.legrand.fr/pro/catalogue/42556-version-celiane-with-netatmo/interrupteur-filaire-connecte-avec-option-variateur-celiane-with-netatmo-sans-neutre-5w-a-300w-compensateur-titane] video (paused at 2:07) looks also the 067771 has two outputs.

My setup is like the one described at https://www.legrand.fr/catalogue/interrupteur/interrupteur-ou-va-et-vient-simple-avec-plaque-mosaic-blanc video (from 0:26 ca).

Thanks, I am really appreciating your support.

keyita avatar Jan 01 '20 13:01 keyita

Really good feedback @keyita

Warning, long answer ^^

What are you using as coordinator ? (Cc2531?) And which version too (1.2 or 3.0). I'm collecting info on versions for the doc as some things seems to not work (or harder) on some versions/firmware. Can you test another channel too ? (Only 11 working on my side on all products I have). If you could test those 3 transformers too (even if it's not the primary use) tz.legrand_settingAlwaysEnableLed (led always on) tz.legrand_settingEnableLedIfOn (led on when using it : on shutter while its moving, on a switch when the power is on, that's what I found yet, feedback welcome on 2 way switches) tz.legrand_identify (send an action to the led : permanent during 4 seconds, blink 3 or 4 times, and the color too for the animation). Devices I have also have the reset button behind but nothing on Legrand manuals, had to try. Unmount is easy when you know how, I will probably make a video. Do you have the official gateway too and did you receive an OTA on your devices ? (Will be useful for the doc). I have it and some devices received one (I don't put everything on the test network) it once broke something, seems more stable with the 3.0 version (see some of the latest comment I made on the Legrand issue).

I don't have 2 way switches (only wireless ones on production) but looking at your logs the on/off state is reported (so endpoint 1 is used for the "main" state). The 2nd state might be on endpoint 2, but it may be required to subscribe to it too (don't know how even if I red most of the code). I'm not too used to 2 way on the electric side so I will have to check if you need help on that.

When you will have zboss, if you can push 1 second the reset button, check if it sends a permit join request or something similar. Some devices do that, others sends an identify.

Side question, do you have more devices ?

ceneau avatar Jan 01 '20 15:01 ceneau

Hi @cemonneau,

long question... long answer ^^

It seems I had a bad setup while repositioning my coordinator during testing, I added a 30cm usb cable and now everything is working as expected, out of the box

Both my K4003C are responding correctly to ON OFF commands and reports back correct state even when switching ON/OFF from non smart switches (two way wiring), no editing to your code needed for this, no additional endpoint needed.

So it really work! Thanks!

Led feedback: tz.legrand_settingAlwaysEnableLed (led always on): it does what described on your comment but the color is GREEN in my case, ON only if in pairing mode tz.legrand_settingEnableLedIfOn: On when power is On, perfect! color=BLUE tz.legrand_identify: I did manage to setup sniffing, so I added as comment the reported payload:

                const effects = {
                    'blink3': 0x00,     // reported as Blink, it does blink 3 times :), OK
                    'fixed': 0x01,      // reported as Breathe, OK
                    'blinkgreen': 0x02, // reported as Okay, it blinks 1 time green, OK
                    'blinkblue': 0x03,  // reported as Unknown, it blinks 5 times blue, OK
                };
                // only works for blink3 & fixed
                const colors = {
                    'default': 0x00,    // OK = Blue
                    'red': 0x01,        // OK
                    'green': 0x02,      // OK
                    'blue': 0x03,       // OK
                    'lightblue': 0x04,  // OK
                    'yellow': 0x05,     // half yellow half red
                    'pink': 0x06,       // NO fallback to 0
                    'white': 0x07,      // half white half red
                };

With an exception for pink, all is working (white and yellow work, but are really bad looking). On Living Now devices the reset button is easy to access: the device comes "naked", you have to mount the cover (sold separately). It sends a permit join request as you suggested, led turns green (with permit_join at false otherwise no noticeable).

ZigBee Device Profile, Permit Join Request
    Sequence Number: 152
    Duration: 180
    Significance: 1

Version info: 1.8.0-dev / docker Coordinator: CC2531 / Stack: 3.0 Channel: 11

MQTT publish: topic 'zigbee2mqtt1/bridge/config', payload '{"version":"1.8.0-dev","commit":"unknown","coordinator":{"type":"zStack30x","meta":{"transportrev":2,"product":2,"majorrel":2,"minorrel":7,"maintrel":2,"revision":20190425}},"log_level":"info","permit_join":false}'

I do not have the official gateway, most of my lights are controlled by shelly2.5,but since I have still some lights to cover in order to make them all smart I bought this device because it fits with no additional space needed and it extend the coverage of the zigbee network ( both on hallway ). So I did not recive any OTA, but if I am not wrong the database.db line (from my 2nd post) contains 20191002, and a swBuild

All other zigbee devices I own are sensor endopoints and a spare CC2531 as router ( now used as sniffer device, with those switches as router I will keep it as sniffer), but now I will probably buy some more from Bticino, to add some wireless switches. I have also tested and confirm working the following

zigbeeModel: [
            ' Dimmer switch w/o neutral\u0000\u0000\u0000\u0000\u0000',
            ' Light switch with neutral\u0000\u0000\u0000\u0000\u0000'
        ],

I wanted to set the led blue on always (I am not on battery and all my switches on hallway have led) , so I have added this converter that worked for me, led is blue:

legrand_settingEnableLedIfOff: {
        key: ['led_when_off'],
        convertSet: async (entity, key, value, meta) => {
            // enable or disable the LED (blue) also when light is OFF
            const enableLedIfOn = value === 'ON' || !!value;
            const payload = {3: {value: enableLedIfOn, type: 16}};
            await entity.write('manuSpecificLegrandDevices', payload, options.legrand);
        },
    },

I would really appreciate if you can include also this.

Thanks!

keyita avatar Jan 03 '20 09:01 keyita

@cemonneau, seems legrand_settingEnableLedIfOff works only if followed by a legrand_settingAlwaysEnableLed, now is always blue, turns green while pairing then blue again when pairing is off

keyita avatar Jan 03 '20 09:01 keyita

Hi @keyita

I will see to include what's need in my PR in the next few days. Regarding the LED, the color is supposed to be green when the network is in pairing mode, whatever config is set. "tz.legrand_settingAlwaysEnableLed" is supposed to set the LED in permanent blue when permit_join=false so legrand_settingEnableLedIfOff should not be added BUT tz.legrand_settingAlwaysEnableLed should work.

The problem is the written attribute is not the right one but Legrand/Netatmo seems to not be constant on their attribute values, I will see to add probably something like "tz.legrand_settingAlwaysEnableLed_1" and "tz.legrand_settingAlwaysEnableLed_3", feedback welcome @Koenkk on the nomenclature.

Other than that I think it's good, just needs to add that to my PR

ceneau avatar Jan 03 '20 11:01 ceneau

@keyita Could you add to your devices.js file the following part (for your device)

toZigbee: [
{
	key: ['legrandRawSettings'],
	convertSet: async (entity, key, value, meta) => {
		const options = {manufacturerCode: 0x1021, disableDefaultResponse: true};
		const payload = {};
		payload[value.attribute] = {value: value.value, type: value.type};
		await entity.write('manuSpecificLegrandDevices', payload, options);
	},
},
]

And then test with mqtt with payloads like

{"legrandRawSettings":{"attribute":0,"value":REPLACE_HERE,"type":16}}

It's a custom transformer I have to test setting attributes. Attribute is the attribue number
Value is the value we set
Type is the type we set (16 or 9 currently)
At the same time use zboss to look at the raws response and see which attribute reports ok or not & existing or wrong value type. If you can find the physical difference it would be great too, I would add the support (if you find more attributes). Currently you saw the LED attributes but the 0 is used on some devices to set (enable) the dimming (requires an OTA update on some). I dont think 2 way switches have dimming (or anything else), but well, we never know.

ceneau avatar Jan 03 '20 14:01 ceneau

Hi @cemonneau ,

tested legrandRawSettings, with attribute 0

Status Record
    Status: Unsupported Attribute (0x86)
    Attribute: 0x0000

I started by resetting one of the device and my bad, you were right with legrand_settingEnableLedIfOff there is no need of legrand_settingAlwaysEnableLed_3 your original legrand_settingAlwaysEnableLed works.

keyita avatar Jan 03 '20 20:01 keyita

@keyita setting fix will be in that PR https://github.com/Koenkk/zigbee-herdsman-converters/pull/891

ceneau avatar Jan 09 '20 21:01 ceneau

Hi guys, amazing work. Just a note, the correct model number he is referring to is K4003c and not K3004C. Looking forward to install a living now system with zigbee2mqtt! Thanks ;)

blackwiz4rd avatar Jan 14 '20 23:01 blackwiz4rd

is the right model? From supported devices the photo is K4531C! The K3004C do not exist.

ster1um avatar Jan 17 '20 23:01 ster1um

@blackwiz4rd @Koenkk - K4003C is the right model name, my typo. @ster1um you are right, the image on support is referring to the model of the OP (K4531C) I do not own that model, I own the K4003C (https://catalogo.bticino.it/BTI-K4003C-IT) I have joined the topic because there was a doubt regarding "bticino living now" being zigbee at all.

When you sniff packets with wireshark, Legrand is recognised as the manufacter: [Extended Source: Legrand_00:XX:XX:XX:XX (00:04:74:00:XX:XX:XX:XX)]

K4531C will be probably recognised when you join it as one of the legrand model codes already supported by @cemonneau, as he recently added:

         zigbeeModel: [
             ' Connected outlet\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000' +
             '\u0000\u0000\u0000\u0000\u0000',
         ],
         model: '067775',
         vendor: 'Legrand',
         description: 'Power socket with power consumption monitoring'

This should cover also the model in the OP, it would be nice if someone with K4531C can try. BR.

keyita avatar Jan 18 '20 13:01 keyita