# Feature Request: Allow Android to process defaultValue for inputs (like iPhone)

**URL:** <https://community.smartthings.com/t/feature-request-allow-android-to-process-defaultvalue-for-inputs-like-iphone/79182>\
**Category:** Features & Feedback\
**Tags:** android\
**Created:** [February 25, 2017, 11:45am UTC](https://community.smartthings.com/t/feature-request-allow-android-to-process-defaultvalue-for-inputs-like-iphone/79182 "2017-02-25T11:45:54Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![zcapr17](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/zcapr17/32/26770_2.png) [@zcapr17](https://community.smartthings.com/u/zcapr17)\
**Post date:** [February 25, 2017, 11:45am UTC](https://community.smartthings.com/t/feature-request-allow-android-to-process-defaultvalue-for-inputs-like-iphone/79182/1 "2017-02-25T11:45:54Z")

</div>

I maintain [a number of SmartApps and device handlers](https://github.com/codersaur/SmartThings), which I develop and test using my iPhone, and publish to the community. I use the _defaultValue_ option on all my preferences inputs, because it’s very useful and saves time when commissioning new devices.

However, I continually get requests from other community members to fix the bug where the Android version of the SmartThings app does not process the _defaultValue_ option properly (it looks like it does, as it puts a value in the box, it just doesn’t save it).

**It’s absolutely crazy that SmartThings STILL haven’t fixed the issue of processing defaultValues on Android. [Simply adding an addendum to the documentation](http://docs.smartthings.com/en/latest/device-type-developers-guide/device-preferences.html#additional-notes) saying not to use defaultValue isn’t that helpful when the feature works and is very useful on iPhones.** 👿

**Please, please, please fix this!** 😭

---

<div class="post-metadata">

**Author:** ![doncaruana](https://avatars.discourse-cdn.com/v4/letter/d/f6c823/32.png) [@doncaruana](https://community.smartthings.com/u/doncaruana)\
**Post date:** [February 25, 2017, 12:00pm UTC](https://community.smartthings.com/t/feature-request-allow-android-to-process-defaultvalue-for-inputs-like-iphone/79182/2 "2017-02-25T12:00:57Z")

</div>

Can you elaborate on this a little? Do you mean before someone goes to preferences and hits “Done” or after? Because I haven’t seen this after hitting done.

What I’ve noticed is that on any enum variable, there is no default displayed, just the description, when you first go to preferences. But once you hit done the default value is populated and I see it in the handler debugging as well that it’s being used. At least I think I have. 🙂

---

<div class="post-metadata">

**Author:** ![zcapr17](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/zcapr17/32/26770_2.png) [@zcapr17](https://community.smartthings.com/u/zcapr17)\
**Post date:** [February 25, 2017, 3:18pm UTC](https://community.smartthings.com/t/feature-request-allow-android-to-process-defaultvalue-for-inputs-like-iphone/79182/3 "2017-02-25T15:18:45Z")

</div>

> [@doncaruana](#):
>
> Can you elaborate on this a little? Do you mean before someone goes to preferences and hits “Done” or after? Because I haven’t seen this after hitting done.

This is what I hear from Android users:

For any most input types (e.g. number, string), if the current value of an input setting is _null_, and a _defaultValue_ is set in the code, then when the Settings page is opened, the GUI will show the default value in the input box. However, when the user hits _Done_ and the settings are _supposedly_ saved, the value of the inputs is still _null_.

This creates confusion for Android users, because it looks like the values are set, but they are not saved.  
The solution at the moment appears to be that Android users must go though all settings boxes, delete the existing value, and manually re-enter the desired value.

In the iPhone app, it behaves in a similar way: if the current value of an input setting is _null_, and a _defaultValue_ is set in the code, then when the Settings page is opened, the GUI will show the default value in the input box, but the difference is, when the user hits _Done_, the value **is actually saved**.

---

<div class="post-metadata">

**Author:** ![doncaruana](https://avatars.discourse-cdn.com/v4/letter/d/f6c823/32.png) [@doncaruana](https://community.smartthings.com/u/doncaruana)\
**Post date:** [February 25, 2017, 4:04pm UTC](https://community.smartthings.com/t/feature-request-allow-android-to-process-defaultvalue-for-inputs-like-iphone/79182/4 "2017-02-25T16:04:10Z")

</div>

I just tested it on android and it worked perfect for me. All I had to do was hit “done” and the values were set.

I created a new preference on an existing device (so the input would automatically be null) I set a log.debug in the updated method to show me the values. They were set to the defaults.

I did have some weird issues with required values - they will not grab the defaults - but otherwise it was fine.

---

<div class="post-metadata">

**Author:** ![zcapr17](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/zcapr17/32/26770_2.png) [@zcapr17](https://community.smartthings.com/u/zcapr17)\
**Post date:** [February 25, 2017, 4:19pm UTC](https://community.smartthings.com/t/feature-request-allow-android-to-process-defaultvalue-for-inputs-like-iphone/79182/5 "2017-02-25T16:19:40Z")

</div>

> [@doncaruana](#):
>
> I created a new preference on an existing device (so the input would automatically be null) I set a log.debug in the updated method to show me the values. They were set to the defaults.
> 
> I did have some weird issues with required values - they will not grab the defaults - but otherwise it was fine.

Perhaps that’s the real issue. If an input is _required_, then the Android app fills in the _defaultValue_, but when you come to save the settings (by hitting _Done_) it doesn’t register that there is any value there and won’t let you save. The user is then stuck, because they appear to have all inputs completed, but they still can’t save them.

I should probably defer to some of the users who’ve asked me to remove _defaultValues_ from my code:

@cscheiene, @steve.bratt , @Alwas please can you explain exactly what the issues are?

---

<div class="post-metadata">

**Author:** ![krlaframboise](https://avatars.discourse-cdn.com/v4/letter/k/d2c977/32.png) [@krlaframboise](https://community.smartthings.com/u/krlaframboise)\
**Post date:** [February 25, 2017, 4:37pm UTC](https://community.smartthings.com/t/feature-request-allow-android-to-process-defaultvalue-for-inputs-like-iphone/79182/6 "2017-02-25T16:37:07Z")

</div>

From what I’ve seen, default values (except enums) populate, but if the field is required, you can’t save unless you enter each field. To get around this, I still set a default value, but I don’t use any required fields and wrap the settings so that if a value isn’t entered it uses the default value.

Setting the default value of an enum has no visual effect which ends up confusing the user because they have no idea what the default is. I usually add “(default)” to the default item in the enum to make it less confusing.

In both of these situations, if the fields are not required, the user can open the settings, tap done, and the next time they open the settings everything will be populated correctly.

My solution is time consuming and adds unnecessary complexity. Everything works the way its supposed to in iOS and it used to work fine in Android so I don’t know why it’s taking so long for them to fix this.

I think the android bug that should be a higher priority is the inability to select multiple items from an enum. When an enum is marked multiple, the user can select multiple items and it displays the items they selected, but only the first item they selected from that list gets saved in the field. The next time they open the settings, the other items are no longer selected.

---

<div class="post-metadata">

**Author:** ![cscheiene](https://avatars.discourse-cdn.com/v4/letter/c/7bcc69/32.png) [@cscheiene](https://community.smartthings.com/u/cscheiene)\
**Post date:** [February 25, 2017, 4:41pm UTC](https://community.smartthings.com/t/feature-request-allow-android-to-process-defaultvalue-for-inputs-like-iphone/79182/7 "2017-02-25T16:41:01Z")

</div>

You described it very well.

When the input is required and filled in by default value, when you then hit “Done” it comes up with something like: please fill in all required fields" But all the fields are blue and already filled inn. So you are stuck and cannot save the config. All you can do is hit the back button.

---

<div class="post-metadata">

**Author:** ![zcapr17](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/zcapr17/32/26770_2.png) [@zcapr17](https://community.smartthings.com/u/zcapr17)\
**Post date:** [February 25, 2017, 5:01pm UTC](https://community.smartthings.com/t/feature-request-allow-android-to-process-defaultvalue-for-inputs-like-iphone/79182/8 "2017-02-25T17:01:32Z")

</div>

Ok, so I think we’ve manage to describe to problem fairly well now. 🙂

**So, SmartThings ( @duncan, @slagle, [@Staff\_Members](https://community.smartthings.com/groups/Staff_Members) ), please can we get these issues fixed ASAP.** It’s been driving me and many other crazy for many months, and I don’t even own an Android phone!!!

---

<div class="post-metadata">

**Author:** ![steve.bratt](https://yyz2.discourse-cdn.com/smartthings/user_avatar/community.smartthings.com/steve.bratt/32/20541_2.png) [@steve.bratt](https://community.smartthings.com/u/steve.bratt)\
**Post date:** [February 26, 2017, 10:35am UTC](https://community.smartthings.com/t/feature-request-allow-android-to-process-defaultvalue-for-inputs-like-iphone/79182/9 "2017-02-26T10:35:01Z")

</div>

I raised a developer case about this weeks ago and heard nothing back. Although I must admit I had not made the ‘required value’ connection. One of the issues is as stated above. Smartthings will show a message saying please enter all required values, yet all the values show up in blue as entered. I once tried removing and replacing all the values one by one, but I still got the error message at the end. I could have missed a value but there were 30 or more of them which made it a right pain. And while I was capable of doing it, I was certain a basic user would struggle.

---

<div class="post-metadata">

**Author:** ![Alwas](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@Alwas](https://community.smartthings.com/u/Alwas)\
**Post date:** [February 27, 2017, 12:26pm UTC](https://community.smartthings.com/t/feature-request-allow-android-to-process-defaultvalue-for-inputs-like-iphone/79182/10 "2017-02-27T12:26:03Z")

</div>

> [@\[RELEASE\] Fibaro Dimmer 2 (FGD-212) - Advanced DTH (V2)](https://community.smartthings.com/t/release-fibaro-dimmer-2-fgd-212-advanced-dth-v2/79126/20):
>
> I would really like someone from SmartThings to explain to me why they have a personal vendetta against android users. They must see posts here every week of new users complaining about “spinning wheels”, “you are not authorized” and ST app meltdowns, surely. I updated one of dimmers to this new exciting DH, pressed edit then I get a blank screen and the whole ST app crashes and starts again from the main screen. I did this 3 times just to be sure. I went into the IDE and manually set the default parameters, from another dimmer, it’s still not working, there were some new parameters left blank, because I don’t know what to put in there. So I’ve got back to a previous working DH. Maybe it’s better to put all that default parameters back in, and let everyone with an Android just fend for th…
