todoist-card icon indicating copy to clipboard operation
todoist-card copied to clipboard

[BUG] Unable to add or delete new items through the HA Card

Open mboarman opened this issue 1 year ago • 4 comments

I'm unable to add/delete any new items to the HA Card. It appears to work through Amazon Alexa but the Card just seems to hang. I received the follow log errors:

Logger: homeassistant.components.rest_command Source: components/rest_command/init.py:136 Integration: RESTful Command (documentation, issues) First occurred: 7:34:25 AM (7 occurrences) Last logged: 7:38:24 AM Error. Url: https://api.todoist.com/sync/v9/. Status code 404. Payload: b''

Logger: homeassistant.helpers.template Source: helpers/template.py:568 First occurred: 7:34:25 AM (14 occurrences) Last logged: 7:38:23 AM Template variable warning: 'payload' is undefined when rendering '{{ payload }}' Template variable warning: 'url' is undefined when rendering 'https://api.todoist.com/sync/v9/{{ url }}'

Logger: homeassistant.components.template.template_entity Source: components/template/template_entity.py:424 Integration: Template (documentation, issues) First occurred: September 9, 2023 at 9:35:49 PM (20 occurrences) Last logged: 7:35:25 AM

I'm running the latest HA Build: Home Assistant 2023.9.1 Supervisor 2023.08.3 Operating System 10.5 Frontend 20230908.0 - latest

mboarman avatar Sep 11 '23 11:09 mboarman

Add a post command to your configuration.yaml

rest_command: todoist: method: post url: "https://api.todoist.com/sync/v9/{{ url }}" payload: "{{ payload }}" headers: Authorization: !secret todoist_api_token content_type: "application/x-www-form-urlencoded"

LastEagle avatar Nov 21 '23 12:11 LastEagle

Add a post command to your configuration.yaml

rest_command: todoist: method: post url: "https://api.todoist.com/sync/v9/{{ url }}" payload: "{{ payload }}" headers: Authorization: !secret todoist_api_token content_type: "application/x-www-form-urlencoded"

Thanks for the reply....I already had that in my configuration.yaml so that wasn't causing the issue. However, today after upgrading to Home Assistant 2023.11.3 I get the following errors when adding or deleting items on the card:

Failed to call service rest_command/todoist. Service not found.

Looking in the developer tools section, I have the following services listed:

todo.add_item todo.remove_item todo.update_item todo.new_task

Am I the only one having issues??

mboarman avatar Nov 30 '23 01:11 mboarman

Hey! Sorry for late reply.

Please, show your configuration.yaml section that is related to this card (without sensitive information, of course). Tried to install this card from scratch - everything works as expected.

grinstantin avatar Dec 15 '23 11:12 grinstantin

Hey! Sorry for late reply.

Please, show your configuration.yaml section that is related to this card (without sensitive information, of course). Tried to install this card from scratch - everything works as expected.

No worries, here is my config:

sensor:
  - platform: rest
    name: To-do List
    method: GET
    resource: 'https://api.todoist.com/sync/v9/projects/get_data'
    params:
      project_id: 2284842733
    headers:
      Authorization: !secret todoist_api_token        
    value_template: '{{value_json[''project''][''id'']}}'
    json_attributes:
      - items
      - project
    scan_interval: 30

rest_command:
  todoist:
    method: post
    url: 'https://api.todoist.com/sync/v9/{{ url }}'
    payload: '{{ payload }}'
    headers:
      Authorization: !secret todoist_api_token  
      content_type: 'application/x-www-form-urlencoded'  

mboarman avatar Dec 15 '23 12:12 mboarman