Adjustments for new Todoist API

This commit is contained in:
2025-12-23 22:16:21 -05:00
parent 92adc64d72
commit d091cadacf
3 changed files with 43 additions and 12 deletions

View File

@@ -65,11 +65,11 @@ calendar:
rest_command:
todoist:
method: post
url: 'https://api.todoist.com/sync/v9/{{ url }}'
url: 'https://api.todoist.com/api/v1/{{ url }}'
payload: '{{ payload }}'
headers:
Authorization: !secret todoist_api_token
content_type: 'application/x-www-form-urlencoded'
content_type: 'application/x-www-form-urlencoded'
recorder:
db_url: !secret mariadb_url

View File

@@ -90,17 +90,33 @@ input_datetime:
sensor:
- platform: rest
name: Kallen Tasks
unique_id: 77045665-9222-4a6b-851f-6d9b50110107
method: GET
resource: 'https://api.todoist.com/sync/v9/projects/get_data'
resource: 'https://api.todoist.com/api/v1/projects/2285969005/full'
headers:
Authorization: !secret todoist_api_token
Accept: application/json
value_template: '{{ value_json.project.id }}'
json_attributes:
- project
- tasks
- sections
scan_interval: 60
- platform: rest
name: Kallen Tasks Comments
unique_id: ae3178ad-439a-49f7-8c56-2fa866afaba5
method: GET
resource: 'https://api.todoist.com/api/v1/comments'
params:
project_id: 2285969005
headers:
Authorization: !secret todoist_api_token
value_template: '{{value_json[''project''][''id'']}}'
Accept: application/json
value_template: '{{ value_json.results | length }}'
json_attributes:
- project
- items
scan_interval: 30
- results
scan_interval: 60
automation:
- id: 94b57d79-efe0-4f34-b5e3-baeaa5eea9f4

View File

@@ -189,17 +189,32 @@ input_select:
sensor:
- platform: rest
name: Home Tech
unique_id: 83f76f0c-d49c-407f-ad99-57d5896dac93
method: GET
resource: 'https://api.todoist.com/sync/v9/projects/get_data'
resource: 'https://api.todoist.com/api/v1/projects/2285967948/full'
headers:
Authorization: !secret todoist_api_token
value_template: '{{ value_json.project.id }}'
json_attributes:
- project
- tasks
- sections
scan_interval: 60
- platform: rest
name: Home Tech Comments
unique_id: 93e6b1c1-8e92-423f-ad56-369e9bb86820
method: GET
resource: 'https://api.todoist.com/api/v1/comments'
params:
project_id: 2285967948
headers:
Authorization: !secret todoist_api_token
value_template: '{{value_json[''project''][''id'']}}'
Accept: application/json
value_template: '{{ value_json.results | length }}'
json_attributes:
- project
- items
scan_interval: 30
- results
scan_interval: 60
# template:
# - binary_sensor: