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
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’.
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
I have the same problem as Frank had:
This was the solution for Frank:
However, what should I do if my older Raspberry Pi does not have WiFi? Thanks in advance!
My pi is on LAN and gateway on Wifi and it works. By the way, can you try to configure the Interface option in configuration.yaml?
My Xiaomi kit arrived this week. My first attempt to set it up with the android app was a total disaster, but reset everything and the second time it went fine.
I couldn’t connect at all with hass unless I put my sid and key into hass config, even though I have one only gateway. Anyway, that wasn’t hard.
So sitting here and pushing the button, playing with the door sensor and turning a lamp on and off to impress the family, who just sigh and ask when it will be useful…
Good work rave and the other contributors. And I promise, I will make it useful.
But bear in mind this is a community that doesn’t generally lock it’s doors, why the hell I have door sensors is quite a debate!
@BarryHampants - I can confirm its the TP link routers causing issues.
Dusted off my old linksys N router from the attic and got it working even after HASS restarts.
NOTE TO ALL PEOPLE - TP-LINK ROUTERS = Xiaomi & HASS ISSUES!
You will need to power cylce to get it working with each reboot or use another wifi router.