Xiaomi Aqara stuff Works Natively

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

1 Like

I don’t think for the door sensor a child device was created. This information is probably for another aquaria device. The parent #2 is your Vera device.

Did the device configure successful? So Configured = 1 (in the device → advanced → variables tab)? and was Status attribute created?

Hi, would be possible to make it more understandable also for Vera n00b users :slightly_smiling_face:
So far I was able to pair humdity sensor to work ok.
Battery info would be really welcome to see somewhere.
Thanks in advance for any possible step by step guide.

I am of the same opinion.
For a beginner it is very difficult to implement.
I would also like to use Xiaomi sensors with Vera but I don’t know where to start.

yes, it took me a while to get it implemented correctly. It is very difficult since there is not official support for it but the first step is to get the device paired with the hub once paired thatn you work on manual configuration.

I can get the door sensor to add and it shows as genericIO, it switches from on to off when magnet removed or added.

The temp and humidity sensor i am having difficulty with.
Have added child but nothing is reporting.
Could someone post an image of the attributes and variable pages of a working configured sensor, as i think i may be missing some cluster variables. Cheers

@remcobu How do you add a listener to the Status?

I have currently 5 Temp sensors (the square ones, not the round ones). They are all working fine.

What, i think, helped is to keep single-pressing the button on the sensor every 1-2 seconds once the inclusion successfully starts (Vera detected the sensor) during the whole process up until the luup engine has restarted. I’ve read this tip somewhere, it seems the sensor goes to sleep too fast and won’t continue to configuration. By clicking the button it wakes up/keeps awake.

The sensor will automatically create the child devices. This seems like a better solution than manually adding the child devices.

Ps. I will add status listener code later this week when i have more time

2 Likes

Cheers for that. Seems that the round sensor will show variables of temp and humidity in variables but will not add child, either manually or by its self. I have had the round one for a year and a half so it was worth a try. I can still access the vars so half working.

I have tried editing therealdb code to update the Tripped var in the door sensor but with no luck.

Nice, that works as well. Im not familiar with “therealdb code”, whats that?

If you change the Param ‘ device_type’ to urn:schemas-micasaverde-com:device:DoorSensor:1

And the Param ‘device_file’ to D_DoorSensor1.xml

And the Param ‘device-json’ to D_DoorSensor1.json

The device will then show up as a door sensor instead of a generic device. Then you can arm the sensor and also use it in regular scenes for triggering when the Status changes.

Is this what you are looking for?

The code in post 37 above.

I have already updated the D_DoorSensor1 elements, and have the correct icon and armed updating.
The issue i have is i need to add a tripped variable and update it with the status var. This is so the sensor trips when armed can be used. I asked you as you mentioned a listener in post 43 above.

Ah oke, like this: (in the startup code)

function updateSecurityStatus(dev_id, service, variable, oldValue, newValue)
    if tonumber(oldValue) ~= tonumber(newValue) then
        luup.variable_set( "urn:micasaverde-com:serviceId:SecuritySensor1", "Tripped", newValue, dev_id)
    end
end
luup.variable_watch("updateSecurityStatus",  "urn:upnp-org:serviceId:SwitchPower1", "Status", <your_device_id>)
1 Like