openhab-core
openhab-core copied to clipboard
[REST] How to send forecast states
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?
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.
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.
@J-N-K Small ping in case you missed my questions
@spacemanspiff2007 Exactly, if you set the forecast strategy on the item.
At the time the state is restored an ItemStateUpdatedEvent is emitted.
Since #3889 websocket support the time series, so I bleibe this can be closed.
How can I remove a future value from the time series?