mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-19 22:24:15 +01:00
add docs for workaround script for appdaemon in ha 2024.04
This commit is contained in:
@@ -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 }}"
|
||||
```
|
||||
|
||||

|
||||
|
||||
|
||||
Reference in New Issue
Block a user