Closed doudz closed 1 year ago
it's for recording sensors currently. I can make it for Energy as well if you found it useful.
oh ok it can be useful since there is data missing...
no more error but it doesn't seems to work but maybe I'm wrong ?
Service added in v0.22.1
Thanks ! But could you please tell how it works ? I tried the following to retrieve missing data but it does nothing...
Turn on debug logs for the time of service call and check: It should try to fetch data page by page until it'd find date you want.
Hi
I tried
2023-04-06 20:16:08.044 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [139791145465792] Received {'type': 'execute_script', 'sequence': [{'service': 'bosch.fetch_recordings_sensor_range', 'data': {'uuid': '101027819', 'day': '2023-03-06', 'statistic_id': 'sensors:ehwenergy_hot_waterexternal'}}], 'id': 42}
2023-04-06 20:16:08.046 INFO (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Running websocket_api script
2023-04-06 20:16:08.047 INFO (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Executing step call service
2023-04-06 20:16:08.048 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=bosch, service=fetch_recordings_sensor_range, service_data=uuid=101027819, day=2023-03-06, statistic_id=sensors:ehwenergy_hot_waterexternal>
2023-04-06 20:16:08.049 DEBUG (MainThread) [custom_components.bosch.services] Performing sensor update on service request. UUID: 101027819
2023-04-06 20:16:08.050 DEBUG (MainThread) [custom_components.bosch] Next update of 1-hour sensors scheduled at: 2023-04-06 21:06:00+02:00
2023-04-06 20:16:08.051 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [139791145465792] Sending {"id":42,"type":"result","success":true,"result":{"context":{"id":"01GXBWGXKD3SJ3FYFYSEWX9YN5","parent_id":null,"user_id":"82dec7e7b0f54de399b80bf36264fa89"}}}
2023-04-06 20:16:08.052 DEBUG (Recorder) [homeassistant.components.recorder.core] Processing task: EventTask(event=<Event call_service[L]: domain=bosch, service=fetch_recordings_sensor_range, service_data=uuid=101027819, day=2023-03-06, statistic_id=sensors:ehwenergy_hot_waterexternal>)
and that's all... I don't see any request to history
Trying to use fetch_recordings_sensor_range I got the following error