Creating readable push notifications

I’m working on a “bedtime” flow that locks the entire house and verifies if all contact sensors do not have an alarm status. But I need to construct a readable (Dutch) message, for example
Achterdeur: gesloten
Voordeur: gesloten
Garagedeur: open
Tuindeur: gesloten

“closed” or “open” is depending on the contact alarm status true or false. There are 2 issues here, one is which code to use to insert a carriage return into the text message and another, how to set the text variable based on a boolean variable. I know the math capabilities, but could not find anything related to constructing text variables. My impression is that sorting out these options in existing apps (More logic or similar) is too much programming just to set something simple as this. Or am I wrong here?

Peter

Peter,
I think this gets you started:
(It notifies only about open doors or windows, but that could be changed)

1 Like

Excellent! I was afraid that I needed to create a custom script, but looking at the posted thread it seems pretty straightforward. Thanks for yr quick reply!

1 Like

You don’t need scripts:

  • to add newlines, you probably have to use the web app; there, you can insert newlines using Shift-Enter
  • to show “open/gesloten” based on a tag, you can use some math(-ish) expressions

For reference, this is what the text part of that card looks like while editing:

Deur 1: {{ [Gedetecteerd] ? "open" : "gesloten" }}
Deur 2: {{ [Gedetecteerd] ? "open" : "gesloten" }}

(I’m using two distinct [Gedetecteerd] tags, one set to “Ja”, the other to “Nee”)

On my phone, it looks like this:

The only annoyance is that quotes are being shown. I haven’t found a way to remove them (but didn’t look very closely).

4 Likes

I’ve tried this, with and without spaces in the formula, both in push notifications and timeline, but always get it literally:
{{false?”open”:”closed”}}

What does the flow card look like (screenshot)?

Use normal quotes, not “smart” quotes.

These come straight from the keyboard, don’t know how else to enter them.

Perhaps it’s the rendering that makes them look like smart quotes, but they look suspicious. Try pasting this after the tag:

? "open" : "dicht"

You’re right, somehow on IOS/iPad both the on screen keyboard and the typecover are being smart-asses, both in the app and safari/web app. With plain quotes it works.

Ah, found it. There’s an option to get stupid quotes. You can decide which option you think is the stupid one :stuck_out_tongue_winking_eye:

1 Like