[RELEASE] HD+ - Android Dashboard

Yeah that's 99% of what I do. I have a few outdoor lights that I have some holiday themes for, orange around Halloween, red/green for Christmas, etc. I rarely decide to pick some random RGB value unless I'm just trying to annoy my wife or something :slight_smile:

I need to spend a little time on this for sure.. being outside of the house there's no way to get device updates 'pushed' from the hub (without a server in between). That means the app has to do a refresh of the devices either manually (ie: pull to refresh) or every few minutes. The logic could be smarter too -- like refreshing devices that are updated frequently more often than ones that don't change.

That said, I have used the app outside of my house. So, the cloud logic should work today. What I wanted to do was have the app detect if it was on the hub's WIFI network or not. If so, use the internal IP - otherwise use the cloud URL. However, the latest versions of Android prevent an app from getting the WIFI access point name without prompting for location permission.

So, I could prompt for location permission (maybe only if the MakerAPI 'cloud' permission is enabled). Or, I could always try to connect locally first and then fall-back to using the cloud URL. I'm doing the latter today but I'll admit it's not ideal. Unless there's some other way I'm not thinking of.

If it's not working for you at all - 2 questions:

  • is the MakerAPI 'cloud' login option enabled?
  • are you able to login initially on your home WIFI? The app will try to fetch 2 API keys from your hub - 1 is for the hub access itself and the other is a cloud API key which we need to connect from anywhere. While I'd hate to manually enter either of these keys, I should make it at least possible to login remotely if both are entered.. that would be fairly easy to do

haha.. i've already annoyed my wife by putting up 4 RGB lights in the kitchen and they're always set to some random colors. Ultimately though - they're all going outside for the exact same reasons - Red/Greed for XMas; maybe Orange for halloween.. that kind of thing.

I initially was using some other color pickers in the app.. there's some good android libraries out there like this one: GitHub - QuadFlask/colorpicker: 🍭color picker for android. But, the one which I liked the most was actually the most simple - GitHub - the-blue-alliance/spectrum: A color selection library for Android. My long-term hope is to offer something super simple like this but with a way to pick a new color to add to the favorites list..

1 Like

looks like the same issue as before. Here's the post which describes it: kotlin - How to fix Expected Android API level 21+ but was 19 in Android - Stack Overflow

I wish I could find an API 19 device to test with but I'll keep looking.. no reason the app can't work with older devices AFAIK

happy to do what ever testing you like you'll just have to remote control me :slight_smile: however I am on windows pc no Mac...

actually, i forgot about the Android emulator.. I personally use real devices to do all of my testing b/c the emulator is slower but this is a good case for using it. I was able to reproduce the login crash and hopefully can find the right library versions to make it work.

Somewhat-related, I did notice that the color picker library I just added requires API19.. I'm guessing several other libraries also use this as a minimum so API18 might be too far back to go FWIW

@jpage4500, Sorry, my bad. I didn't notice that Cloud support had been added. It mostly works. However, there are a couple of issues with cloud usage. When I turn of a light it works immediately, but then says "Failed to update". The icon does not reflect that the status changed. If I turn off a group of lights the individual lights don't update. This interferes with being able to toggle those lights again until I do a manual refresh. I can't get drag to refresh to work; refresh works fine from the menu, and is reasonably fast.

One work around might be to refresh all tiles when one of them is changed (maybe wait 2 seconds in case a finger slips when dimming). An optional refresh icon on the top / left tile could help people worried about keeping status in sync.

This refresh issue is even more important for locks and garage doors. Right now they do not update in the background or when pressed. Knowing the status of these can be important. Perhaps an option to refresh all tiles every x number of seconds?

Separate from this, I read above that the icons can be changed. I'm not seeing how to do this. I long press a tile/icon and a menu pops up, but nothing about changing the icon. Or did I misread a post?

I plan to use this on my car's Android head unit. Right now I'm using dashboard and a full screen browser. This app would be much nicer.

Thanks!

I just submitted a new version with the following fixes

Still have improvements.. for example with the blue theme the 'on' light bulb gets colored all blue which looks weird. I'm just applying a color filter vs using a whole new set of icons but it works better with some icons than others.

Also, the icons are really spaced apart on API 19 devices. I have a pretty good idea why and I'll work on improving that so the UI looks the same for any device

1 Like

Yeah, right now the command is sent OK and the app starts a timer to wait for up to 10 seconds to receive an update for that device which comes via the 'push'. If that doesn't arrive, I show a 'failed to update' error. Of course, it's never going to arrive for remote devices so that logic should change.

One work around might be to refresh all tiles when one of them is changed (maybe wait 2 seconds in case a finger slips when dimming

Some device updates take effect right away but others can take a few seconds. I think it'd make sense to have 2 different auto-refresh routes for cloud connected mode:

  1. after sending a command to device A - refresh device A after <2-4> seconds (not sure what that value should be
  2. auto refresh all devices every few minutes (maybe 5)? It would only happen while you're actively viewing the app so it could be more frequent..
  3. a manual option should be there too.. I'll add a pull to refresh (drag the screen down to activate it). I had it but kept hitting it on accident while testing that I disabled it. I'll just enable it for cloud mode as it shouldn't be necessary for local network mode

that the icons can be changed. I'm not seeing how to do this. I long press a tile/icon and a menu pops up, but nothing about changing the icon

If you have the latest beta version in Google Play you should see an option that says "Change Icons". I posted a quick screencast showing it: https://youtu.be/1MvnHIhqQos

I'll make the UI much prettier for the whole change icon feature but it should be functional today.

working on Kindle HDX thanks!

how do I reset a title to default icons?

also if I device isnt identified as RGB can we select it much as I can choice switch or light?

I have a dimmer switch that does not indicate dimmer on your app. Here are the device details:
{"id":"433","name":"Generic Z-Wave Dimmer","label":"Front Door Light","attributes":[{"name":"level","currentValue":20,"dataType":"NUMBER"},{"name":"switch","currentValue":"off","dataType":"ENUM","values":["on","off"]}],"capabilities":["Switch",{"attributes":[{"name":"switch","dataType":null}]},"Polling","Configuration","SwitchLevel",{"attributes":[{"name":"level","dataType":null}]},"Refresh","Actuator","ChangeLevel"],"commands":["configure","flash","off","on","poll","refresh","setLevel","startLevelChange","stopLevelChange"]}

I have a dimmer switch that does not indicate dimmer on your app

I see what I'm doing wrong.. For both dimmer and RGB lights I'm looking for the "Light" capability as well as "SetLevel" (dimmer) or "ColorControl" (RGB).

I'll remove the "Light" check for both.. Originally I was just trying to figure things out from my own devices but later found this page which helps (though it's still nice to see actual device examples) - Driver Capability List - Hubitat Documentation

1 Like

@jpage4500, I was using the non-beta version. Once I signed up for the beta (v1.0.150) I got the latest version. Sorry, I didn't notice that is what was being discussed. That solves some of my issues.

I've now tried this on my car head unit. It looks very nice and I saw no additional issues. The refresh issue is pretty annoying; to help with that I hid the lights that are controlled by the group.

I think the earlier version had an option to change the template for the tile. I didn't play with it much but I can see where that would be useful. I have a multifunction sensor that all I want to monitor (with this app) is the temperature. The default template does show that, but its in small print, there is a big hand in the center. I also have a "GE Enbrighten Z-Wave Plus Smart Light Dimmer", but it shows up as a "light" (or switch); I don't see a way to change it to a dimmer.

Regarding the color options. It would be nice to also have an RGB entry. That would make it much easier to match colors. For example, I'm trying to match a door lock and garage door tile colors. Nearly impossible with the sliders, especially since the menu obscures the background. If I could simply copy the RGB numbers from one to the other that would solve the problem.

As a feature request - being able to add a widget dashboard would be really cool.

Thanks for all you do! This is really nice.

Version 1.0.155 (beta)

I just checked in the fix for RGB and dimmer light switches (not requiring the "Light" attribute). I don't have one of these to test with but I think it should work.

I also added a 'cloud login' toggle switch in settings. Once enabled this will force all network traffic through cloud.hubitat.com. The switch only shows up if we can get the cloud API token on login (which requires the Maker API 'cloud enabled' option to be checked). This mode allows for a manual pull-to-refresh to be done anytime as well as some different logic after sending commands. I'll continue to improve it but this should be an improvement over the previous version.

make it much easier to match colors

Yeah, the more I start to think about how I'll actually use my RGB lights the more this makes sense.. not just for background tile colors but actually matching 4 outside lights so they're not all different shades or red or whatever. I'm open to any ideas.. RGB entry doesn't seem like the most user-friendly way IMO but as an 'advanced' option it certainly would be easy to add in.

the earlier version had an option to change the template for the tile

I used to let you change any device type to any other device type but realized that's probably not the right idea.. I was more trying to give a way to change between devices that shared the same common attributes.. for example a "ContactSensor" could be on a door or a window or some other place. A "Switch" could be on a light switch or it could be a fireplace. I'm still learning all of the actual uses for these things! Anyway, you can still change a ContactSensor or Switch - but I didn't think there would ever be a reason to change between a "GarageDoorControl" and a "Weather" device type or things like that..

Speaking of - I want to add Fan support.. also am looking at adding the Mode support (not as trivial though)

1 Like

just download the APk 1.0155 my Lutron cassetta wall switch is not allowing dimming just on and off and my magic light RGB bulb is only showing on and off....

also some of the devices are not showing correct status at start up...Need to do more debugging on that one

Your latest update fixed this. Thanks

Does this still use local when it can?

@jpage4500, this is a great idea and thanks so much for taking it up! :+1: :+1:

@jpage4500 I'm sure you have a LOT on your plate with this but, assuming you're keeping a TODO list, please add multisensor support for the Aeotec Multisensor 6, Inovelli 4-in-1, and @iharyadi's environment sensor (Hubitat with Homemade Temperature, Humidity, Pressure and Light sensor).

Thanks

No - it's all cloud or all local from the toggle switch now. I was trying to figure out a way for the app to recognize it's on the local WIFI network. At least for my phone I wanted to make sure it switched back to the local IP when I was home as that's going to be the fastest response (as well as allowing the real-time websocket for pushing updates from the hub)

The best thought I had was to save the WIFI SSID that was used to initially login with. But, with newer Android OS's that requires prompting for location permission.

I used to use logic which would always try the local IP first and then fall back on the cloud connection if that failed. But, I wouldn't always want to do that as it takes some time to try the local connection first, fail and then re-try using the cloud.. and if I kept using the cloud connection how would I detect I'm home again?

Anyway, before I prompted for location permission I figured the more reliable way was a switch for always on or always off. If no one minds the location permission (I feel like a lot of people are turned off by any kind of permissions like that.. then again, maybe that's just my perception..

1 Like