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

TimeseriesSubscriptionCmd field startTs doesn't work? #14

Open
sofiabukovskaya opened this issue Nov 10, 2023 · 0 comments
Open

TimeseriesSubscriptionCmd field startTs doesn't work? #14

sofiabukovskaya opened this issue Nov 10, 2023 · 0 comments

Comments

@sofiabukovskaya
Copy link

sofiabukovskaya commented Nov 10, 2023

I want to implement real-time data acquisition using a time filter (5 minutes or 10 minutes earlier from the current one). I wrote this kind of code:

final telemetryService = thingsBoardClient.getTelemetryService();
    final currentTime = DateTime.now();
    final startTime = currentTime.subtract(
      const Duration(minutes: 5),
    );

    final subscription = TelemetrySubscriber(
      telemetryService,
      [
        TimeseriesSubscriptionCmd(
          entityId: DeviceId(deviceId).id!,
          entityType: DeviceId(deviceId).entityType,
          startTs: startTime.millisecondsSinceEpoch,
        ),
      ],
    );
    

I receive device data in real time, but the problem is that the startTs parameter is ignored and the data does not arrive as I mentioned - 5 minutes earlier. If I need to use a different method or approach to obtain data from a certain time to now, I will be glad to hear help. In case if everything alright please look through my issue. I tested both IOS simulator and Android device
Many thanks!

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

1 participant