Skip to content

How to get a response when using callService and calendar.list_events? #421

Open
@tonka3000

Description

@tonka3000

Hi,

I try to use callService to get the calendar events of an entity. I have an issue because I always get the error

{
  code: 'unknown_error',
  message: 'Service call requires responses but caller did not ask for responses'
}

The message make sense but I could not find a way to add the response variable as it is done on the service side. I either became an error from typescript or an error from the server that the key is not allowed.

How can I get response data via callService?

Here is my code snippet.

const rc = await callService(
    con,
    "calendar",
    "list_events",
    {
      duration: {
        hours: 96,
        minutes: 0,
        seconds: 0,
      },
    },
    { entity_id: "calendar.mytestcalendar" } 
  );

My Home Assistant instance is on 2023.9.2.

Thanks in advance
Michael

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions