Post Requests for Zwave Edge Drivers Here (community-created)

Hi @blkwll

Added to this driver version

┌─────────────┬──────────────────────────────────────┐
│ Name        │ Zigbee Motion Sensor Mc              │
│ Version     │ 2022-08-29T16:56:08.171202188        │
└─────────────┴──────────────────────────────────────┘
  - id: "Bosch-ISW-ZPR1-WP13-Motion"
    deviceLabel: Bosch Motion Sensor
    manufacturer: Bosch
    model: ISW-ZPR1-WP13
    deviceProfileName: motion-temp-battery

I see in DTH that device use a battery map from 1.5v to 3.0v. others bosch devices use 2.1v to 3.0v
This is the map used to convert volt to % in DTH

if(model == "ISW-ZPR1-WP13") {
        	batteryMap = [30: 100, 29: 100, 28: 100, 27: 100, 26: 100, 25: 90, 24: 90, 23: 70,
							  22: 70, 21: 50, 20: 50, 19: 30, 18: 30, 17: 15, 16: 1, 15: 0]
			minVolts = 15
			maxVolts = 30  

I used the bosch formula to others devices in the driver

local battery_pct = math.floor(((((value.value / 10) - minVolts) + 0.001) / (maxVolts - minVolts)) * 100)

It must works similar to map, tell me if it is so

2 Likes