Xiaomi Aqara stuff Works Natively

Works perfect!

This is also the solution for using the Aqara Door Magnet as security sensor. Change the device type from generic device/binary switch to urn:schemas-micasaverde-com:device:DoorSensor:1 and add a listener to the Status variable to convert to the Tripped variable.

1 Like

This is a general viable solution if you have a particular device (say a switch linked to a gate sensor) and want to treat it as a sensor in your scenes/code.

Did your Vera finish the configuring? Mine keeps being stuck at configuring and tries it over and over again. The temp and hum is reported fine although no battery level unfortunately.

No it is still trying to configure but since everything works just fine, it doesn’t bother me much. Have tried setting configured to 1 a few times but it jus reverts back after a little while.

Does the main device report the temp and hum, or did it create 2 separate sub-devices for temp and hum?

Once my 2 sub devices were created, I could stop the “trying to configure” by manually changing the Configured flag of the main device to 1 and reload the engine.

About the battery level, that will never work out of the box. You need to solve this by programming it yourself as described in a previous post by Therealdb

I have a door sensor working. It paired w/o problems.

I actually used it to modify a doorbell.
Each time the doorbell is activated, the sensor goes off.
A very easy mod using a small relay short-circuiting the sensor.

Aqara is cheap and works well, but the range (Zigbee?) is noticeably shorter than for other battery powered z-wave devices.

the range grows with the number of devices, thats how mesh networks works

Z-wave and Zigbee both use mesh networks.
I believe the difference is due to a higher carrier frequency for Zigbee and thus larger attenuation.
It may be the small battery or small antenna in the Aqara too.

Considering those devices are nearly working out of The box, i wonder way Vera is not adding a proper native support…

1 Like

Hey
Tried both xiaomi aqara and mijia temperature and door sensors.

The aqara works as reported here, the mijia (which are a little bit cheaper and has a rounded design) were somehow more difficult to pair with vera and the temperature sensor needed a manual configuration of the child devices although the automatically configured device reports both the temperature and the humidity (as the aqara sensor does)

I got the square Xiaomi Temp & Humidity sensor but its not configuring the device.

I tried first the normal Vera add device - generic Zigbee device. I hold the button down until the blue light flashes 3 times but nothing happens.

I then tried this URL

http://192.168.1.100:3480/data_request?id=lu_invoke

Select Zigbee Network and then OpenJoin (Duration)

This get me a bit further and it does then detect the device and I can see 3 new devices appear.

However it then says Device failed to configure and the 3 new devices vanish again.

OK think I have done it. On the parent device under Settings I change Automatically Configure to No and now the devices have remained and look like this

image

However after an engine reload and browser refresh the parent device then looks like this

image

In its variables I tried changing “Configured” from -1 to 1 but the red banner message remains.

I then reloaded the engine again and did another browser refresh and the red banner on the parent device has now gone. So think I am good at this point.

How do these temp sensors poll and update?

My thermostat temp sensor says the room is 19 degrees

This Xiaomi temp sensor says its 24.78 degrees. And I’m not sure I’ve seen it change values yet.

So what are you guys doing with the parent device the Generic IO one with the On / Off buttons ?

Are you just hiding it from the UI7 GUI ?

You can do this by adding this line to the startup LUA code.

Apps -> Develop Apps -> Edit Startup LUA code

luup.attr_set(“invisible”,“1”, 387)

Where 387 is the Vera device ID number of your own parent device.

@richie.digital

I see you linked to a post I made about the Z-Wave Heiman HD1DS-Z Door sensor.

So I understand what I did there with that device.

However this is my very first Zigbee device and I know nothing about manually configuring Zigbee devices. Can you explain what that code does that you posted ?

For example with this Xiaomi temp / humidity device I am wondering if I could make the parent device in to one of the child devices i.e turn the parent device in to say the temp sensor and then hide or delete the child temp sensor device.

Leaving you with the primary device then being the temp sensor and then only having one child device the humidity sensor for example.

Also did anyone get the battery level to appear in the GUI ?

Thanks

turnes the main endpoint into the temp sensor and and delete the second endponint so now the generic Zigbee device become the temp sensor

1 Like

As I thought then. Thanks

These values have not changed or been updated at all however, they are exactly the same as yesterday.

EDIT: Just had the thing under a hot hair dyer for 30 seconds and its not changed temp. Something clearly not working.

The LastWakeup time is showing as yesterday:

Date stamp 1568836323 = 09/18/2019 @ 7:52pm (UTC)

The LastPolled time is showing as today:

Date stamp 1568916734 = 09/19/2019 @ 6:12pm (UTC)

 local devnum =387
    local endpoint =0402
    luup.attr_set ("device_json","D_TemperatureSensor1.json",devnum)
    luup.attr_set ("device_file","D_TemperatureSensor1.xml", devnum)
    luup.attr_set ("device_type","urn:schemas-micasaverde-com:device:TemperatureSensor:1", devnum)
    luup.attr_set ("category_num","17", devnum)
    luup.attr_set ("subcategory_num","0", devnum)
    luup.attr_set ("no_child_sync","0", endpoint)
    luup.attr_set ("altid","84b50402", endpoint)
    luup.attr_set ("id_parent","244", endpoint)
    luup.variable_set("urn:micasaverde-com:serviceId:ZWaveDevice1", "NoChildren", "1", devnum)
    luup.variable_set("urn:micasaverde-com:serviceId:HaDevice1", "ChildrenSameRoom", "0", devnum)
    luup.call_action("urn:micasaverde-com:serviceId:HomeAutomationGateway1", "Reload", {}, 0)

Does this look correct ?

Device ID 387 is the main endpoint e.g the “Generic Zigbee Device” with the On / Off buttons.

0402 is the end point of a temperature sensor

Category 17, Subcategory 0 is for a temperature sensor

These two lines I am not so sure about

luup.attr_set ("altid","84b50402", endpoint)
luup.attr_set ("id_parent","244", endpoint)

84b50402 is the altid of the current child endpoint named “Temperature Sensor”

244 is the parent ID of the main endpoint device e.g. the “Generic Zigbee Device” with the On / Off buttons

Also seems Zigbee devices are not listed when you do this:

If I search for the device numbers of these Zigbee devices they are not present in the generated device list.

These are the ID of the devices if I look at each of them in the UI7 GUI.

244 Not sure where this came from ? 244 is the parent of 387

387 - Generic Zigbee Device

388 - Temperature sensor child device

389 - Humidity sensor child device

EDIT: 244 is the number for the Zigbee Network when issuing this command:

http://VERA-IP:3480/data_request?id=lu_invoke

image

Yours was number 189 in your screen shots above.

So I’ve recently also tried the motion sensor of Aqara. Of course again it was a bit of a hassle. Include, delete, retry, etc.
But in the end, it configured (status 1)! But now I’m stuck at a new issue. As you can see in the screenshot, there seems to be no cluster for configuring a motion sensor. As I understand, it should be 0500, but it’s not there. I assume this results in not creating a “tripped” variable.
Anyone any ideas? Or already successfully added?

did it create a child device?

No, it did not, so that seems also suspicious. As I understand it also measures light, so I would expect at least 1 child device

I’m considering resetting again. Or can I force to configure the child devices.

[edit] tried a second, other Aqara motion device; same result.

Hello All,

I am new to vera (veraplus), for what I see some people succeeded in making mi door sensor work, but I did not really get how?
Up until now
1- I have added the door sensor as a generic zigbe device
2- change the device type, device file device_json to the DoorSensor1

Sensor appears in my device list but:
1- I can’t see the Icon changing when it is open
2- I tried a scene where I get notified if door is open, but it is not working (the scen by itself run and I get an alert).
=> for that I read in another post that I should referecnce the parent device (#2 in my case) rather than the child (#20 in my case) but I don’t know how to do that as I don’t see any #2 device

Any step by step help would be welcome
Nicolas

© 2019 Vera Control Ltd., All Rights Reserved. Terms of Use | Privacy Policy