Shopping list template

Shopping List Template (stores in a String item; optional Telegram send)

I built a HABPanel Template shopping list. The list is stored locally in one String item and can optionally be sent via Telegram. You only need the template and three String items: BringList, Telegram_1, and Telegram_2.
The UI text is in Dutch, but it’s easy to translate with AI.

You can see scrollbars in this desktop screenshot, but on a wall-mounted tablet (fullscreen/kiosk) they’re not visible

What it does

  • HABPanel Template with categories, search, quick add, delete, clear.

  • Persists the list in a String item (no external storage).

  • Optional: send the current list to two Telegram chats.

Requirements

  • openHAB 4/5

  • HABPanel enabled

  • (Optional) Telegram binding if you want the send feature

Items

String BringList   "Bring List"
String Telegram_1  "Telegram target 1"
String Telegram_2  "Telegram target 2"

Telegram (one bot, two chats)

Thing:

Thing telegram:telegramBot:myBot [
  botToken="YOUR_BOT_TOKEN",
  chatIds="123456789,-987654321"
]

Rules (note the L suffix → chat IDs must be long):

val String BOT_UID   = "telegram:telegramBot:myBot"
val long   CHAT_ID_1 = 123456789L
val long   CHAT_ID_2 = -987654321L

rule "Stuur lijst naar Telegram 1"
when
  Item Telegram_1 received command
then
  val text = receivedCommand.toString.trim
  if (text.isEmpty) return
  val tg = getActions("telegram", BOT_UID)
  tg.sendTelegram(CHAT_ID_1, "🧾 Boodschappenlijst:\n• " + text.replace(", ", "\n• "))
end

rule "Stuur lijst naar Telegram 2"
when
  Item Telegram_2 received command
then
  val text = receivedCommand.toString.trim
  if (text.isEmpty) return
  val tg = getActions("telegram", BOT_UID)
  tg.sendTelegram(CHAT_ID_2, "🧾 Boodschappenlijst:\n• " + text.replace(", ", "\n• "))
end


HABPanel (Template)

  • Add a Template widget to your dashboard.

  • Paste the template code.

shopping_list_template.txt (21.2 KB)

1 Like