Send notification with entity value/templating?

Hi.
I try to make a mobile notification to send me a message when the there is trash collection the next day.
I have these sensors sensor.avfallsor_bio_xxx and so on that give me a number value as how many days until picup.
0 = today
1 = tomorrow
ect

I try to make a notification “Trash collection tomorrow” with data from these sensors, but cant find a way.
I am using the “call service” node with notify, maybe I need to add data in a node before? Tried function node with no luck.

I have this on my dashboard, If it is possible to make something like this in a notification its perfect:

type: markdown
content: >-
  - Bioavfall hentes {% if
  is_state("sensor.avfallsor_bio_xxx", "0") %}i
  dag{% elif
  is_state("sensor.avfallsor_bio_xxx", "1") %}i
  morgen{% else %}om {{
  states("sensor.avfallsor_bio_xxx") }} dager{%
  endif %}.

  - Metall og Glass hentes {% if
  is_state("sensor.avfallsor_metal_xxx", "0")
  %}i dag{% elif
  is_state("sensor.avfallsor_metal_xxx", "1")
  %}i morgen{% else %}om {{
  states("sensor.avfallsor_metal_xxx") }}
  dager{% endif %}.

  - Restavfall hentes {% if
  is_state("sensor.avfallsor_mixed_xxx", "0")
  %}i dag{% elif
  is_state("sensor.avfallsor_mixed_xxx", "1")
  %}i morgen{% else %}om {{
  states("sensor.avfallsor_mixed_xxx") }}
  dager{% endif %}.

  - Papp avfall hentes {% if
  is_state("sensor.avfallsor_paper_xxx", "0")
  %}i dag{% elif
  is_state("sensor.avfallsor_paper_xxx", "1")
  %}i morgen{% else %}om {{
  states("sensor.avfallsor_paper_xxx") }}
  dager{% endif %}.

  - Plastembalasje hentes {% if
  is_state("sensor.avfallsor_plastic_xxx", "0")
  %}i dag{% elif
  is_state("sensor.avfallsor_plastic_xxx", "1")
  %}i morgen{% else %}om {{
  states("sensor.avfallsor_plastic_xxx") }}
  dager{% endif %}.
title: Søppelhenting

image

Or even better, If I could output just what is collected tomorrow:

Tomorrow the following bins are emptied:

  • Paper
  • Glass

[{"id":"013a08cd94a6005b","type":"template","z":"120358abd7c22d30","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"{{ payload.attributes.friendly_name }}","output":"str","x":2020,"y":7840,"wires":[["2f774e380332441c"]]},{"id":"2f774e380332441c","type":"join","z":"120358abd7c22d30","name":"","mode":"auto","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":",","joinerType":"str","useparts":true,"accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":2158,"y":7840,"wires":[["465cb2a596e53957"]]},{"id":"465cb2a596e53957","type":"api-call-service","z":"120358abd7c22d30","name":"","server":"","version":5,"debugenabled":false,"domain":"notify","service":"phone","areaId":[],"deviceId":[],"entityId":[],"data":"{\t   \"title\": \"Tomorrow the following bins are emptied\",\t   \"message\": payload ~> $join(\"\\n\")\t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":2310,"y":7840,"wires":[[]]},{"id":"18cb9c177e9b7ae9","type":"inject","z":"120358abd7c22d30","name":"@04:00","props":[],"repeat":"","crontab":"00 04 * * *","once":false,"onceDelay":0.1,"topic":"","x":1692,"y":7840,"wires":[["443dbb357eb14ffe"]]},{"id":"443dbb357eb14ffe","type":"ha-get-entities","z":"120358abd7c22d30","name":"","server":"","version":1,"rules":[{"property":"entity_id","logic":"includes","value":"sensor.avfallsor_metal_xxx,sensor.avfallsor_mixed_xxx,sensor.avfallsor_paper_xxx,sensor.avfallsor_plastic_xxx","valueType":"str"},{"property":"state","logic":"is","value":"1","valueType":"str"}],"outputType":"array","outputEmptyResults":false,"outputLocationType":"msg","outputLocation":"payload","outputResultsCount":1,"x":1868,"y":7840,"wires":[["013a08cd94a6005b"]]}]

Thanks, but I get no results in the get entities node even if there is entities matching

Got it working with “template node”

I morgen hentes følgende avfall:
{% if is_state("sensor.avfallsor_bio_xxx", "1") %}• Bioavfall{% endif %}
{% if is_state("sensor.avfallsor_metal_xxx", "1") %}• Metall og glass{% endif %}
{% if is_state("sensor.avfallsor_mixed_xxx", "1") %}• Rest{% endif %}
{% if is_state("sensor.avfallsor_paper_xxx", "1") %}• Papp{% endif %}
{% if is_state("sensor.avfallsor_plastic_xxx", "1") %}• Plastembalasje{% endif %}

I forgot to change the output type of the get entities node to split.

The flow does what your other question asks where it only proceeds if at least one of the entities has a value of 1

https://community.home-assistant.io/t/continue-if-at-least-one-entity-has-specific-value/747803

I see, that “get entities” one, thanks :slight_smile: