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

Rain live gauge #137

Closed
c0by85 opened this issue Jan 13, 2024 · 3 comments
Closed

Rain live gauge #137

c0by85 opened this issue Jan 13, 2024 · 3 comments

Comments

@c0by85
Copy link
Contributor

c0by85 commented Jan 13, 2024

hi,

how can i add the rain from the current day as a livegauge? my previous attempts were unsuccessful. the gauge remains at 0.
the same might be necessary for the rain rate.

[LiveGauges]
    live_gauge_items = rain
    [[rain]]
        payload_key = rain_mm 
        minvalue = 0
        maxvalue = 50
        splitnumber = 10
        aggregateType = sum
        aggregate_interval = 86400
        lineColor = '#428bca'
        lineColorUntil = maxvalue
        decimals = 1
        heatMapEnabled = false
@mKainzbauer
Copy link
Collaborator

LiveGauges don't support aggregation by today. You can either display the latest database value of a certain obs_type, or a value that comes in per MQTT, defined by the payload_key. If you hardware supports something like day_rain, you could specify it in the payload_key, if you have MQTT enabled.

There are probably other, more or less quirky workarounds to achieve this. I'd note this as a future enhancement for upcoming versions.

BTW, which version are you on? The current version comes with 24h/today's rain in the station info. If you are on the current version, does this fit your needs? You might have to adapt your configs or upgrade to the latest version.
image

@c0by85
Copy link
Contributor Author

c0by85 commented Jan 13, 2024

Ok, thx. I wanted or have minimized your skin to the gauges for a (better) mobile view.

image

@mKainzbauer
Copy link
Collaborator

mKainzbauer commented Jan 13, 2024

With the latest commit 81d991b you can configure a gauge like this:

[LiveGauges]
    live_gauge_items = rain
    [[rain]]
        payload_key = rain_mm
        minvalue = 0
        maxvalue = 50
        splitnumber = 10
        aggregateType = sum
        aggregateInterval = 86400
        lineColor = '#428bca'
        lineColorUntil = maxvalue
        decimals = 1
        heatMapEnabled = false

Then you get a gauge that shows the sum of the amount of rain in the last 24h (not to confuse with the sum of today's rain). Showing the current rain rate already works out of the box, https://mielach.at/wetter-bergheim/index.html does this.

I haven't tested yet if the gauges also increases, when there is rain_mm in the loop. Maybe it doesn't behave correctly, if so, just delete the payload_key. And let me know!

Another limitation is: when aggregateInterval is greater than the timespan in [JSONGenerator] (converted from hours to seconds), the aggregateInterval is limited to timespan x 3600

[JSONGenerator]
    timespan = 27

So in this case, configuring aggregateInterval greater than 97200, will only show the sum of the last 97200 seconds.

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

2 participants