Xiaomi Aqara stuff Works Natively

It likely does this during a reconfig upon luup reload. Try disabling auto configuration for this device to see if it stops it from changing the device type on its own.

I should have said that I had already tried turning off auto configuration as well as setting configured to 1, but it still renames itself to Generic ZigBee device.

This is odd. I have not had this problem on my non supported zigbee devices. Yours somehow says it is waiting for the device to wakeup to configure. It could be that I don’t have any battery operated zigbee devices so I don’t really know what that means. Did you try waking up the device?

based on my experience u have to move the endpoint to the main device and delete the child device

most of the manual configuring of stufff on vera … will have a gereric device as the main endpoint and the actual device and an endpoint that is what i have found

    local devnum = *Main Device Number*
    local endpoint = *Endpoint*
    luup.attr_set ("device_json","D_MotionSensorWithTamper1.json",devnum)
    luup.attr_set ("device_file","D_MotionSensor1.xml", devnum)
    luup.attr_set ("device_type","urn:schemas-micasaverde-com:device:MotionSensor:1", devnum)
    luup.attr_set ("category_num","4", devnum)
    luup.attr_set ("subcategory_num","3", devnum)
    luup.attr_set ("no_child_sync","0", endpoint)
    luup.attr_set ("altid","", endpoint)
    luup.attr_set ("id_parent","", 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)

: under settings uncheck embeded reload luup and now u can delete the child device

if anyone know the code to uncheck embeded and remove/delete a device then it could jut be one code

Unfortunately not. Probably because the battery is reported as “PowerSourceLevel” instead of “BatteryLevel”. I think you need to create custom device files to support that field.

If it is only for monitoring, you can maybe use luup.variable_watch to monitor the battery level field and trigger some alarm if it goes under a certain level.

copy it with a watch to another variable is safe. something like this should be enough for Vera to show the icon:

function updateBatteryInfo(dev_id, service, variable, oldValue, newValue)
	if tonumber(oldValue) ~= tonumber(newValue) then
		luup.variable_set("urn:micasaverde-com:serviceId:HaDevice1", "BatteryLevel", newValue, dev_id)
	end
end

luup.variable_watch("updateBatteryInfo", "urn:micasaverde-com:serviceId:ZigbeeDevice1", "PowerSourceLevel", dev_id)

dev_id is the device ID. Add to your startup code and you should be good.

1 Like

Ah, nice and elegant solution! Didn’t think of this yet, thx! Will implement it later.

BTW so far I’ve a working temp sensor and 2 working door sensors. I assume all other Aqara devices will work as well. Anyone can confirm or already tried other devices?

Did you make any progress with the Xiaomi temperature, humidity and atmospheric pressure device and your EU Vera Plus ?

Don’t think you were asking me, but I’ve got my EU Vera Plus working just fine with 2 temp/humidity sensors and 2 door sensors. See post above.

Great I might give some of these Zigbee devices a try then.

Thanks.

1 Like

These are the ones here right?

Yes, those are the ones!

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.