Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Current Beta]: App ignores user-defined icons #455

Closed
Boby71 opened this issue Oct 5, 2019 · 15 comments
Closed

[Current Beta]: App ignores user-defined icons #455

Boby71 opened this issue Oct 5, 2019 · 15 comments

Comments

@Boby71
Copy link

Boby71 commented Oct 5, 2019

Describe the bug
I do use custom icons (PNG format) and they are displayed correctly in the web interface. But not in the app. It almost looks like that the app ignores user-defined icons in the app - but not all of them, only certain (maybe if there is a predefined icon available?)

To Reproduce
Steps to reproduce the behavior:
Try to use custom icons for a) elements which have predefined icons (e.g. "alarm") and b) for items which don't have predefined icons (e.g. "pool")

Expected behavior
I expect the app to render the same icons as I can see in the web frontend

Screenshots
oh2_dark_PC
oh2_dark_ios
oh2_bright

Desktop (please complete the following information):

  • Version 2.4.0-1

Smartphone (please complete the following information):

  • Device: iPhone8

Additional context
It does seem to be a general problem - no matter if I use dark mode or not.
"Clear image" cache didn't help.

@timbms
Copy link
Contributor

timbms commented Oct 5, 2019

I suppose that the icons are black with a transparent background. Resulting in pitch black icon fields when displayed in dark mode. Currently app in dark mode does not call themed icons.
Likely the web app request the icons in a dark theme (This is actually what is done in Charts).

@timbms
Copy link
Contributor

timbms commented Oct 5, 2019

@timbms
Copy link
Contributor

timbms commented Oct 5, 2019

@Boby71 : Can you please upload one of your icons as an example?

@Boby71
Copy link
Author

Boby71 commented Oct 6, 2019

Hi,
it gets even better...on this screen I use four different items - and all of them have the icon "meter" defined. Three of them are being displayed correctly, one (the third meter icon) is being displayed differntly:
IMG_3617
Here's my "meter" icon:
meter.zip

Thanks,
Boby

@Boby71
Copy link
Author

Boby71 commented Oct 6, 2019

Here's the item definition:

// Waschmaschine
Switch Waschmaschine_Status "Power [%s]" {channel="mqtt:topic:mosquitto:shellyplug_waschmaschine:power"}
Number Waschmaschine_Watt_Aktuell "Verbrauch WM aktuell [%.1f W]" (gHaushaltsgeraete) {channel="mqtt:topic:mosquitto:shellyplug_waschmaschine:watts"}
Number Waschmaschine_Watt_Info {channel="mqtt:topic:mosquitto:shellyplug_waschmaschine:watts"}
Number Waschmaschine_Verbrauch {channel="mqtt:topic:mosquitto:shellyplug_waschmaschine:energy"}
Number Waschmaschine_Verbrauch_kWh "Verbrauch WM kummuliert [%.1f kWh]"

// Trockner
Switch Trockner_Status "Power [%s]" {channel="mqtt:topic:mosquitto:shellyplug_trockner:power"}
Number Trockner_Watt_Aktuell "Verbrauch TR aktuell [%.1f W]" (gHaushaltsgeraete) {channel="mqtt:topic:mosquitto:shellyplug_trockner:watts"}
Number Trockner_Watt_Info {channel="mqtt:topic:mosquitto:shellyplug_trockner:watts"}
Number Trockner_Verbrauch {channel="mqtt:topic:mosquitto:shellyplug_trockner:energy"}
Number Trockner_Verbrauch_kWh "Verbrauch TR kummuliert [%.1f kWh]"

And here's the sitemap:

Text item=Dummy label="Haushaltsgeräte" icon="Waschmaschine"
{
// Waschküche Keller
Text item=Dummy label="Waschküche" icon="Waschmaschine"
{
Frame label="Waschmaschine" icon="Waschmaschine"
{
Switch item=Waschmaschine_Status mappings=[ON="ON",OFF="OFF"]
Text item=Waschmaschine_Watt_Aktuell
Text item=Waschmaschine_Verbrauch_kWh
}
Frame label="Trockner" icon="Trockner"
{
Switch item=Trockner_Status mappings=[ON="ON",OFF="OFF"]
Text item=Trockner_Watt_Aktuell
Text item=Trockner_Verbrauch_kWh
}
Frame label="Diagramm"
{
Switch item=ChartScale10 label="Zeitraum" mappings=[1="H", 2="T", 3="W", 4="M", 5="Y"] icon="chart"
Chart item=gHaushaltsgeraete period=h refresh=10000 service="rrd4j" visibility=[ChartScale10==1, ChartScale10==NULL]
Chart item=gHaushaltsgeraete period=D refresh=600000 service="rrd4j" visibility=[ChartScale10==2]
Chart item=gHaushaltsgeraete period=W refresh=3600000 service="rrd4j" visibility=[ChartScale10==3]
Chart item=gHaushaltsgeraete period=M refresh=604800000 service="rrd4j" visibility=[ChartScale10==4]
Chart item=gHaushaltsgeraete period=Y refresh=864000000 service="rrd4j" visibility=[ChartScale10==5]
}
}
}

@Boby71
Copy link
Author

Boby71 commented Oct 6, 2019

Sorry for the format, for some reason the formatter doesn't recognize my code as code...

@timbms timbms changed the title [Current Beta]: App ingores user-defined icons [Current Beta]: App ignores user-defined icons Oct 19, 2019
@Boby71
Copy link
Author

Boby71 commented Oct 25, 2019

Additional hint: The app only provides the wrong icons when being used on groups (text {} or frame{} level) AND when there is a default smarthome icon available (e.g. "alarm" or "camera"). If there is no (embedded?) default icon, the app displays the correct (user provided) icon. When I use e.g. "camera1" as name for my PNG file, everything works as expected. When I use "camera", the wrong display is being displayed.

@timbms
Copy link
Contributor

timbms commented Oct 25, 2019

Well that's strange. iOS app should ignore icons defined for frames.
if widget?.icon != nil, !((cell is NewImageUITableViewCell) || (cell is VideoUITableViewCell) || (cell is FrameUITableViewCell) || (cell is WebUITableViewCell)) {

Also OpenHAB is very clear:

Users may substitute their own icon for an icon from the default icon set by placing a file in the $OPENHAB_CONF/icons/classic/ folder with the same filename as the name of the icon being substituted.

Simple solution for user-defined icons: let them have a different name to the standard names.

@Boby71
Copy link
Author

Boby71 commented Oct 26, 2019

You're right - my mistake, frames don't work. Sorry about that. But on grouping items the problem is still existing.

Is there somewhere a list of those "predefined" icons and which names I have to avoid? I wasn't aware are some at all, since they are not visible in the icons folder where I can place my personal ones.

Personally, I have no problem in using different names for my icons - it's exactly what I'm doing now (e.g. "camera1" instead of "camera") as workaround. But that doesn't explain the different behaviour between the web GUI and the app GUI. IMHO OH2 should render the GUI as similar as possible. And showing different icons is not similar (at least for me).

If you want, I can close this thread - when I've changed all my affected icon names, my problem will be solved for me.

@weakfl
Copy link
Contributor

weakfl commented Oct 26, 2019

weakfl added a commit that referenced this issue Feb 9, 2020
Signed-off-by: weak <weak@fraglab.at>
@weakfl
Copy link
Contributor

weakfl commented Feb 9, 2020

Maybe this was just a caching issue (replacing stock icons). I noticed that the the "Clear Image Cache" setting was broken and didn't do anything.

timbms added a commit that referenced this issue Feb 12, 2020
- fix image cache purging, refs #455

Signed-off-by: Tim Müller-Seydlitz <timbms@gmail.com>
@timbms
Copy link
Contributor

timbms commented Feb 16, 2020

@weakfl : Can we close this issue?

@weakfl
Copy link
Contributor

weakfl commented Feb 16, 2020

I think so. We can still re-open if required.

@weakfl weakfl closed this as completed Feb 16, 2020
@timbms timbms reopened this Feb 16, 2020
@weakfl
Copy link
Contributor

weakfl commented Mar 14, 2020

@timbms Did you re-open on purpose?

@timbms
Copy link
Contributor

timbms commented Mar 15, 2020

No probably a mistake

@weakfl weakfl closed this as completed Mar 15, 2020
timbms added a commit that referenced this issue Apr 18, 2020
Signed-off-by: Tim Müller-Seydlitz <timbms@gmail.com>
timbms added a commit that referenced this issue Apr 18, 2020
Signed-off-by: Tim Müller-Seydlitz <timbms@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants