This is a simple approach to create a todo list / check list within openhab. Although this is just a copy/paste from another topic, i think this shouldn’t be buried in that topic. Maybe this helps someone.
Define an empty group and a group which contaisn all todos.
Group:Switch:AND(ON,OFF) gTodo_List
Group gAllTodos
Define one or more rules which fill the todo-list (this example just fills the list every minute, you can use multiple rules / triggers, just as you like and need.
rule "fill Todo"
when
Time cron "0 * * * * ?"
then
for (item : gAllTodos.members)
{
item.postUpdate(OFF)
gTodo_List.addMember(item)
}
end
Create a single rule, which removes a todo from the group. If you need to do something special, you can do it here as well. If you need something special, you can create additional rules.
rule "remove Todo"
when
Member of gAllTodos changed from OFF to ON
then
Thread::sleep(300)
gTodo_List.removeMember(triggeringItem)
end
Add the group to the sitemap
sitemap Home label="Todo list" {
Frame {
Group item=gTodo_List
}
}
1.+2. in one or more *.items file in the items folder
3.+4. in one or more *.rules file in the rules folder
5. in a *.sitemap file in the sitemaps folder
Very Interesting,
Could a text file be read to create or enable the todo items, and therefore the labels be used from the text file,as I thing the ToDo system must be hardcoded ?