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

Support response data for APIServer::send_homeassistant_service_call #2703

Open
olicooper opened this issue Apr 27, 2024 · 0 comments
Open

Comments

@olicooper
Copy link

olicooper commented Apr 27, 2024

Describe the problem you have/What new integration you would like

I would like to fetch weather forecast updates via the HA service call weather.get_forecasts. This returns a json response, but APIServer::send_homeassistant_service_call does not support returning a response. There is no other way to get weather forecasts in HA v2024.4 onwards so this is the only way forward unfortunately.

This will likely also need the request object to support other request keys such as target rather than just the data key.

Please describe your use case for this integration and alternatives you've tried:

In HA versions prior to v2024.4, you could subscribe to forecast updates, but this has been removed recently.

Additional context

Service documentation: https://www.home-assistant.io/integrations/weather#service-weatherget_forecasts

Example request:

service: weather.get_forecasts
data:
  type: daily
target:
  entity_id:
    - weather.my_weather_entity

Example response:

weather.my_weather_entity:
  forecast:
    - datetime: "2024-04-27T12:00:00+00:00"
      condition: sunny
      precipitation_probability: 12
      wind_bearing: NE
      temperature: 15
      wind_speed: 12
 ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant