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

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

Open
mboarman opened this issue Sep 11, 2023 · 4 comments
Open

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

mboarman opened this issue Sep 11, 2023 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@mboarman
Copy link

mboarman commented Sep 11, 2023

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 mboarman added the bug Something isn't working label Sep 11, 2023
@LastEagle
Copy link

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"

@mboarman
Copy link
Author

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??

@grinstantin
Copy link
Owner

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.

@mboarman
Copy link
Author

mboarman commented Dec 15, 2023

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'  

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants