thingsboard / thingsboard

Open-source IoT Platform - Device management, data collection, processing and visualization.
https://thingsboard.io
Apache License 2.0
17.22k stars 5.08k forks source link

Are special custom time frames for dashboards possible? #11342

Closed apachler closed 1 month ago

apachler commented 1 month ago

Component

Description

Would it be possible to define custom time intervals for dashboards?

I need following 8h time frames:

Is this possible by configuration or code changes?

If code changes are needed, could you please point me the right direction? Would be nice to know the specific class that needs adoption.

Many thanks in advance!

Environment


Disclaimer

We appreciate your contribution whether it is a bug report, feature request, or pull request with improvement (hopefully). Please comply with the Community ethics policy, and do not expect us to answer your requests immediately. Also, do not treat GitHub issues as a support channel.

mykhailokornieiev commented 1 month ago

Hi You can try to implement it using Date-range-navigator widget. I was able to use 8:00 - 20:00 for each day. image image Or, you can either modify this widget or create the custom one for three different time frames. https://thingsboard.io/docs/user-guide/contribution/widgets-development/#timewindow-functions

apachler commented 1 month ago

Oh, wow, thanks for the fast response and great hints! I am going to give it a try this way...

apachler commented 2 weeks ago

Hmmm, i have now tried to implement the Date-range-navigator widget but it is not possible to define a custom interval. @mykhailokornieiev Any idea?

mykhailokornieiev commented 2 weeks ago

Since some time has already passed, I do not remember all the details. It seems that I managed to achieve the result as in the screenshot by setting the required interval on the widget and only then using the edit mod to change the time window and save it. After that, only the day changed, and the time frame was unchanged. If you need two or more such templates, then this widget will not suit you and you need to make a custom one.

apachler commented 2 weeks ago

ok thanks!