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

[REST] How to send forecast states #3866

Closed
spacemanspiff2007 opened this issue Nov 8, 2023 · 6 comments
Closed

[REST] How to send forecast states #3866

spacemanspiff2007 opened this issue Nov 8, 2023 · 6 comments
Labels
enhancement An enhancement or new feature of the Core

Comments

@spacemanspiff2007
Copy link
Contributor

spacemanspiff2007 commented Nov 8, 2023

Now that #3597 is merged I'd like to use this feature through the RestAPI.

Sending historic values can be done through the persistence endpoint. (There was some discussion for rrd4j and mapdb but unfortunately it didn't result in a solution so it doesn't work for these two).

But how can I send future states to an item? Will there be a new forecast endpoint or is this some kind of special state I have to send to an item?

@spacemanspiff2007 spacemanspiff2007 added the enhancement An enhancement or new feature of the Core label Nov 8, 2023
@J-N-K
Copy link
Member

J-N-K commented Nov 8, 2023

Single values can already be stored using PUT /rest/persistence/items/MyItem?serviceId=influxdb&time=2024-01-01T12%3A00%3A00.000Z&state=OFF. This should work for past and future values. If it does not, that is a bug.

The web socket should probably be extended to process incoming ItemTimeSeriesEvent.

@spacemanspiff2007
Copy link
Contributor Author

Ah - that's good. Then there is nothing to do from my side.

The item will then automatically change to OFF on 2024-01-01 in your example?
Or is this a misunderstanding on my side?

How do I remove a future value?

The web socket should probably be extended to process incoming ItemTimeSeriesEvent.

Imho this should only concern the ItemStateEvent which is not of interest for me anyway.
The ItemStateUpdatedEvent will contain the correct state. Correct?
It still might make sense to support it though.

@spacemanspiff2007
Copy link
Contributor Author

@J-N-K Small ping in case you missed my questions

@J-N-K
Copy link
Member

J-N-K commented Nov 25, 2023

@spacemanspiff2007 Exactly, if you set the forecast strategy on the item.

At the time the state is restored an ItemStateUpdatedEvent is emitted.

@J-N-K
Copy link
Member

J-N-K commented May 5, 2024

Since #3889 websocket support the time series, so I bleibe this can be closed.

@J-N-K J-N-K closed this as completed May 5, 2024
@spacemanspiff2007
Copy link
Contributor Author

How can I remove a future value from the time series?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature of the Core
Projects
None yet
Development

No branches or pull requests

2 participants