Giter Club home page Giter Club logo

Comments (16)

tomasaxerot avatar tomasaxerot commented on July 16, 2024

Hi, what model are you using the pir or the dual pir and radar? Could you attach some logs that includes the pairing and the initial battery report? What do you mean by stop working?, does it stop to register motion or is it that the led is off?

from smartthings.

kbr90210 avatar kbr90210 commented on July 16, 2024

My motion sensors are working but I also have the battery percentage as showing at 1% with new batteries.

from smartthings.

tomasaxerot avatar tomasaxerot commented on July 16, 2024

Could anyone send a log from the moment where you pair the motion detector? What I'm after is the initial battery report to see what battery voltage is actually reported. Can't do much without that, I have used a range of 6 to 3 voltage. The 6 voltage comes from an engineering report for both of the motion detectors. Also provide which model the report is for

from smartthings.

tomasaxerot avatar tomasaxerot commented on July 16, 2024

Perhaps also check that the polarity of the batteries are correct. Think I put one of the batteries the wrong way in the beginning.

I have managed to get some more info from the power cluster: BatteryVoltageMinThreshold (24-> 2.4), BatteryQuantity (4), it would be interesting to see if your devices have another threshold. At least for the dual model ISW-ZDL1-WP11G the setup seems correct with min/0% at 3V and 100 around 6 V. Could lower the min/0% to 2.4 but thats really super depleted. Well will look into that. But that will not get you anywhere near 100% so will still need some logs and probably read the BatteryVoltageMinThreshold attribute from your devices.

from smartthings.

tomasaxerot avatar tomasaxerot commented on July 16, 2024

To read out the minThreshold/BatteryQuantity

  1. Save the old refresh method in the DTH

  2. Copy the following refresh method into your device handler:

def refresh() {
log.debug "refresh called"

def refreshCmds = zigbee.readAttribute(zigbee.POWER_CONFIGURATION_CLUSTER, 0x0020) +
		zigbee.readAttribute(zigbee.TEMPERATURE_MEASUREMENT_CLUSTER, 0x0000) + 
        zigbee.readAttribute(0x0001, 0x0036) + 
        zigbee.readAttribute(0x0001, 0x0033) +             
        zigbee.readAttribute(0x0001, 0x0032)            

return refreshCmds + zigbee.enrollResponse()

}

  1. Save and publish

  2. Start live logging in the IDE

  3. Then in the SmartThings Ui press refresh for the device

  4. Trigger motion for the detector

  5. Collect logs in the live logging window for the device

  6. Copy back the old refresh method

  7. Save Publish

from smartthings.

mustang19940 avatar mustang19940 commented on July 16, 2024

My model is ISW-ZPR1-WP13.
Here is the refresh changes you just posted, but the output didn't seem to give the requested outputs.

3560a630-1a88-43c0-acac-56abe936a762 6:46:51 PM: debug description: zone status 0x0020 -- extended status 0x00
09370aa1-df75-4609-8016-84ebcd07b939 6:46:47 PM: info SHM isActiveSensor(motion:active, app: off, location: off) = false, locationId: c5ed4430-6df4-44e1-a54f-41aa2033fe17, ISA: 09370aa1-df75-4609-8016-84ebcd07b939
09370aa1-df75-4609-8016-84ebcd07b939 6:46:47 PM: debug motionOrContactHandler(Foyer Motion motion:active)
3560a630-1a88-43c0-acac-56abe936a762 6:46:47 PM: debug Parse returned [name:motion, value:active, descriptionText:{{ device.displayName }} detected motion, translatable:true]
3560a630-1a88-43c0-acac-56abe936a762 6:46:47 PM: debug motion
3560a630-1a88-43c0-acac-56abe936a762 6:46:47 PM: debug description: zone status 0x0021 -- extended status 0x00

from smartthings.

tomasaxerot avatar tomasaxerot commented on July 16, 2024

Ah crap, my bad, forgot that I also added another line to output the attributes....sigh

In the parse method below this line:
Map descMap = zigbee.parseDescriptionAsMap(description)
add this line
log.debug "descMap: $descMap"

that should do it....

from smartthings.

mustang19940 avatar mustang19940 commented on July 16, 2024

THAT looks better:

09370aa1-df75-4609-8016-84ebcd07b939 11:18:37 AM: debug motionOrContactHandler(Front Door contact:closed)
09370aa1-df75-4609-8016-84ebcd07b939 11:18:34 AM: debug motionOrContactHandler(Foyer Motion motion:inactive)
3560a630-1a88-43c0-acac-56abe936a762 11:18:34 AM: debug Parse returned [name:motion, value:inactive, descriptionText:{{ device.displayName }} motion has stopped, translatable:true]
3560a630-1a88-43c0-acac-56abe936a762 11:18:34 AM: debug motion
3560a630-1a88-43c0-acac-56abe936a762 11:18:34 AM: debug description: zone status 0x0020 -- extended status 0x00
09370aa1-df75-4609-8016-84ebcd07b939 11:18:32 AM: info SHM isActiveSensor(contact:open, app: off, location: off) = false, locationId: c5ed4430-6df4-44e1-a54f-41aa2033fe17, ISA: 09370aa1-df75-4609-8016-84ebcd07b939
09370aa1-df75-4609-8016-84ebcd07b939 11:18:32 AM: debug motionOrContactHandler(Front Door contact:open)
09370aa1-df75-4609-8016-84ebcd07b939 11:18:31 AM: info SHM isActiveSensor(motion:active, app: off, location: off) = false, locationId: c5ed4430-6df4-44e1-a54f-41aa2033fe17, ISA: 09370aa1-df75-4609-8016-84ebcd07b939
09370aa1-df75-4609-8016-84ebcd07b939 11:18:31 AM: debug motionOrContactHandler(Foyer Motion motion:active)
09370aa1-df75-4609-8016-84ebcd07b939 11:18:31 AM: info SHM isActiveSensor(motion:active, app: off, location: off) = false, locationId: c5ed4430-6df4-44e1-a54f-41aa2033fe17, ISA: 09370aa1-df75-4609-8016-84ebcd07b939
09370aa1-df75-4609-8016-84ebcd07b939 11:18:31 AM: debug motionOrContactHandler(Foyer Motion motion:active)
022ca8a5-ec83-44e8-92fe-d42ea6dd8447 11:18:31 AM: debug Has already sent warning for current battery level, not sending notification for device: Foyer Motion
022ca8a5-ec83-44e8-92fe-d42ea6dd8447 11:18:31 AM: debug lowBatteryHandler: Foyer Motion battery is 0%
3560a630-1a88-43c0-acac-56abe936a762 11:18:31 AM: debug Parse returned [name:motion, value:active, descriptionText:{{ device.displayName }} detected motion, translatable:true]
3560a630-1a88-43c0-acac-56abe936a762 11:18:31 AM: debug motion
3560a630-1a88-43c0-acac-56abe936a762 11:18:31 AM: debug description: zone status 0x0021 -- extended status 0x00
022ca8a5-ec83-44e8-92fe-d42ea6dd8447 11:18:31 AM: debug Has already sent warning for current battery level, not sending notification for device: Foyer Motion
022ca8a5-ec83-44e8-92fe-d42ea6dd8447 11:18:31 AM: debug lowBatteryHandler: Foyer Motion battery is 0%
3560a630-1a88-43c0-acac-56abe936a762 11:18:30 AM: debug Parse returned [:]
3560a630-1a88-43c0-acac-56abe936a762 11:18:30 AM: debug descMap: [raw:0104 0500 05 01 0D40 00 1FF6 00 00 0000 04 01 00, profileId:0104, clusterId:0500, sourceEndpoint:05, destinationEndpoint:01, options:0D40, messageType:00, dni:1FF6, isClusterSpecific:false, isManufacturerSpecific:false, manufacturerId:0000, command:04, direction:01, data:[00], clusterInt:1280, commandInt:4]
3560a630-1a88-43c0-acac-56abe936a762 11:18:30 AM: debug description: catchall: 0104 0500 05 01 0D40 00 1FF6 00 00 0000 04 01 00
3560a630-1a88-43c0-acac-56abe936a762 11:18:30 AM: debug Parse returned [name:battery, translatable:true, descriptionText:{{ device.displayName }} battery was {{ value }}%, value:0]
3560a630-1a88-43c0-acac-56abe936a762 11:18:30 AM: debug Battery rawValue = 2
3560a630-1a88-43c0-acac-56abe936a762 11:18:30 AM: debug descMap: [raw:1FF60500010A3300002002, dni:1FF6, endpoint:05, cluster:0001, size:0A, attrId:0033, result:success, encoding:20, value:02, isValidForDataType:true, clusterInt:1, attrInt:51]
3560a630-1a88-43c0-acac-56abe936a762 11:18:30 AM: debug description: read attr - raw: 1FF60500010A3300002002, dni: 1FF6, endpoint: 05, cluster: 0001, size: 0A, attrId: 0033, result: success, encoding: 20, value: 02
3560a630-1a88-43c0-acac-56abe936a762 11:18:30 AM: debug Parse returned [name:motion, value:active, descriptionText:{{ device.displayName }} detected motion, translatable:true]
3560a630-1a88-43c0-acac-56abe936a762 11:18:30 AM: debug motion
3560a630-1a88-43c0-acac-56abe936a762 11:18:30 AM: debug description: zone status 0x0021 -- extended status 0x00
3560a630-1a88-43c0-acac-56abe936a762 11:18:30 AM: debug Parse returned [:]
3560a630-1a88-43c0-acac-56abe936a762 11:18:30 AM: debug descMap: [raw:1FF605000106320086, dni:1FF6, endpoint:05, cluster:0001, size:06, attrId:0032, result:unsupported attr, clusterInt:1, attrInt:50]
3560a630-1a88-43c0-acac-56abe936a762 11:18:30 AM: debug description: read attr - raw: 1FF605000106320086, dni: 1FF6, endpoint: 05, cluster: 0001, size: 06, attrId: 0032, result: unsupported attr
3560a630-1a88-43c0-acac-56abe936a762 11:18:30 AM: debug Parse returned [name:battery, translatable:true, descriptionText:{{ device.displayName }} battery was {{ value }}%, value:0]
3560a630-1a88-43c0-acac-56abe936a762 11:18:30 AM: debug Battery rawValue = 24
3560a630-1a88-43c0-acac-56abe936a762 11:18:30 AM: debug descMap: [raw:1FF60500010A3600002018, dni:1FF6, endpoint:05, cluster:0001, size:0A, attrId:0036, result:success, encoding:20, value:18, isValidForDataType:true, clusterInt:1, attrInt:54]
3560a630-1a88-43c0-acac-56abe936a762 11:18:30 AM: debug description: read attr - raw: 1FF60500010A3600002018, dni: 1FF6, endpoint: 05, cluster: 0001, size: 0A, attrId: 0036, result: success, encoding: 20, value: 18
3560a630-1a88-43c0-acac-56abe936a762 11:18:30 AM: debug Parse returned [:]
3560a630-1a88-43c0-acac-56abe936a762 11:18:30 AM: debug descMap: [raw:0104 0500 05 01 0D40 00 1FF6 00 00 0000 0B 01 0000, profileId:0104, clusterId:0500, sourceEndpoint:05, destinationEndpoint:01, options:0D40, messageType:00, dni:1FF6, isClusterSpecific:false, isManufacturerSpecific:false, manufacturerId:0000, command:0B, direction:01, data:[00, 00], clusterInt:1280, commandInt:11]
3560a630-1a88-43c0-acac-56abe936a762 11:18:30 AM: debug description: catchall: 0104 0500 05 01 0D40 00 1FF6 00 00 0000 0B 01 0000
2e8364e4-32b2-434c-8f3e-a65505a6b12f 11:18:19 AM: info SHM getInitialData 0.077 (00) incidents:00, locationId:c5ed4430-6df4-44e1-a54f-41aa2033fe17
2e8364e4-32b2-434c-8f3e-a65505a6b12f 11:18:19 AM: debug summaryData: [[icon:indicator-dot-gray, iconColor:#878787, value:Disarmed], [icon:indicator-dot-green, iconColor:#79b821, value:Everything OK, heroInfo:[heroStatus:ok, heroMessage:Everything OK]]] - [[icon:indicator-dot-gray, value:Disarmed, iconColor:#878787], [icon:indicator-dot-green, heroInfo:[heroStatus:ok, heroMessage:Everything OK], value:Everything OK, iconColor:#79b821]]
3560a630-1a88-43c0-acac-56abe936a762 11:18:01 AM: debug refresh called
11:17:14 AM: info Waiting on events...
11:17:14 AM: info For past logs for individual things go to the My Devices section, find the device and click on the Events link on the device information page.
11:17:14 AM: info This console provides live logging of your SmartThings.

from smartthings.

kbr90210 avatar kbr90210 commented on July 16, 2024

If I made the code changes correctly this is what I have.

583150de-083d-4a78-afdb-111ee900b665 11:21:02 AM: debug Parse returned [:]
583150de-083d-4a78-afdb-111ee900b665 11:21:02 AM: debug descMap: [raw:0104 0500 05 01 0D40 00 4C27 00 00 0000 04 01 00, profileId:0104, clusterId:0500, sourceEndpoint:05, destinationEndpoint:01, options:0D40, messageType:00, dni:4C27, isClusterSpecific:false, isManufacturerSpecific:false, manufacturerId:0000, command:04, direction:01, data:[00], clusterInt:1280, commandInt:4]
583150de-083d-4a78-afdb-111ee900b665 11:21:02 AM: debug description: catchall: 0104 0500 05 01 0D40 00 4C27 00 00 0000 04 01 00
583150de-083d-4a78-afdb-111ee900b665 11:20:59 AM: debug Parse returned [:]
583150de-083d-4a78-afdb-111ee900b665 11:20:59 AM: debug descMap: [raw:4C2705000106320086, dni:4C27, endpoint:05, cluster:0001, size:06, attrId:0032, result:unsupported attr, clusterInt:1, attrInt:50]
583150de-083d-4a78-afdb-111ee900b665 11:20:59 AM: debug description: read attr - raw: 4C2705000106320086, dni: 4C27, endpoint: 05, cluster: 0001, size: 06, attrId: 0032, result: unsupported attr
583150de-083d-4a78-afdb-111ee900b665 11:20:57 AM: debug Parse returned [name:motion, value:inactive, descriptionText:{{ device.displayName }} motion has stopped, translatable:true]
583150de-083d-4a78-afdb-111ee900b665 11:20:57 AM: debug motion
583150de-083d-4a78-afdb-111ee900b665 11:20:57 AM: debug description: zone status 0x0020 -- extended status 0x00
583150de-083d-4a78-afdb-111ee900b665 11:20:57 AM: debug Parse returned [name:battery, translatable:true, descriptionText:{{ device.displayName }} battery was {{ value }}%, value:0]
583150de-083d-4a78-afdb-111ee900b665 11:20:57 AM: debug Battery rawValue = 2
583150de-083d-4a78-afdb-111ee900b665 11:20:57 AM: debug descMap: [raw:4C270500010A3300002002, dni:4C27, endpoint:05, cluster:0001, size:0A, attrId:0033, result:success, encoding:20, value:02, isValidForDataType:true, clusterInt:1, attrInt:51]
583150de-083d-4a78-afdb-111ee900b665 11:20:57 AM: debug description: read attr - raw: 4C270500010A3300002002, dni: 4C27, endpoint: 05, cluster: 0001, size: 0A, attrId: 0033, result: success, encoding: 20, value: 02
583150de-083d-4a78-afdb-111ee900b665 11:20:56 AM: debug Parse returned [name:temperature, value:81, unit:F, descriptionText:{{ device.displayName }} was {{ value }}°F, translatable:true]
583150de-083d-4a78-afdb-111ee900b665 11:20:56 AM: debug description: temperature: 27.15
583150de-083d-4a78-afdb-111ee900b665 11:20:55 AM: debug Parse returned [name:battery, translatable:true, descriptionText:{{ device.displayName }} battery was {{ value }}%, value:0]
583150de-083d-4a78-afdb-111ee900b665 11:20:55 AM: debug Battery rawValue = 24
583150de-083d-4a78-afdb-111ee900b665 11:20:55 AM: debug descMap: [raw:4C270500010A3600002018, dni:4C27, endpoint:05, cluster:0001, size:0A, attrId:0036, result:success, encoding:20, value:18, isValidForDataType:true, clusterInt:1, attrInt:54]
583150de-083d-4a78-afdb-111ee900b665 11:20:55 AM: debug description: read attr - raw: 4C270500010A3600002018, dni: 4C27, endpoint: 05, cluster: 0001, size: 0A, attrId: 0036, result: success, encoding: 20, value: 18
583150de-083d-4a78-afdb-111ee900b665 11:20:53 AM: debug Parse returned [name:temperature, value:80, unit:F, descriptionText:{{ device.displayName }} was {{ value }}°F, translatable:true]
583150de-083d-4a78-afdb-111ee900b665 11:20:53 AM: debug description: catchall: 0104 0402 05 01 0D40 00 4C27 00 00 0000 01 01 00000029660A
583150de-083d-4a78-afdb-111ee900b665 11:20:52 AM: debug Parse returned [name:motion, value:active, descriptionText:{{ device.displayName }} detected motion, translatable:true]
583150de-083d-4a78-afdb-111ee900b665 11:20:52 AM: debug motion
583150de-083d-4a78-afdb-111ee900b665 11:20:52 AM: debug description: zone status 0x0021 -- extended status 0x00
583150de-083d-4a78-afdb-111ee900b665 11:20:50 AM: debug Parse returned [name:battery, translatable:true, descriptionText:{{ device.displayName }} battery was {{ value }}%, value:1]
583150de-083d-4a78-afdb-111ee900b665 11:20:50 AM: debug Battery rawValue = 31
583150de-083d-4a78-afdb-111ee900b665 11:20:50 AM: debug descMap: [raw:4C270500010A200000201F, dni:4C27, endpoint:05, cluster:0001, size:0A, attrId:0020, result:success, encoding:20, value:1f, isValidForDataType:true, clusterInt:1, attrInt:32]
583150de-083d-4a78-afdb-111ee900b665 11:20:50 AM: debug description: read attr - raw: 4C270500010A200000201F, dni: 4C27, endpoint: 05, cluster: 0001, size: 0A, attrId: 0020, result: success, encoding: 20, value: 1f
583150de-083d-4a78-afdb-111ee900b665 11:20:50 AM: debug Parse returned [name:motion, value:inactive, descriptionText:{{ device.displayName }} motion has stopped, translatable:true]
583150de-083d-4a78-afdb-111ee900b665 11:20:50 AM: debug motion

from smartthings.

mustang19940 avatar mustang19940 commented on July 16, 2024

When I had the new code in there, and after the refresh, my battery level dropped to 0%. After I changed the code back to the original, it went back to 1%. Definately think it's simply a reporting or polling issue from the battery indicator.

from smartthings.

tomasaxerot avatar tomasaxerot commented on July 16, 2024

Hi and thanks for the logs, well in strengthens my suspicion that only 2 of 4 batteries are used in the measurement, also makes sense that both of your detectors report 3.1 voltage for 2 fresh AA batteries.

I will start to make changes so that you will see correct battery level, think I will have something finished at the latest at the end of the weekend.

The reason you saw your level dropped to zero is that new attributes came in from the power cluster that is not really battery. First you had 1f (3.1 -> 1%), after that came another reading 18(2.4-> 0%), and the last reading 02(2 -> 0%). This will not be an issue when you remove the added debug code in the refresh method.

As soon as I publish a new version of the DTH you can just hit the refresh button and trigger motion and you will both be on 100%

from smartthings.

tomasaxerot avatar tomasaxerot commented on July 16, 2024

So it went a little bit quicker, ive commited a fix now, so it should only be to use the new code hit the refresh button and trigger motion and you will see 100%

Please let me know if it works on your devices...

from smartthings.

kbr90210 avatar kbr90210 commented on July 16, 2024

It is working for me, it now shows 100%, Thanks!

from smartthings.

mustang19940 avatar mustang19940 commented on July 16, 2024

Hmm, for some reason it's not working on my end. I've copied the whole new code and replaced, saved, published, refresh and triggered motion, but still showing 1%.

from smartthings.

mustang19940 avatar mustang19940 commented on July 16, 2024

Nevermind, apparently it just took some time to reflect the code update or something. It's showing 100% battery for me. You've been EXTREMELY helpful, and it's been a pleasure working with you!!

from smartthings.

tomasaxerot avatar tomasaxerot commented on July 16, 2024

Glad it all worked out and thanks for making this a better DTH. Closing this for now

from smartthings.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.