Xiaomi Gateway Integration

for the square cam?

Could not find anything

if you do this in VLC with you can see the video?

Looks like issue no longer exist after I upgrade the xiaomi.py file.
Will have ti monitoring on it.

Hi,

First of all, you must be sure if camera support rtsp protocol to view image in vlc.

If camera firmware not support rtsp, you must find a custom firmware that permit this option, and then add in HA.

In my case i have it, but with other version of camera…

The ghost openings are not occuring atm, i still keep an eye on it and let the debugger run, hopefully i will see more information when it happens next time.

Mine we all happening really badly a few nights ago and seem to have come good ever since. No change in any versions either…

Can someone please hook me up with the door sensor version of this:

trigger:
    platform: event
    event_type: motion
    event_data:
        entity_id: binary_sensor.motion_sensor_158d000113702f

<3

Sorry for the spam, but has anyone looked into the battery life of the Xiaomi gear.

I’ve got the motion, switch, door, and temperature sensors and I read that the temp sensors will only last 1 month before needing replacement. Has anyone had to replace any batteries yet, and is it hard?

From the documentation:

  trigger:
    platform: event
    event_type: door_window_action
    event_data:
        entity_id: binary_sensor.door_window_sensor_158d000xxxxxc2
        action_type: open # open / close / no_close
1 Like

Its easy to replace battery. Just look at the photo in the manual. And i have been using for 3 months already with existing battery. Where did you read about that?

Finally found it again:

From the banggood site.

Okay great, glad they are easy to replace, they looked difficult to dismantle at a glance!

Yeah. Once you stick it to the wall, turning it will open up the sensor

Thanks @rave this worked a treat to get my doors showing up as opened / closed!!! so much easier to understand now!

Yeah thanks guys, I’ve copied this and used it for my motion sensors as well so that it’s given more meaning, even though they are already more intuitive with the ‘on’ and ‘off’.

Is the motion_action part currently supposed to work?

trigger:
  platform: event
  event_type: motion_action
  event_data:
      entity_id: binary_sensor.motion_sensor_158d000xxxxxc2
      action_type: motion

I never see any events fired. The “motion” events come in but with them I can’t distinguish between “motion” and “no motion”.

My motion sensor currently turns on a light and I’m trying to define a custom time period after which the light should turn off again when no motion is detected. Using the state is not working for me because it takes too long (60 secs) to go back to the state “no motion” and moreover it sometimes gets stuck in “motion” and my light is burning the whole night.

It’s just motion not motion_action and you don’t need the action_type at all (unless it’s changed again).

trigger:
 platform: event
  event_type: motion
  event_data:
      entity_id: binary_sensor.motion_sensor_158d000xxxxxc2

I use state ‘off’ and yes it takes 60 seconds but I believe that may be a limitation of the device. Remember these are extremely low powered sensors and probably not designed to operate like one powered by mains instead of a battery.

As for going all night you could put in another automation that is triggered hourly with multiple conditions, such as how long the light has been on or how long since motion was detected, but I’ve had no problems with using state ‘off’.

1 Like

Like @Artudst mentioned, you don’t need the action type because action type is not being sent in the event. If you put it there, it won’t match, hence the automation doesn’t get triggered. I think i could add the action type in the next iteration

Btw, Using event, the delay is 1 second. It is not configurable but i think it might make sense to make it an configurable option

There is no limitation on the device. In fact, the motion sensor sends an event whenever there’s motion. In my test, without setting a 1 second delay, my Pi and HA crash because it couldn’t handle that many concurrent motion event. There must be like 10 motion event sent in a second when i wave my hand in front of the sensor

The code I pasted in my last post was copied from the documentation on https://github.com/lazcad/homeassistant. If it is not working yet it should be removed.

I completely agree with your implementation ideas as I already had something set up like that but was unhappy with my light staying on at least 60 seconds. It just didn’t feel right to have a light on for 60 seconds just because I went into my storage room to get something.

Didn’t realize i put that there