Pre-release of Fibaro Motion Sensor

I bow to @wackware! You just knighted me, my lord! :wink:

There may be an official device type, Brian but that template is not available to you or me till atleast a few days back
 I am pretty sure its Sir Einstein’s device type that they made official.:.

He’s a tweaker, and you’re a twack’er?

@wackware - I just worry that we are setting a bad precedent with a ton of custom device types even after an official one is released. More work for ST support, more potential issues, missing out when the official device type is updated, etc, etc.

Perhaps precedent is a bit too strong of a term here, but I think you get my drift. There is such a thing as too much ability to customize! :smile:

1 Like

Very good points. It was a pre-release after all and I should bow-out to the official version and support it’s officialness.

OK, Twack will Wack out Fibaro Tweaker. (that was for @April)
Stay tuned :smiley:

1 Like

BTW, I was not trying to put more on your plate! It was just a general observation.

Feel free to twerk
er
tweak away. :smile:

Thanks TWack, Since everything is working great I didn’t want to take a chance of messing things up by switching the device type back to the pre-release (even though its probably the exact same) and then modifying the code. I agree with Brian that that method would be counter intuitive now that it is supported and automatically found in the app.

Update on Battery:

I spoke with the Fibaro Techie and here (below) is how the Motion determines and reports battery levels.

  1. When a new or old battery is inserted it is assumed to be 100% and is reported as 100%.
  2. If/when the voltage drops/changes from when it was inserted, it is then calculated and reported on next wakeup (2.9v = 90%) .
  3. The sensor was designed for 3.0v battery. If 3.6v battery is used, no battery level, other than 100% is reported until voltage is less than 3.0v.
  4. Anything below 2.6v is considered and reported as 0%.
  5. The 123A batteries have a steep usage/drain curve due to their chemistry. They will show at 3.0v for a long time then drop off steeply during continued usage/drain.

So the battery issue appears to be a “non-issue”. We just needed to understand the device methodology.

Hope this helps,
Twack

5 Likes

I’ve been using several fibaro motion sensors now (all with conditional motion on/off app) and have run into some issues. I don’t know if this is a sensor issue or an app issue so some guidance would be appreciated.

The sensors are great insofar as they pretty reliably detect motion. The conditional motion on/off app is also pretty good about turning on the lights when they are initially triggered by the motion sensor.

Here is the problem:

In some rooms, the conditional motion app is set to turn off lights if no motion is detected after 10 of minutes. If I am in a room, the lights will turn on as intended, but, quite frequently, the lights will turn off after ten minutes even if I in the room moving around. It is as if the sensor stops detecting motion (even if I am moving) or the app is not responsive to new motion triggers.

Anyone else experience this? Any ideas on what to do about it?

I don’t know the specific conditional motion on/off app that you’re using, but it’s possible that the exact trigger is something like “10 minutes after motion stops.”

“motion stops” is a specific event within ST. So, if you walk into a room (motion starts, light turns on), then stand still for a minute (motion stops, 10 minute timer starts), then continuously move for 10 minutes (so another “motion stop” event never happens), the 10 minute timer isn’t reset.

IF this is the case, then the smartapp just needs to be fixed to kill the 10 minute timer (unschedule it) when motion starts.

@garyd9, here is what I’m using. I think Tim Slagle may be the author:

[code] definition(
name: “Conditional Motion OnOff”,
namespace: “Conditional Motion OnOff”,
author: “XXX”,
description: “Turn on some lights with motion if not already on”,
category: “My Apps”,
iconUrl: “https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience.png”,
iconX2Url: “https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png”,
iconX3Url: “https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png”)

preferences {
section(“Select the motion sensor
”) {
input “motion1”, “capability.motionSensor”, title: “Which?”, required: true, multiple: false
}

section("Select the switches to control...") {
	input "switches", "capability.switchLevel", title: "Which?", required: true, multiple: true
}
section("Select the dimmer level...") {
	input "level", "number", title: "Level?", required: true
}
section("Select the number of minutes after to turn off") {
	input "minutes", "number", title: "Minutes?", required: true
}

}

def installed() {
// log.debug “Installed with settings: ${settings}”

initialize()
}

def updated() {
// log.debug “Updated with settings: ${settings}”

unsubscribe()
initialize()
}

def initialize() {
subscribe(motion1, “motion.active”, motionOnHandler)
subscribe(motion1, “motion.inactive”, motionOffHandler)
}

def motionOnHandler(evt) {
state.switchOff = true
for(mySwitch in switches) state.switchOff = state.switchOff && (mySwitch.currentValue(“switch”) == “off”)
if(state.switchOff) switches.setLevel(level)
}

def motionOffHandler(evt) {
if(state.switchOff) {if(minutes>0) runIn(minutes*60,switchesOff) else switches.off()}
}

def switchesOff() {
switches.off()
} [/code]

First, when you copy code into the forum, please surround it with “code” tags ( [code] before the code, and [/code] after the code)

Second, it does appear that the code you have there does NOT unschedule the runIn() when motion is detected. A simple fix might be to add the following inside the motionOnHandler() function:

(It might have some other mechanism to deal with this situation, but if it does, I’m not seeing it.)

Take care
Gary

@garyd9 , sorry about the posting format issue.

I know practically nothing about coding. I see where the words, “motionOnHandler()” appear, but don’t know what it means to add code inside the function.

oh
 okay


Find the following two lines:

 def motionOnHandler(evt) {
     state.switchOff = true


and change them to be the following three lines:

 def motionOnHandler(evt) {
     unschedule(switchesOff)
     state.switchOff = true

Save that, publish for yourself, and tell us how it goes.

Take care
Gary

Done. I’ll report back on how it goes. Thanks!

@garyd9: nope. Light isn’t turning off after the motion stops. Any ideas?

This is fixed now, or not?

So the first issue is resolved and now you have a new issue? I hope you understand my confusion here
 I want to make sure I understand the problem before I try to fix it.

Gary, since the light doesn’t turn off at all, I can’t test whether the light would still improperly turn off X minutes after the motion first starts (the original problem) or whether the light would turn off X minutes after the sensor last detects motion.

Let’s back up


How are you configuring the smartapp? How many switches? Are they dimmers or just plain on/off switches? (Do you need it to work with dimmers?) How many minutes?

Have you tried with just a single switch (simple on/off) and a short duration? (such as “1”)?

It’s difficult for me to debug unformatted code, so if I can’t work this out from guesses, it’d be easier for me to just write a new smartapp (or find another existing one) for you to use.

(Also, I’m at my real paying job, so can’t really test this myself. I can do so in the evenings and weekends
)

I’ve read most of this thread. I just recently got my sensor and it immediately paired and is obviously using the now official device type. What I can’t figure out after all this reading is how to change my parameters using the official device type.