1.6.7 New Android Beta Available

Widgets have stopped working for me on Pixel 5 with this release. The existing one I had changed its name to spanish, so i removed it and now i cannot add any widgets

Build 125 is now on beta this build fixes the following:

  • Adding widgets
  • Crash when getting notifications
2 Likes

Has something gone wonky with the mobile app, the misses gone to work 2nd day on the trot she (edit @moncho1138 she is on the beta) , I double checked her settings (power save etc) before she left. Pixel 3a

No idea when it started playing up as as we haven't been out of the geofence for a while

She left on the 29th around 19:00 and came home at 06:00 on the 30th,

edit.. she is receiving push notifications whilst out of the geofence
also tried moving the hub location to test moving out of geofence but its not updating the hub location on the mobile app

Both my phone (S20 FE) and my wife's phone (S21) are on version 1.6.7 build 126 and are no longer reporting presence. From debug on the phone there is no activity. When I logged my phone out and back in, it no longer knew my hubs location.

Yep something got tweaked in this latest beta build. It's been pretty solid for me for a month or so. Today it never showed me leaving my geofence,even though I did and went about 18 miles to work


My and my wife's presence has been solid until this update. Tried different things but so far we have to manually arm when gone and disarm when returning.

Same here no events for coming/going on pixel 5

ive found changing the radius a little and then back triggers the geofence 'update' itself some how

Like Mark mentioned above, if I change my radius a tiny bit, it correctly identifies if I am inside or outside of the geofence. The little blue dot being inside or outside of the geofence is shown correctly, it's just not reporting the correct state of Inside or Outside.

had to lash up a driver for wifi presence, very disappointed the mobile app has prefomed very well for me over the years

/*
 * Hubitat presence Ping
 *
 *  Licensed Virtual the Apache License, Version 2.0 (the "License"); you may not use this file except
 *  in compliance with the License. You may obtain a copy of the License at:
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
 *  on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the specific language governing permissions and limitations under the License.
 *
 *  Change History:
 *
 *        Date        Who            What
 *        ----        ---            ----

        2021-11-05  thebearmay     Add Text Logging option
        2022-01-03    mark-c-uk    striped down to work as presance sensor
 */

metadata {
    definition (
		name: "Hubitat presence Ping", 
		namespace: "mark-c-uk", 
		author: "mark-c-uk",
	        importUrl:"",
	    	singleThreaded: true
	) {
        capability "Actuator"
        capability "Configuration"
        capability "PresenceSensor"
        capability "Initialize"
       
        attribute "pingData", "string"
            
    }   
}

preferences {
    input("ipAdd", "string", title: "IP address of device", required:true, submitOnChange: true)
    input("ipAddRout", "string", title: "IP address of router, to test befor sending away", submitOnChange: true)
    input("numPings", "number", title: "Number of pings to issue", defaultValue:3, required:true, submitOnChange:true, range: "1..5")
    input("pingPeriod", "number", title: "Ping Repeat in Seconds\n Zero to disable", defaultValue: 0, required:true, submitOnChange: true)
    input("awayPeriod", "number", title: "number of missed pings to be away", defaultValue: 5, required:true, submitOnChange: true)
    input("debugEnable", "bool", title: "Enable debug logging?")
    input("textLoggingEnabled", "bool", title: "Enable Text Logging", defaultValue:false)
    input "sendPushMessageto", "capability.notification", title: "Send a Push notification to?", multiple: true, required: false
}

def installed() {
	log.trace "installed()"
}

def configure() {
    unschedule()
    if (state.away == null) state.away = 0
    log.debug "configure()"
    updateAttr("pingData"," ")
    if (device.currentValue("presence") == null) updateAttr("presence","not present")
    updated()
}

def initialize(){
    configure()
}
def updated(){
	log.trace "updated()"
    if (ipAdd == null){
        log.warn "no ip address"
        updateAttr("pingData", "no Device IP address")
        state.validIP = false
    }
    else if (validIP(ipAdd) == true){
        if(debugEnable == true) log.debug "Device IP address format valid"
        updateAttr("pingData", "Device IP address format valid")
        state.validIP = true
    }
    else{
        log.warn "Device IP address format invalid"
        updateAttr("pingData", "Device IP address format invalid")
        state.validIP = false
    }
             
    if (ipAddRout == null){
        log.warn "no ip addressvfor router"
        state.router = false
    }
    else if (validIP(ipAddRout) == true){
        if(debugEnable == true) log.debug "router IP address format valid"
        state.router = true
    }
    else{
        log.warn "router IP address format invalid"
        state.router = false
    }
	if(debugEnable == true) runIn(1800,logsOff)
    if (numPings == null) numPings = 3
    if (awayPeriod == null) awayPeriod = 5
    
    if(state.validIP == true) pinger()
}

def refresh() {
	unschedule(refresh)
}
             
def updateAttr(aKey, aValue){
    sendEvent(name:aKey, value:aValue)
}

def pinger(){ 
    if (settings.textLoggingEnabled == true) log.debug "Ping initiated"
    if (state.responseReady == false){
        log.warn "not ready"
        if(pingPeriod > 0) runIn(pingPeriod, "pinger")
        return
    }
    if (sendPing(settings.ipAdd) < 100){
        if (state.away != 0) state.away = 0
        if(settings.textLoggingEnabled == true) log.debug "Presence 'present' for $ipAdd"
        updateAttr("presence","present")
    }
    else {
        if (device.currentValue("presence") == "not present"){
            if(settings.textLoggingEnabled == true) log.debug "Presence not present already $ipAdd, ${state.away} number of times"
        }
        else{
            state.away += 1
            if(settings.textLoggingEnabled == true) log.debug "Presence not presentfor $ipAdd , NP ${state.away}"
            if (state.away > awayPeriod){
                if (state.router == true){
                    if (sendPing(ipAddRout) < 100){
                        if(settings.textLoggingEnabled == true) log.debug "Presence set to 'not present' for $ipAdd"
                        updateAttr("presence","not present")
                    }
                    else {
                        updateAttr("pingData","router not present")
                    }
                } //end use router option
                else {
                    updateAttr("presence","not present")
                }
                if(settings.textLoggingEnabled == true) log.debug "not present' for $ipAdd, ${state.away} number of times"
            }
        }
    }
    if(settings.pingPeriod > 0) runIn(settings.pingPeriod, "pinger")
    if(settings.textLoggingEnabled == true && settings.pingPeriod > 0) log.debug "Next ping in $pingPeriod seconds"
}
             
def sendPing(ipAddress){
            if(textLoggingEnabled == true) log.debug "Hub internal ping method selected"
            state.responseReady = false
            
            hubitat.helper.NetworkUtils.PingData pingData = hubitat.helper.NetworkUtils.ping(ipAddress, numPings.toInteger())
            int pTran = pingData.packetsTransmitted.toInteger()
            if (pTran == 0){ // 2.2.7.121 bug returns all zeroes on not found
                pingData.packetsTransmitted = numPings
                pingData.packetLoss = 100
            }
            
            String pingStats = "Transmitted: ${pingData.packetsTransmitted}, Received: ${pingData.packetsReceived}, %Lost: ${pingData.packetLoss}"
            if(textLoggingEnabled == true) log.debug "Ping Stats for $ipAddress: $pingStats"
            //updateAttr("pingData", "$ipAddress: $pingStats") 
    state.responseReady = true
    return pingData.packetLoss

    //if (sendPushMessageto != null){
   //     sendPushMessageto.deviceNotification("some error" )
   // }
}
       
def validIP(ipAddress){
    regxPattern =/^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/
    boolean match = ipAddress ==~ regxPattern
    return match
}


void logsOff(){
     device.updateSetting("debugEnable",[value:"false",type:"bool"])
}
1 Like

Just wanted to mention something that I've noticed over the past year or so of running the Android app.

When a new version is released, geofence typically stops working until you run the app and dismiss the 'whats new' dialog. I'm not sure if this is a problem with geofence registration or not but figured I'd mention it.

But, typically when I see geofence/presence stop working, I'll open the app and see the 'whats new' dialog so I'm thinking there's something to that.

Anyway, back to 1.6.7 I'm also having general geofence issues too.. I attached a screenshot here which shows the app should know I'm outside but still says I'm 'inside'

Just adding to the chorus... After working well for months, location no longer works reliably in v1.6.7 build 126. Coming home last night, it was my connection to our WiFi network (and my combined geofence/WiFi presence setup) that triggered our arrival automations. My wife's phone showed her inside the radius on the map but still said "Out of Geofence".

Same issue here. Latest update hosed what was a working Geofence on Android 11. Had to create a virtual button to put my house into away mode while this gets sorted out.

Why is this such a consistent problem? Things work fine and along comes an update and breaks the Geofence.

Same, Geofence not working for a few days now. Glad to figure out why.

Working now is Samsung s10

I installed the beta version, 168, but haven't left the house yet to know if it works. Did you do anything special on with your S10? I have the S10+ and it hasn't been working on that or my son's S9 for a long time.

Don't turn battery optimization, off for it
Then add it to the list of never sleeping apps
Then you can add it to List of non battery optimization apps

It's also working fine on wife pixel 3a

Thanks for your response. Did you mean turn off battery optimization ( I think yes)? I knew how to find the 1st suggestion, was able to find the 2nd suggestion, but I don't know how to add to your 3rd suggestion. 'Then you can add it to List of non battery optimization apps'

App info, battery, unrestricted

Thanks.

Download the Hubitat app