[RELEASE] HD+ - Android Dashboard

That should be good enough. According to Crashlytics there was several different crashes but all have the same root java.lang.OutOfMemoryError cause.. like the one below:

Fatal Exception: java.lang.OutOfMemoryError: pthread_create (1040KB stack) failed: Try again
       at java.lang.Thread.nativeCreate(Thread.java)
       at java.lang.Thread.start(Thread.java:887)
       at com.jjoe64.motiondetection.motiondetection.MotionDetector.onResume(MotionDetector.java:127)
       at com.jpage4500.hubitat.ui.activities.ScreenSaverActivity.onResume(ScreenSaverActivity.java:121)

I can look at ways to free up memory; I do cache all of the devices in memory but this typically isn't much.. with the occasional exception where some custom device drivers do have a lot of extra attributes that the app will never use. Here's my weather driver for example:

Weather Details
    {
        "name": "Weather",
        "label": "Weather",
        "type": "OpenWeatherMap-Alerts Weather Driver",
        "id": "383",
        "date": "2022-09-05T14:24:32+0000",
        "model": null,
        "manufacturer": null,
        "capabilities":
        [
            "RelativeHumidityMeasurement",
            "Refresh",
            "PressureMeasurement",
            "IlluminanceMeasurement",
            "UltravioletIndex",
            "TemperatureMeasurement",
            "Sensor"
        ],
        "attributes":
        {
            "percentPrecip": "100",
            "dataType": "NUMBER",
            "values": null,
            "forecastIcon": "rain",
            "forecastMorn": "71",
            "windSpeed": null,
            "weather": "Heavy intensity rain",
            "forecastEve": "75",
            "feelsLike": "76",
            "condition_code": null,
            "pressure": "30",
            "forecastHigh": "80",
            "condition_iconWithText": null,
            "illuminance": "3590",
            "last_observation_Forecast": null,
            "Precip2": null,
            "condition_icon": null,
            "sunsetTime": null,
            "threedayTile": null,
            "Precip0": null,
            "condition_text": null,
            "myTile": null,
            "forecastLow": "69",
            "alert": null,
            "tw_end": null,
            "wind_string": null,
            "rainToday": "1",
            "weatherIcons": null,
            "wind_gust": null,
            "condition_icon_only": null,
            "condition_icon_url1": "https://tinyurl.com/y6xrbhpf/39.png",
            "noonTime": null,
            "windDirection": null,
            "condition_icon_url2": "https://tinyurl.com/y6xrbhpf/39.png",
            "pressured": "  30",
            "forecastMorn1": "69",
            "cloudDayAfterTomorrow": null,
            "ultravioletIndex": "2.09",
            "forecastLow1": "69",
            "last_poll_Forecast": null,
            "Precip1": null,
            "rainTomorrow": "0",
            "cloudTomorrow": null,
            "forecast_text2": null,
            "wind_cardinal": null,
            "forecastHigh2": "90",
            "localSunrise": "6:58 AM",
            "dewpoint": null,
            "forecast_code": null,
            "alertTile": null,
            "forecastNight1": "72",
            "tw_begin": null,
            "wind_direction": null,
            "forecastDay1": "87",
            "forecast_text1": null,
            "vis": null,
            "sunriseTime": null,
            "localSunset": "7:45 PM",
            "alertSender": null,
            "temperature": "75",
            "betwixt": null,
            "humidity": "92",
            "condition_icon_url": "https://tinyurl.com/y6xrbhpf/39.png",
            "PoP2": "92",
            "forecast_text": null,
            "cloudToday": null,
            "forecastDay": "78",
            "wind": "2",
            "weatherSummary": "Weather summary for Matthews updated at 10:24 AM on 9/5/2022. Heavy intensity rain with a high of  80°F and a low of  69°F. Humidity is 92% and the temperature is  75°F. The temperature feels like it is  76°F. Wind: Light air from the South-Southeast at   2 MPH, gusts: up to 2 MPH. There is a 100% chance of precipitation. Visibility is around   6 miles.",
            "wind_degree": null,
            "alertDescr": null,
            "forecastNight": "71",
            "forecastEve1": "84",
            "cloud": null,
            "weatherIcon": "rain",
            "forecastHigh1": "91",
            "rainDayAfterTomorrow": "0",
            "is_day": "true",
            "PoP1": "88",
            "city": "Matthews",
            "illuminated": null,
            "threedayfcstTile": null,
            "forecastLow2": "70"
        },
        "commands":
        [
            {
                "command": "pollData"
            },
            {
                "command": "refresh"
            }
        ]
    }

If the app knows what attributes it's actually interested in, it can ignore all the others and save a little memory... but at the end of the day it's not even close to how much memory images or video take up.

What I'd like to do is figure out when available memory is getting low and be able to temporarily disable or delay displaying an image or pause a live video feed instead of the app crashing. I do already get notified when the OS is running low on memory so I just need to figure out the second part of that

1 Like

Ok that makes sense. The tile flickering should be fixed in the next release.

For lights which is where my main thoughts have been would be a slider across the bottom of the whole line for brightness

If I put the slider under each device (that supports brightness) that would take up more vertical space which is the biggest advantage of using the list vs tiles IMO.

From left to right: name, on/off (maybe a toggle reflecting the state, than maybe fill the rest with clickable boxes that the user can preset some colors

In order to get multiple controls (ie: toggle, color presets, etc) on a single item I'll have to create a few different layouts for the various device types. That would take a little extra time but the toggle does make sense instead of the ON/OFF text.

I'll see what I can do for a first version and then make it better based on feedback like this

That sounds like a perfect idea. I cannot think of any other way to get a brightness slider, can you? Maybe if we think of it like a physical dimmer and include 2 buttons, up and down. Might not need the on off toggle just the brightness with min being off.

I'm glad you found that. I do not use weather, video, or other tiles that use large amounts of data.

I also don't intentionally have any other apps running but I'll look to see if there are any background tasks I can do away with.

What's the refresh time on the auto return home?

30 seconds; I planned to make it configurable at some point though

I've noticed the circular control color around the lights will default to the last color of the light, instead of the CT of the light even if the colorMode attribute is CT. Is it possible to make it show color or color temperature (or just a generic yellow/white color) in the icon depending on the colorMode attribute?

Joe: I've just switched over to your app and have several of my tiles working. However, the video tile is a bit of a problem right now. I have several Reolink RLC-410 5mp cameras that are all working. However when I set the video tile for RTSP (custom) and enter my RTSP url (rtsp://admin:111111@192.168.10.92:554/h264Preview_01_main) the tile switches to "connecting" for a minute or two and then exits the whole dashboard app taking me to the Android home screen. I have several Amazon fire tablets and a couple Lenovo 10 inch tablets with the behaviour being the same on all of them.
Sorry, one more detail. I tested the rtsp url using VLC media player and it works fine. It brings up the camera video.
Thoughts?
Oh one other minor thing. Normally my passwords end with "%" which errors out in your software. For the above I removed the "%" and used only a purely numeric passwd for testing purposes.

I removed over a dozen unused apps last night, games and such, and I've not see a crash since.
:crossed_fingers:

It still is not waking on motion detector activation though.

I have multiple Android tablets and would like to create one dashboard and copy it to all the others. Can this be done?
If so how?
Thanks.

Yes. Back up your dashboard to your hub and then load that backup to your other pads.

Thanks for this. I'm going to try it.
I have another question. I have several Tuya temperature/humidity sensors that I have added to my hubitat dashboards. They work very well. How do I create a tile for these in the Hubitat Android app. When I add tile I do not see an option to add temperature/humidity tile display.
Thanks.

The Hubitat Android Dashboard app will automatically add any devices you have chosen to be available through Maker API. If you humidity sensors don’t show up on the dashboard app, go back to HE and open the MakerAPI app. Make sure you have selected the humidity sensors in there. After they have been selected, they should show up automatically on the dashboard

version 1.0.1770 (beta)

  • reduce memory usage
  • revert library update which caused problems on older OS's (4.4 and below)
  • fix device flicker

I wanted to release this version mostly to help some of the Out of Memory crashes that some have been experiencing. This should help users with lots of devices the most (or devices that have lots of attributes like some custom devices do). It might take an extra second the first time you load this version since it does migrate a few things from 1 location to another but from that point on it'll be more efficient and require less memory.

I also found that I had updated a library a few versions back which wasn't compatible with older Android OS's (4.3 and below) and this was causing a few crashes. I reverted that as well.


I tried to ensure nothing broke when updating from the previous version to this one but if you are manually updating please do a backup first and let me know if anything doesn't restore correctly and I'll get it fixed ASAP

3 Likes

Thanks for the reply Mattias. I must have nodded off during the lecture when that was covered. :innocent:

Tony, that is a great idea. Never thought of that. I will give it a try.

1 Like

@jpage4500 the presence tracking is working flawlessly with my Pixel 6. I use it in a different way than most as I use it to track when I am at work. So right now I have Alexa tracking my home and away presence and a rule machine rule that puts me at work when I enter your apps geofence and stay there for xx minutes. My work area is spread out around a 5 mile radius which is tough to geofence because the it hits a major highway and other roads that I use when not at work (due to the large radius needed), hence the 15 minutes.
I created a special small geofence at work for testing and in the course of my last couple days crossed in and out of it around 150 times. Other than some user error I didn't see any issues except a delay variation of maybe 10-15 seconds which is tighter than Alexa presence at my home.

  1. With that being said. Is it possible to draw our own geofence in your app. I'm assuming no, but I figured i would ask.

  2. This is directed to everyone that can think of how to create this rule. I have to go through a security gate to get into work. That is the only way into my work. I was thinking of setting up a TINY geofence on the road. The rule would be something like presence arrives in geofence and immediately leaves I would like it to set my mode to work. Than when I arrive again and leave set my mode to away. Problem is that I don't see how to create this rule and not confuse the system with the work or away aspect.
    Presence devices are limited a bit on the options. Any thoughts?

  3. I know you said you may look into multiple geofences once you get this working, but curious if you think this is even possible. I'm in no hurry as Alexa seems to work very well with home/away.

Sweet! That's great to hear

  1. With that being said. Is it possible to draw our own geofence in your app. I'm assuming no, but I figured i would ask.

AFAIK you can only have a circular geofence - lat/lng/radius

I know you said you may look into multiple geofences once you get this working, but curious if you think this is even possible

It's definitely possible.. an app can register multiple geofence areas. I'll need to think though how this would be setup so a given geofence notifies a specific device

Good question.. dealing with RGB lights was a bit of a learning curve for me back when I supported them and I don't have any that I deal with normally so it's something I haven't looked at in a while. I'll see if I can connect a few around the house and understand what's happening there.

The app probably is getting confused thinking the light is in a certain color vs the color temp which overrides color (as I remember it)

the "and then exits the whole dashboard app taking me to the Android home screen" part is definitely an app crash. I've seen several video crash events come in so guessing this is one of them. Video is tricky since I'm using 3 different open source libraries to handle the playback: RTSP, MGPEG and a really robust one called exoplayer.

I've been testing video playback on my S20 phone but I should really get another Fire tablet to test with since I know it doesn't support the same video codecs that other devices do. In fact, Amazon has their own version of exoplayer which is for Amazon devices (which of course makes things really complicated for me as I'm trying to write 1 app that supports multiple devices)

Oh one other minor thing. Normally my passwords end with "%" which errors out in your software. For the above I removed the "%" and used only a purely numeric passwd for testing purposes.

I looked and there's nothing I see which would prevent "%" from being a password but I wonder if one of the Android libraries I'm using thinks "%" is part of some other character.. for example "%3d" is the equals(=) sign. I'll test it out and see if that's the case