# Home Assistant Value Templates in Node Red

**URL:** <https://discourse.nodered.org/t/home-assistant-value-templates-in-node-red/42466>\
**Category:** General\
**Created:** [11 March 2021 10:20 UTC](https://discourse.nodered.org/t/home-assistant-value-templates-in-node-red/42466 "2021-03-11T10:20:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![liminal](https://avatars.discourse-cdn.com/v4/letter/l/e95f7d/32.png) [@liminal](https://discourse.nodered.org/u/liminal)\
**Post date:** [11 March 2021 10:20 UTC](https://discourse.nodered.org/t/home-assistant-value-templates-in-node-red/42466/1 "2021-03-11T10:20:35Z")

</div>

Hey all,

I have a yaml home assistant automation that I want to convert to NR. But I'm unsure how to have NR do the value template checks?

Can a sequence be a named entity as it were, that can be referenced by other sequences?

this is my .yaml

```auto
alias: 'Motion: Morning Bathroom'
description: ''
trigger:
  - type: motion
    platform: device
    device_id: 9c689b630452da3f476181b33d1fa1b4
    entity_id: binary_sensor.bathroom_motion_sensor_motion
    domain: binary_sensor
condition:
  - condition: time
    after: '07:00'
    before: '11:00'
  - condition: template
    value_template: >-
      {{ ((as_timestamp(now()) | float) -
      (as_timestamp(state_attr('automation.motion_morning','last_triggered')) |
      default(0) | float)) > 36000.0 }}
  - condition: template
    value_template: >-
      {{as_timestamp(now()) -
      as_timestamp(states.automation.motion_morning_kitchen.attributes.last_triggered)|
      int >= 14400}}
action:
  - service: script.alexa_flash_briefing_volume
    data: {}
  - service: script.good_morning_bathroom
    data: {}
mode: single

```

---

<div class="post-metadata">

**Author:** ![mbonani](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mbonani/32/10631_2.png) [@mbonani](https://discourse.nodered.org/u/mbonani)\
**Post date:** [11 March 2021 13:02 UTC](https://discourse.nodered.org/t/home-assistant-value-templates-in-node-red/42466/2 "2021-03-11T13:02:41Z")

</div>

Try asking on the [Node-RED section](https://community.home-assistant.io/c/third-party/node-red/31) of the Home Assistant Community Forum 😉

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [25 March 2021 13:02 UTC](https://discourse.nodered.org/t/home-assistant-value-templates-in-node-red/42466/3 "2021-03-25T13:02:46Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
