danabw
February 8, 2021, 11:56pm
171
Not sure how to use the app. It shows "null" in the app for any contact sensor I choose (Visonic or GoControl/Eco), same w/Motion sensors (Iris v2 and v3).
Logs don't show anything. I enabled OATH, wasn't sure if that's required. Feeling a bit "DOH!" here.
Front door contact Sensor selected:
Motion Sensor selected:
In both cases hit the button to refresh status.
Battery info is showing up in Battery Monitor app:
Just stick the contact sensor in the battery input. Doesn't need oauth.
danabw
February 9, 2021, 12:06am
173
Yup, did that. (Oops, wrong screen grab at first.)
App shows all null...I have hit the "Refresh" button in the app.
Can you send me a link to the battery app? Maybe they're doing something different to get the battery.
1 Like
It's probably something obvious like device.currentBattery. you could change it real quick and see under contact battery handler. Change currentValue("battery") to currentBattery. If that works I'll roll it into the code.
danabw
February 9, 2021, 12:17am
176
It's in HPM...was pulled over from ST by Larry...
Forum post on it:
eric22
February 9, 2021, 12:20am
177
I have the same Visonic MCT-340 E sensors.
1 Like
danabw
February 9, 2021, 12:24am
178
Do they show battery in the Auto Lock app?
eric22
February 9, 2021, 12:27am
179
No they do not show battery in the app. But they do update battery level daily.
1 Like
Two possible solutions, copy the battery handler contents into the contact handler.
Add contactBattery mention a bit ago.
Watching the kids right now so I'm not in front of my pc at the moment.
1 Like
danabw
February 9, 2021, 12:51am
181
Is this what you meant? Changed in two places.
Or do you mean to replace the entire statement "currentValue("battery")" with "currentBattery"?
I did as above image and saved...if I did what you meant and it works, I assume battery status won't update until the next time the contact sensor reports.
You could probably get rid of the ("battery") for both on that line but of it's working no need.
danabw
February 9, 2021, 12:58am
183
No errors on the Save so I assume it's not breaking anything.
K - so I'll wait until the next battery report (likely tomorrow AM) and I'll let you know what happens.
Just change it real quick and see. You could copy that line into the contactContactHandler as an if statement and trigger it by opening the door.
1 Like
It's still waiting on an event though try copying that line outside of the method like somewhere in the main page and see if it updates.
Change it to an if statement and close the bracket on the end.
Doesn't really matter where you stick it. Just insert a line after one of the input lines near the top. Then save and refresh device toggle.
danabw
February 9, 2021, 1:19am
187
Bingo, bingo, bingo, and bingo is the name-o.
Change: (Added line 58)
Result: Accurate battery info!
Man - you did this w/twins in your hands!!
They're both sitting in my lap.
1 Like
I'll add contactBattery to the next build.
1 Like
danabw
February 9, 2021, 1:25am
190
You mean currentBattery - twin's typo, I assume.