# Exporting nodered to home assistant yaml

**URL:** https://discourse.nodered.org/t/exporting-nodered-to-home-assistant-yaml/270
**Category:** General
**Created:** [21 May 2018 11:53 UTC](https://discourse.nodered.org/t/exporting-nodered-to-home-assistant-yaml/270 "2018-05-21T11:53:04Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![david\_c](https://avatars.discourse-cdn.com/v4/letter/d/3e96dc/32.png) [@david\_c](https://discourse.nodered.org/u/david_c)
#### Post date: [21 May 2018 11:53 UTC](https://discourse.nodered.org/t/exporting-nodered-to-home-assistant-yaml/270/1 "2018-05-21T11:53:05Z")

</div>

Hi. new to nodered so be patient please. I have it installed and running on a Rpi with Hasio. When I drag the nodes into the working area and deploy, how do I get the code into Hasio with the correct formatting, spaces etc.

Thanks

---

<div class="post-metadata">

### Author: ![Stwissel](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/stwissel/32/126_2.png) [@Stwissel](https://discourse.nodered.org/u/Stwissel)
#### Post date: [21 May 2018 13:25 UTC](https://discourse.nodered.org/t/exporting-nodered-to-home-assistant-yaml/270/2 "2018-05-21T13:25:21Z")

</div>

Hi David,

could you explain a little more what you would like to do. I sI presume you refer to: www.home-assistant io?

There are 3 nodes (e.g. [https://flows.nodered.org/node/node-red-contrib-home-assistant](https://flows.nodered.org/node/node-red-contrib-home-assistant) ) and a sample flow here: [https://flows.nodered.org/flow/d3439d33e85b76b5832ac2a0212ef567](https://flows.nodered.org/flow/d3439d33e85b76b5832ac2a0212ef567)

You could give it a try by installing the node and copy & paste the flow.

From what I saw in the description: the NodeRED integration isn’t about designing (design as in: floorplan) your home-assist, but to send and receive commands to automate things. Like an incoming message in NodeRED triggers a switch on/off of a light (e.g. Your router signals your departure from home to NodeRED and you switch off all lights).

Makes sense?

---

<div class="post-metadata">

### Author: ![rgerrans](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@rgerrans](https://discourse.nodered.org/u/rgerrans)
#### Post date: [21 May 2018 14:38 UTC](https://discourse.nodered.org/t/exporting-nodered-to-home-assistant-yaml/270/3 "2018-05-21T14:38:42Z")

</div>

Another option if you want to add one more level of abstraction and increase your flexibility is to use a MQTT broker as a communication bus off Node-Red then you can use it to communicate with HomeAssistant and other points of integration. This is assuming you are wanting to use Node-Red as your rules engine for HomeAssistant.

---

<div class="post-metadata">

### Author: ![david\_c](https://avatars.discourse-cdn.com/v4/letter/d/3e96dc/32.png) [@david\_c](https://discourse.nodered.org/u/david_c)
#### Post date: [22 May 2018 12:27 UTC](https://discourse.nodered.org/t/exporting-nodered-to-home-assistant-yaml/270/4 "2018-05-22T12:27:47Z")

</div>

I am taking baby steps with Nodred and have got it installed on the Pi with Home Assistant Hasio with the pallet and the node for HA. I think I have the idea of how to get the info out to the config Yamil file by just selecting all the nodes and exporting it to the clip/b, is that correct?  
after doing that the formatting (indenting) seems wrong. Any ideas or am I on the compleatly wrong track here and Nodered replaces the Yamil file. I have a MQTT broker installed.  
Thanks guys.

---

<div class="post-metadata">

### Author: ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)
#### Post date: [22 May 2018 12:31 UTC](https://discourse.nodered.org/t/exporting-nodered-to-home-assistant-yaml/270/5 "2018-05-22T12:31:28Z")

</div>

Unless I’m mistaken the Node-RED flow/code cannot be imported into Home Assistant.

What you can do is share data between HA and Node-RED.

Perhaps you could give us a slightly more in depth explanation of what you are trying to achieve.

---

<div class="post-metadata">

### Author: ![david\_c](https://avatars.discourse-cdn.com/v4/letter/d/3e96dc/32.png) [@david\_c](https://discourse.nodered.org/u/david_c)
#### Post date: [22 May 2018 12:38 UTC](https://discourse.nodered.org/t/exporting-nodered-to-home-assistant-yaml/270/6 "2018-05-22T12:38:01Z")

</div>

I am trying to achieve the automating of most of my home devices, lights on at sunset audio control and the like. I have done this to some degree with the Yamil files but would like a more graphic approach to rather than text based. So how do I set Nodred up to talk to H/A.

---

<div class="post-metadata">

### Author: ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)
#### Post date: [22 May 2018 12:47 UTC](https://discourse.nodered.org/t/exporting-nodered-to-home-assistant-yaml/270/7 "2018-05-22T12:47:56Z")

</div>

I’d start by looking at the nodes that @Stwissel suggested or looking into the approach that @rgerrans mentioned.

---

<div class="post-metadata">

### Author: ![rgerrans](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@rgerrans](https://discourse.nodered.org/u/rgerrans)
#### Post date: [22 May 2018 12:51 UTC](https://discourse.nodered.org/t/exporting-nodered-to-home-assistant-yaml/270/8 "2018-05-22T12:51:58Z")

</div>

@david_c This might help. This is a tutorial I put together when I used to be on OpenHab for how to use Node-Red as a replacement rules engine for OH (similar to what it sounds like you are trying to do for HomeAssistant) that I just reposted to these Forums.

> [@Node-RED as Replacement Rule Engine for OpenHab](https://discourse.nodered.org/t/node-red-as-replacement-rule-engine-for-openhab/298):
>
> Original thread is posted here - [https://community.openhab.org/t/node-red-as-alternative-rule-engine/29509](https://community.openhab.org/t/node-red-as-alternative-rule-engine/29509) “[Node-RED](http://nodered.org/) is a visual wiring tool for the Internet of Things.” From an Openhab perspective it a visual tool that can replace the builtin rules engine. There is a good discussion thread already running [here](https://community.openhab.org/t/node-red-as-a-rule-script-engine-for-openhab/14914) around Node-RED. The purpose of this tutorial is specifically how to replace the functionality of the Openhab rules engine with Node-RED utilizing @Peter\_De\_Mangelaere‘s [nodes](https://www.npmjs.com/package/node-red-contrib-openhab2) for eas…

---

<div class="post-metadata">

### Author: ![david\_c](https://avatars.discourse-cdn.com/v4/letter/d/3e96dc/32.png) [@david\_c](https://discourse.nodered.org/u/david_c)
#### Post date: [22 May 2018 13:52 UTC](https://discourse.nodered.org/t/exporting-nodered-to-home-assistant-yaml/270/9 "2018-05-22T13:52:10Z")

</div>

Thanks I will give it a go and post my results, be they good or bad.
