# How to convert Home Assistant yaml to Node Red format

**URL:** https://discourse.nodered.org/t/how-to-convert-home-assistant-yaml-to-node-red-format/76574
**Category:** General
**Tags:** home-assistant
**Created:** [15 March 2023 02:35 UTC](https://discourse.nodered.org/t/how-to-convert-home-assistant-yaml-to-node-red-format/76574 "2023-03-15T02:35:59Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![lysiong](https://avatars.discourse-cdn.com/v4/letter/l/cc9497/32.png) [@lysiong](https://discourse.nodered.org/u/lysiong)
#### Post date: [15 March 2023 02:35 UTC](https://discourse.nodered.org/t/how-to-convert-home-assistant-yaml-to-node-red-format/76574/1 "2023-03-15T02:35:59Z")

</div>

I recently found up that node red automation seem like more fast respond than Home Assistant automation & decided to transfer all home assistant automation to node red if possible. I come across the below home assistant automation which I can't figure up how to configure in node red. By the way, my node red is install inside home assistant so I get all the device & scene.

It do look like simple automation but I can't figure how to configure the node red switch. I consider myself as beginner in node red but intermediate knowledge in home assistant.

```auto
alias: Common bath 20W light ON - perform scene selection
description: ""
trigger:
  - platform: state
    entity_id:
      - light.common_bathroom_20w_light
    to: "on"
    for:
      hours: 0
      minutes: 0
      seconds: 2
condition: []
action:
  - if:
      - condition: time
        before: "23:30:00"
        after: "08:00:00"
    then:
      - service: scene.turn_on
        target:
          entity_id: scene.common_bathroom_20w_50_5500k
        metadata: {}
    else:
      - service: scene.turn_on
        target:
          entity_id: scene.common_bathroom_20w_25_5500k
        metadata: {}
mode: single

```

---

<div class="post-metadata">

### Author: ![lysiong](https://avatars.discourse-cdn.com/v4/letter/l/cc9497/32.png) [@lysiong](https://discourse.nodered.org/u/lysiong)
#### Post date: [15 March 2023 07:12 UTC](https://discourse.nodered.org/t/how-to-convert-home-assistant-yaml-to-node-red-format/76574/2 "2023-03-15T07:12:21Z")

</div>

I already figure out how to do it as below

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/5/15d5da237d83bafa70d278fa8da8fbd5d84f030b.png)

---

<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: [29 March 2023 07:13 UTC](https://discourse.nodered.org/t/how-to-convert-home-assistant-yaml-to-node-red-format/76574/3 "2023-03-29T07:13:19Z")

</div>

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