I bow to @wackware! You just knighted me, my lord!
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!
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
BTW, I was not trying to put more on your plate! It was just a general observation.
Feel free to twerkâŠerâŠtweak away.
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.
- When a new or old battery is inserted it is assumed to be 100% and is reported as 100%.
- If/when the voltage drops/changes from when it was inserted, it is then calculated and reported on next wakeup (2.9v = 90%) .
- 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.
- Anything below 2.6v is considered and reported as 0%.
- 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
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!
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.