Hello,
I’d like to use the to-do list integration and display a list on a screen using ESPHome.
Like E-Ink TODO list.
Do you think this is possible?
Regards
Hello,
I’d like to use the to-do list integration and display a list on a screen using ESPHome.
Like E-Ink TODO list.
Do you think this is possible?
Regards
Is it a shot in the dark, or did you already try some things?
For now, I’m just asking how to get a todo list from ESPHome.
Well, the project you linked seems to do exactly that, so it’s unclear what you are actually asking for…
The project uses a rest integration to get a list from todoist.
To get the items from a Todo list that is already in ha, use the service todo.get_items, for example one of ours is stuff for the forthcoming grandchild, and the service call is
service: todo.get_items
target:
entity_id: todo.baby
data:
status:
- needs_action
- completed
Response
todo.baby:
items:
- summary: maternity pillow
uid: NTTyY_wak2kJQsOY1wBXoJ
status: needs_action
- summary: rocking chair
uid: JbzVGI-yEw3LYkGLb7gDt5
status: needs_action
- summary: drawers
uid: Kr5BOMrhk9tIZ2463un4wl
status: needs_action
- summary: changing table
uid: AuxfZbHi0AkIYRazul7-P-
status: needs_action
- summary: car seat
uid: LxrNWmTm0J0I0yrx728hL9
status: needs_action
- summary: buggy
uid: B3-_cYghUSwKnCuclG3m4O
status: needs_action
You can call any service from esphome.
First of all, I’d just like to display my list on the console to make sure that my list has been retrieved from HA. But there’s a syntax problem with the example given.
'.' is an invalid character for names. Valid characters are: abcdefghijklmnopqrstuvwxyz0123456789-_ (lowercase, no spaces).
INFO ESPHome 2024.3.0b1
INFO Reading configuration /config/esphome/todo-list.yaml...
Failed config
api: [source /config/esphome/todo-list.yaml:15]
encryption:
key: JS+SIL49enfizAJAXS04wFERN7uuWdAyBXU0utXq0oo=
services:
-
'.' is an invalid character for names. Valid characters are: abcdefghijklmnopqrstuvwxyz0123456789-_ (lowercase, no spaces).
service: todo.get_items
[target] is an invalid option for [0]. Please check the indentation.
target:
entity_id: todo.liste_dachats
[data] is an invalid option for [0]. Please check the indentation.
data:
status:
- needs_action
- completed
then:
logger.log: todo.get_items
esphome config
esphome:
name: todo-list
friendly_name: TODO list
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "JS+SIL49enfizAJAXS04wFERN7uuWdAyBXU0utXq0oo="
services:
- service: todo.get_items
target:
entity_id: todo.liste_dachats
data:
status:
- needs_action
- completed
then:
logger.log: "todo.get_items"
ota:
password: "4b359a10a60c6f661615eb63fa3d5943"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Todo-List Fallback Hotspot"
password: "0FCoWB5cSyjA"
captive_portal:
That is to create a service in home assistant to run code on the esp. i.e. this <
Native API Component — ESPHome>
You want homeassistant.service
https://esphome.io/components/api#homeassistant-service-action
Thanks for the explanation.
So is it possible to retrieve the list in a variable with a service call and store it into a variable?
switch:
- platform: gpio
pin: 25
id: relay
name: "switch"
on_turn_on:
- logger.log: "Switch Turned On!"
# https://esphome.io/components/api.html#homeassistant-service-action
- homeassistant.service:
# https://www.home-assistant.io/integrations/todo/
service: todo.get_items
target:
entity_id: todo.personal_tasks
variables:
my_variable: |-
return id(my_sensor).state;
- logger.log: my_variable