Pre-release of Fibaro Motion Sensor

Thanks! I’ll let you know if we need to take you up on that though we have a bunch around here as a result of our recent testing. I’ll pass that specific info to the engineer working on it.

@garyd9

Is there a way to wake the motion sensor to accept configuration change so it can double as an emergency light:

That’s certainly a problem, but I don’t see how failing to issue a batteryGet() would cause the bad 1% battery reports.

I didn’t dig deep into the thread, but being the fibaro motion sensor is battery operated, there usually isn’t much of a chance to RELIABLY send a command to it. It does wake up, of course, to send reports (motion detected, lux change, etc), but I found it was very hit or miss trying to send anything back (and have the device see the response…)

The only times I’ve been able to RELIABLY send config commands to the device has been in response to a wake up notification (and before the "wakeupNoMoreInformation() is sent) and when I manually force the device awake (by tapping the button 3 times and saying “there’s no place like home”)

So, in response to motion, I don’t think there’s a good way to send config commands to the device.

Take care
Gary

1 Like

I’ve never seen the 1% thing, but have always just assumed it was the result of high drain at the current (no pun intended) moment (as what I’ve read indicates that the percentage tends to pop back up later) or due to cold or hot batteries.

After making the changes, I see the woke up command in the logs but still no battery polling and it has not changed from 100%.

If the battery is being reported as being at the same level as currently stored, it won’t show anything.

The method that handles the battery report starts something like this:

def zwaveEvent(physicalgraph.zwave.commands.batteryv1.BatteryReport cmd) {

(Just search for “BatteryReport”)

You can go to the bottom of that function (it’s only a few lines long) and you’ll see a line that looks like:

map.displayed = false

You can change that line to set displayed to ‘true’ AND add another line so it shows in the activity stream even if it hasn’t changed. Then, the last few lines of the function (before the closing swirly brace) should appear as:

	map.displayed = true
	map.isStateChange = true
	createEvent(map)

Oh, let me pull the github code (again) so I can post the entire method…

Okay, here’s it is in the entirety:

def zwaveEvent(physicalgraph.zwave.commands.batteryv1.BatteryReport cmd) {
log.debug cmd
	def map = [:]
	map.name = "battery"
	map.value = cmd.batteryLevel > 0 ? cmd.batteryLevel.toString() : 1
	map.unit = "%"
	map.displayed = true	// show it in the activity stream
	map.isStateChange = true	// show it even if it hasn't changed
	map
}

Do I need createEvent(map)?? You said above at first I did, and then in your paste, it’s not there.

map.displayed = true	// show it in the activity stream
map.isStateChange = true	// show it even if it hasn't changed

Check this out @tyler on my activities page…yesterday evening… Now it has reverted back to 92%. Unfortunately didn’t take a screenshot then.

In the version based on the github source, you don’t. In that version, it returns “map” and then parse() creates the event.

(My local copy of the device type is somewhat modified… in my local copy, I create the events in the individual zwaveEvent() methods and return the created event… sorry for the confusion.)

I tried both, and neither seem to work. Sounds like there is very little success pulling accurate battery % from the Fibaro’s.

Even I think battery % is not correct… It has never budged from what it was from day one till the time I got the 1% and now back to 92% on one of them. The rest still show 100%.(4 of these).

BTW: I am using @wackware’s latest code except for the modification “today”.

Working on it. I will post status later.

Twack

2 Likes

Mr. @wackware! This is the reason we love you so much no matter what we say behind your back on these threads when you are busy creating a new world! :wink:

“It doesn’t work” isn’t helpful. What makes you think it isn’t working? If the battery percentage isn’t going down, it doesn’t mean it’s not working… it could mean that the battery percentage reported by the device is inaccurate (or measured differently than expected.)

What I’m curious about is if, after running for 2 hours with the batteryReport code change, if anything is showing up in the activity stream. If not, try adding a descriptionText to the map. Before “map.displayed = true”, try inserting something like this:

map.descriptionText = "Hello? Anyone home?" (and then wait another two hours.)
You might also consider going into the ide, the my devices page, selecting the motion sensor, and then choose to display events. See if there’s a battery event in there in the past 2 hours.

(BTW, half my problem in trying to help out here is that I’m doing this from work - while staring at code completely unrelated to ST, etc…)

Okay, home now. @Mbhforum, did you get a chance to look at the device’s event history? I’m not sure if a repeat value will show up there even with displayed and isStateChange set to true, but it’s worth looking at 2 hrs of history…

As an alternative, if you really want to figure this out, I can walk you through what you’d need to do to change the wake up interval to something short (like 5 minutes) and add a bunch of log debug statements so we can see exactly what’s going on. (However, it could simply be that the device is reporting 100% battery…)

For that matter, I can even give you a copy of what I’m using for the device type code and you can see if that makes any difference for you. (It might or might not. I know it works for me, but you might have a different firmware version.)

@garyd9 it did certainly woke up though after code change…look at the 4th entry… At least I have never seen that status before…but of course the right status of battery or not… We will have to wait and see…

@smart, do you also have the changed BatteryReport I suggested? If so, are you seeing anything at around the same timeframe in the ide, My Devices -> Basement Fibaro Motion Sensor -> List Events? It would show an event with “battery” in the name column.

If you do have the changed battery report, but don’t have the event I’m suggesting, can you add a descriptionText to the map returned in the battery report (as I suggest above) and see what happens in the next couple of hours?

@garyd9 will try my best if I can do it on a iPad . Both (missus and mine) our personal laptops are long dead… :frowning: blame my med. bills and obsession with this hobby… No kidding. Will monitor it at work tmrw. :frowning: sorry went little off topic here…

No problem. The IDE is a bit annoying to navigate from a mobile device, so I can COMPLETELY understand any difficulties.