From df4fff6911a8b2dee7d74ea1a81907eda23e255a Mon Sep 17 00:00:00 2001 From: Johannes <29555657+joBr99@users.noreply.github.com> Date: Fri, 29 Mar 2024 15:48:30 +0100 Subject: [PATCH] add docs for workaround script for appdaemon in ha 2024.04 --- docs/prepare_ha.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/docs/prepare_ha.md b/docs/prepare_ha.md index 495e0295..413429eb 100644 --- a/docs/prepare_ha.md +++ b/docs/prepare_ha.md @@ -93,3 +93,46 @@ Now, to install NSPanel Lovelace UI Backend with HACS, follow these steps: 6. A confirmation panel will appear, click on `Download`, and wait for HACS to proceed with the download 7. The Backend Application is now installed, and HACS will inform you when updates are available + +# Workaround for HomeAssistant 2024.04 +AppDaemon is using the old REST API that until AppDaemon moved on the the websocket API this woraround is needed to get weather forecast data from homeassistant. (https://github.com/AppDaemon/appdaemon/issues/1837) + +To get the forecast data in appdaemon, there is a script needed in homeassistant's script.yaml: + +```yaml +call_service_with_response: + description: Calls a service and returns its response to AppDaemon + fields: + call_id: + name: Call id + default: 1 + description: An id to uniquely identify the call + required: True + selector: + text: + service_name: + name: Service name + default: domain.some_service + description: The service to call + required: True + selector: + text: + service_data: + name: Service data + default: {} + description: Data to pass to the service + required: True + selector: + object: + sequence: + - service: "{{ service_name }}" + data: "{{ service_data }}" + response_variable: response + - event: call_service_with_response.finished # event name cannot be templated unfortunately + event_data: + call_id: "{{ call_id }}" + response: "{{ response }}" +``` + +![image](https://github.com/joBr99/nspanel-lovelace-ui/assets/29555657/ea646579-1287-491e-a1e8-5989c7c34b39) +