I’m able to set the button colors, but when I exit the device and then come back to it, the colors often revert back to the color that is set in the styled button widget’s settings (but sometimes my new color is still set to the last firmware setting).
Is there some way keep these colors set to the last set value?
The about page in the app says version 3.4.1 (0)
I just downloaded the latest version from the app store which says 1.18
It shows the same intermittent behavior when opening a device (sometimes the colors will be correct and sometimes they revert back to the widget’s settings value).
Here is the total test sketch as suggested. Not much more since it is a modified example for testing only. Delays shouldn’t be normally used as John93 suggests, however in this test example, the program can be blocked since it has only 1 function.
I was really hoping someone from Blynk or Eugene of the iOS team would respond.
I think the language you’re using here is potentially somewhat confusing.
The syntax for the HTTP(S) REST API calls is totally different to the syntax used within a sketch when using the Blynk C++ library.
The two aren’t interchangeable, and when you’re using a C++ sketch the # symbol is required.
However, Eugene believes that the colour property isn’t being stored on the server, so it only takes effect when the property is updated and isn’t available to refresh the widget when the app is refreshed. This needs investigated and fixed, but once it is fixed the. You still need to be using the correct syntax in your sketch or API calls.
Thanks Pete for the reply. I’ll try to make things a bit clearer. I do understand that there is a difference between using the Blynk app and the HTTP(S) REST API.
In the case of using Blynk sketch, Oleksii correctly identified my issue. The color requires “#” and this cleared up my problem for that scenario. The code used is “Blynk.setProperty(V1, “color”, BLYNK_RED)” where BLYNK_RED is “#D3435C” with # preceding the numeric value.
However when using HTTP (I used your example code), when sending color with the #, the server does not store it at all as shown on the datastream. When using without the #, the color is stored in the datastream without the # which causes display problems as detailed originally.