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

Some of meter logic seems to be 'wonky'? #72

Closed
iMiMx opened this issue Oct 12, 2023 · 25 comments · Fixed by #94
Closed

Some of meter logic seems to be 'wonky'? #72

iMiMx opened this issue Oct 12, 2023 · 25 comments · Fixed by #94

Comments

@iMiMx
Copy link

iMiMx commented Oct 12, 2023

End up with some strange meters, I don't think it's just browser caching:

Far-end shows as coloured, when it shouldn't - and you end up with a mix of red and green

image

Checked with the latest Beta5 release.

@Olen
Copy link
Owner

Olen commented Oct 12, 2023

Thanks, I'll look into it.

I don't have a full picture of the TS-code yet, so maybe @marcokreeft87 is able to shed som light on this too.

@marcokreeft87
Copy link
Contributor

marcokreeft87 commented Oct 12, 2023

Hmm this was working in the version I delivered Screenshot_20231012_120928_Home Assistant.jpg

@Olen
Copy link
Owner

Olen commented Oct 12, 2023

It seems to work most of the time, but I have seen the same occational glitches, that goes away again after some time.

@marcokreeft87
Copy link
Contributor

Maybe the getdata is called too often?

@marcokreeft87
Copy link
Contributor

I tried some fixes for the width of the meters, but some labels might be just too big

image

@iMiMx
Copy link
Author

iMiMx commented Oct 12, 2023

The prior version loses the units, when needed, it seems - screenshot from mobile app:

IMG_4317

@marcokreeft87
Copy link
Contributor

Ah that helps, lets try that :)

@marcokreeft87
Copy link
Contributor

marcokreeft87 commented Oct 12, 2023

I've made a PR, it already better that the previous version. But I can't get all bars to be the same width when one of the labels is bigger. Constant percentages doesnt seem to be the solution here. Display flex is responsive, but maybe too responsive.. For the small card its working perfectly now tho

@cromelex
Copy link

Seeing some similar issues with the latest beta

image

@Olen
Copy link
Owner

Olen commented Oct 16, 2023

If you are able to catch this, please provide some more debug info (from javascript console).

@cromelex
Copy link

cromelex commented Oct 16, 2023

Hi Olen,

Sorry I am a layman - what do you you need exactly from the console?
I know how to get there but not sure what you want.
I have like 12 plants, so high likelihood of one of them showing the issue.
Just tell me what you need and I'll get the info from the console.

Edit: from what I can see, the elements are getting the wrong colour here.

<div class="attribute tooltip ">
            <div class="tip" style="text-align:center;"><!--?lit$012416503$-->illuminance: 3618.0 lx<br>(800 ~ 27000 lx)</div>
            <ha-icon></ha-icon>
            <div class="meter red">
                <span style="width: 100%;" class="bad"></span>
            </div>
            <div class="meter green">
                <span class="bad" style="width:10.755725190839694%;"></span>
            </div>
            <div class="meter red">
                <span class="bad" style="width:100%;"></span>
            </div>
            <span class="header"><span class="value"><!--?lit$012416503$-->3618.0</span>&nbsp;<span class="unit"><!--?lit$012416503$-->lx</span></span>
        </div>
<div class="attribute tooltip ">
            <div class="tip" style="text-align:center;"><!--?lit$012416503$-->conductivity: 826.0 µS/cm<br>(300 ~ 1000 µS/cm)</div>
            <ha-icon></ha-icon>
            <div class="meter red">
                <span style="width: 100%;" class="bad"></span>
            </div>
            <div class="meter green">
                <span class="bad" style="width:75.14285714285714%;"></span>
            </div>
            <div class="meter red">
                <span class="bad" style="width:100%;"></span>
            </div>
            <span class="header"><span class="value"><!--?lit$012416503$-->826.0</span>&nbsp;<span class="unit"><!--?lit$012416503$-->µS/cm</span></span>
        </div>

@IT-Fuzzi
Copy link

Hi,

I also experienced the same for a few weeks. Wanted to check if there is any update on the concern, or if there is something I could provide in terms of logs or configuration.

here is another example a few minutes later

Flower Card: v2023.10.5-beta2
Home Assistant Plant: v2023.10.0

Home Assistant 2023.10.5
Supervisor 2023.10.1
Operating System 11.1
Frontend 20231005.0 - latest

@Olen
Copy link
Owner

Olen commented Oct 27, 2023

I am not sure if this is visible in the logs, but creating a release with some more debug logging could probably reveal it.
I'll see if I am able to create a beta release with added debug output.

@IT-Fuzzi
Copy link

IT-Fuzzi commented Dec 4, 2023

Hi @Olen,
I kindly wanted to check if you had any time to look into that issue. Happy to provide some more debugging input if you let me know what you would require.

@IT-Fuzzi
Copy link

Not sure if that helps in the analysis, but it seems that for the parameter "soil_moisture" I'm not facing that kind of issue. This could also only be a coincidence. However, I was setting different values via the developer tool and haven't ever experienced any issue in the display of the "moisture" level.

@Olen
Copy link
Owner

Olen commented Jan 2, 2024

I pushed a new test-release. Not sure it fixes this, but I hope so.

It is hard to debug, as it only happens sometimes. If anyone experience this permanently - even with the latest flower-card.js, please provide some debug info and some output from the browser debugger to try to pinpoint what css attributes the different parts of the graph has.

@IT-Fuzzi
Copy link

IT-Fuzzi commented Jan 3, 2024

Thank you for looking into this. But I still have the same kind of issue as before even after upgrading to the latest v2024.1.0-beta4.
Attached please see some further logs.

image

CSS Attributes

@Olen
Copy link
Owner

Olen commented Jan 3, 2024

I just pushed a beta (5) with LOTS of debug info.
If you have this card by itself on a dashboard, what does the browser console say about your conductivity?
Max, Min, Value and Available?

@Olen
Copy link
Owner

Olen commented Jan 3, 2024

After looking at the code, I am especially interessted in what your "max" is

@IT-Fuzzi
Copy link

IT-Fuzzi commented Jan 3, 2024

Does that screenshot help? It seems that the needed variables/values for the evaluation are available and correct.
max / i is 1300.

image

@Olen
Copy link
Owner

Olen commented Jan 3, 2024

... but why?!?

u is clearly less than i

Why then is line 313 resulting in "bad" and line 316 resulting in "100%"?

Or is there some string-int conversion that fails here? But why only for certain measurements?
I could try to cast all the values to floats...

@Olen
Copy link
Owner

Olen commented Jan 3, 2024

Sorry for the betas - but now I cast all the values, so they should be ok.
Please test the latest vesion from master

@iMiMx
Copy link
Author

iMiMx commented Jan 4, 2024

Only limited testing for me so far, but I think you might have cracked it - much appreciated.

@Olen
Copy link
Owner

Olen commented Jan 4, 2024

Great.
I'll make another release then. Fingers crossed

@IT-Fuzzi
Copy link

IT-Fuzzi commented Jan 4, 2024

I can also confirm that the latest change seems to have fixed the issue. At least I haven’t experienced it since then.

Thank you again for fixing it 😊

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

Successfully merging a pull request may close this issue.

5 participants