[APP] Aqara & Xiaomi Smart Home - A different kind of Smart Home solution (Zigbee App)

Yes, just ignore that, you can not hide it, otherwise you have to use a device with only one relay.

Is it possible to add a H1 switch in high speed mode? Now all my switches are ā€˜the oldā€™ 2018 models and are very slow. I like te upgrade, but itā€™s not very cheap :confused:

Bummer. I was asking because the exact same trick is possible with Fibaro z-wave relays. Thanks for replying!

1 Like

Version 1.7.0 has just been released to the test environment of the app store.

Changelog for v1.7.0:

Add support for:

  • Curtain Driver E1, ZNCLBL01LM (including auto calibration maintenance action)
  • Roller Shade Motor, ZNGZDJ11LM

New features for:

  • Roller Shade Driver E1, ZNJLBL01LM
    • Add flow card to set curtain operating speed by flow
    • Add retry loop sending command to the Roller Shade Driver E1, in case device was sleeping
  • Most of the plug and switch devices
    • Add setting to enable saving the power state

Fixes for

  • Motion Sensor P1, MS-S02
    • Fix settings not being send to the device
    • Fix luminance reporting in the dark
  • Xiaomi Light Sensor, GZCGQ01LM
    • Likely fix for battery reporting (not reproduced)

The test version can be installed by using above link.
General release to the app store will in about a week time.

8 Likes

I received this update a few hours ago, after the update none of my sensors where reponding anymore
In the app itself they are ā€˜onlineā€™ but no motion is detected, a app restart did not work

I had to completely reboot my homey to get it to work again.

Sadly nowadays a reboot takes between the 10 and 30 minutes to fully complete the start of all the apps installed. Also after it is finished a lot of app do not work and need a manual restart to get it to work again.

Maybe just a glitch, hopefully, it was working fine for me after update, just testing the changesā€¦also rebooted Homey completely due to the fw upgrade and itā€™s also fine ā€¦so letā€™s hope itā€™s one time issue only (70+ Zigbee devices hereā€¦)

Even this is not related to Aqara app, on latest fw RC I see the same behaviorā€¦

Thank you for this great update. :clap:

Hm, I have been almost thinking by Zigbee network is way too utilized because I saw sometimes device not updating itā€™s state, looking forward if this improves it anyhow. :+1:

Actually I though it doesnā€™t work still, they I read your note :

I was hoping when device actually update itā€™s state itā€™s not sleeping but finally pressing the button worked and LED Blink is gone and I can confirm it report darkness (0lx) as well :wink:

Will report back, thank you ! (even it wasnā€™t the only device impacted by this fluctuations as I wrote above but Light sensor was the most annoying one :wink: ).

Hey Ted, thanks for all the hard work that you put in all these years!

Hi, itā€™s still the same unfortunately for GZCGQ01LMā€¦ it oscillates the same way as before, between 0% and 33%

obrazek

This year view :


(yes the sensor is outside but as you can see, now with 14C outside still no change)

I wish some other sensor updating their battery state better, like Honeywell Smoke sensors JTYJ-GD-01LM/BW, Aqara Leak sensors SJCGQ11LM etc. Eg. Contact sensors MCCGQ11LM, Motion RTCGQ11LM, Vibration DJT11LM and Temperature sensors WSDCGQ11LM and even buttons like WXKG11LM / WXKG12LM reports their values nicely. But I guess if there would be easy fix, you would have found them for last 3 years.

Also today I noticed that some of the E1 ZNJLBL01LM cards got broken for motor state BLOCKEDā€¦

obrazek

No big deal, replaced by MOTOR ALARM but eg. Flow checker even didnā€™t notice anything wrong.
Also updating the position somehow is not working reliably but this could be already problem of my ZigBee network itself (curtains are closed while the driver shows them open).

Sent you diag, if you see anything relevant - 5275e514-443c-4282-8b63-93045c44e655.

Any update on if/when the Aqara Smart Wall Switch E1 is likely to be supported on the app?

TIA

FYI @TedTolboom ā€¦the battery alerts are incoming twice

Whow Ted, what a major announcement!
This is great for us all!

I guess this will help you alot too! I was often worried this would get too big for one dev.

Letā€™s not forget youā€™ve made their brand big on Homey! Thanks for all the hard work. Everyone can see by the amount of devices, requests and other questions that this wasnā€™t a easy job.

To celebrate this announcement Iā€™ve donated some beers! :beers:

I hope it will be a great teamwork!

Regards David

1 Like

Nothing new. Mentioned already in this post.

Meanwhile, I think that the Xiaomi Light Sensor ā€œlow on batteryā€ notifications have something to do with low (outdoor) temperature. Since the (outdoor) temperatures are higher, I no longer get ā€œlow on batteryā€ notifications. So it seems to be a hardware behavior of the Xiaomi Light Sensor, which probably canā€™t be influenced by Ted.
But of course, double notifications should not occur.

Never happened to me before, so itā€™s new for me after installing the latest version. I believe, if anyone reading those inputs, any experience is relevant, when shared.

Could be the case, but as my sensor constantly report 33% for last 3 months and then suddenly fluctuates to 0%, while itā€™s actually NOT the lowest temp outside, I donā€™t think itā€™s the case for me. Also I have several temp. sensors outside (I mean not in tempered areas) and those behaves just fine, I mean they lower the battery SOC but not to 0% but eg. from 70% to 63% while that battery is even quite old (several months) etc. But naturally low temp. can for sure influence battery capacity, thatā€™s clear - however it didnā€™t happen ever before prior to implementation of new voltage/battery measurements.

Take a look on the example :

  • while it was outside 13C, Xiaomi Light sensor jumped to 0% SOC - and when the temp. dropped to 10C, light sensor reports 100% SOCā€¦ and nope, I didnā€™t change the battery just now.

The code for battery level seems to be quite simple though: every time the device sends a ā€œlifelineā€ attribute, which contains the battery voltage, the app converts that voltage to a percentage and sets the measure_battery capability.

It doesnā€™t invent values, it doesnā€™t report values out of itself, itā€™s all based on what the device reports.

Are you sure Robert ? Iā€™m for sure not an expert so I could be absolutely wrong but looking here : https://github.com/TedTolboom/com.xiaomi-mi-zigbee/commit/605f5e60ea96d4d13ff512b6e97c597488501d3d

const parsedBatPct = util.calculateBatteryPercentage(batteryVoltage * 100, ā€˜3V_2850_3000ā€™);

Previously option was 3V_2100 ā€¦ what is interesting, I see that this ā€œbatteryā€ option is used also in case of MCCGQ11LM but it has different battery then GZCGQ01LM - itā€™s CR1632 vs CR2450, seems though itā€™s the same initial and end voltage 2V ā€¦

(on continuous discharge at 20Ā°C under 7.5kā„¦ load to 2.0V end-voltage)

The function TED probably created is :

function calculateBatteryPercentage(voltage, option) {
  let percentage = null;
  if (option === '3V_2100') {
    if (voltage < 2100) {
      percentage = 0;
    } else if (voltage < 2440) {
      percentage = 6 - ((2440 - voltage) * 6) / 340;
    } else if (voltage < 2740) {
      percentage = 18 - ((2740 - voltage) * 12) / 300;
    } else if (voltage < 2900) {
      percentage = 42 - ((2900 - voltage) * 24) / 160;
    } else if (voltage < 3000) {
      percentage = 100 - ((3000 - voltage) * 58) / 100;
    } else if (voltage >= 3000) {
      percentage = 100;
    }
    percentage = Math.round(percentage);
  } else if (option === '3V_2500') {
    percentage = toPercentage(voltage, 2500, 3000);
  } else if (option === '3V_2500_3200') {
    percentage = toPercentage(voltage, 2500, 3200);
  } else if (option === '3V_1500_2800') {
    percentage = 235 - 370000 / (voltage + 1);
    if (percentage > 100) {
      percentage = 100;
    } else if (percentage < 0) {
      percentage = 0;
    }
    percentage = Math.round(percentage);
  } else if (option === '3V_2850_3000') {
    percentage = toPercentage(voltage, 2850, 3000);
  } else if (option === '4LR6AA1_5v') {
    percentage = toPercentage(voltage, 3000, 4200);
  } else if (option === '3V_add 1V') {
    voltage += 1000;
    percentage = toPercentage(voltage, 3200, 4200);
  } else if (option === 'Add_1V_42V_CSM300z2v2') {
    voltage += 1000;
    percentage = toPercentage(voltage, 2900, 4100);
  } else {
    throw new Error(`Not batteryVoltageToPercentage type supported: ${option}`);
  }

  return percentage;
}

function toPercentage(value, min, max) {
  if (value > max) {
    value = max;
  } else if (value < min) {
    value = min;
  }

  const normalised = (value - min) / (max - min);
  return Math.round(normalised * 100);
}

Does it means that in case of 3V_2850_3000 the min. is 2.85V, max 3.0V ? If so, then for CR1632 and CR2450 itā€™s wrong, 0% shall be <2V - but I have no idea what the sensor actually measure/reports.
Btw I have measured battery right now and it shows 2.77V , while reporting 33% (ā€¦and dropping to 0% as mentioned) - 2.77V shall be rather 77%ā€¦ ? I know that the discharge curve is not linear though.

Btw also on temperature influence @DirkG ā€¦ still itā€™s hard to believe and maybe itā€™s just ā€œpaperā€, they even specify battery operational temperature range quite large -30C-70C.

obrazek

Yes Iā€™m sure. Iā€™m not saying the calculation is correct, though :wink:

Iā€™ve taken a look at how zigbee2mqtt implements battery calculations for the different sensors:

  • WSDCGQ11LM: 3V_2850_3000 (same as Homey)
  • MCCGQ11LM: 3V_2850_3000 (same as Homey)
  • GZCGQ01LM: 3V_2850_3000 (same as Homey)

On the z2m Github, these calculations are a long-standing topic of discussion.

2 Likes

Why not place the sensor on the inside of a window?

Thanks Robert, I didnā€™t imagine itā€™s so complex and actually on Z2M they discuss it for 1.5 years, doing measurements, proposals, changing calculations ā€¦ and basically :

  • nobody knows how actually Xiaomi calculate batteries levels
  • there is disagreement on maximum and minimum voltage, as it differs per condition (manufacturer, temperature, nominal voltage deviations)
  • some messages says that Xiaomi also interpolate somehow with temperature, some say they use linear discharging characteristic
  • some suggested it might be indicative only as capacity measurement is much complex then just measuring voltage
  • they have tried several mathematical methods already, latest seems to be in general indeed linear - 3V_2850_3000 for those sensors being discussed

Basically on my example, if I measured 2.77V on CR2450, itā€™s taken as 0%, even sensor was still working fine with those levels possibly last 3 months while it was -20C outside but even +10C.

The solution would need to be much more complex (or trivial)

  • add option to disable battery SOC for misbehaving / outside sensors (Athom did it already for some IKEA switches)
  • showing battery voltage and use other apps eg. for calculating trends via flows - I guess itā€™s not possible to show battery voltage as value like in case of Z2M.
  • implement some switch indicating it shall interpolate battery voltage with outside temperature sensor / Athom temp. value (seems nobody developed a mathematical model for that even graphs / discharging characteristics exists)

Sometimes you simply canā€™t. Eg. because of not right window orientation, because of blinds/rollers etc.

1 Like