# View Home-assistant in FarmOS

**URL:** <https://farmos.discourse.group/t/view-home-assistant-in-farmos/1287>\
**Category:** Using farmOS\
**Tags:** feature-request\
**Created:** [July 21, 2022, 12:42pm UTC](https://farmos.discourse.group/t/view-home-assistant-in-farmos/1287 "2022-07-21T12:42:29Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![pat](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/pat/32/1050_2.png) [@pat](https://farmos.discourse.group/u/pat)\
**Post date:** [July 21, 2022, 12:42pm UTC](https://farmos.discourse.group/t/view-home-assistant-in-farmos/1287/1 "2022-07-21T12:42:29Z")

</div>

@Farmer-Ed@mstenta  
Hi there…  
Is it possible to embed Home-assistant content in a hosted FarmOS?

---

<div class="post-metadata">

**Author:** ![Farmer-Ed](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/farmer-ed/32/662_2.png) [@Farmer-Ed](https://farmos.discourse.group/u/Farmer-Ed)\
**Post date:** [July 21, 2022, 6:07pm UTC](https://farmos.discourse.group/t/view-home-assistant-in-farmos/1287/2 "2022-07-21T18:07:13Z")

</div>

Anything is possible 😉

I do the exact opposite and have farmOS embedded in Home Assistant.

However maybe you should look at the work by @SirSundays

> **[GitHub - SirSundays/farm\_grafana\_integration: This module provides a basic...](https://github.com/SirSundays/farm_grafana_integration)**
>
> This module provides a basic integration of a Grafana instance into farmOS. - GitHub - SirSundays/farm\_grafana\_integration: This module provides a basic integration of a Grafana instance into farmOS.

This is for Grafana, but should be easily modified for Home Assistant, I’m not 100% sure how Home Assistant will behave in an i-frame, there may be some need to change X-frame options for HA, this was the case with running farmOS and Grafana in an iframe.

> No matter what URL you paste in, may it be Grafana or something else, that website will be displayed. In the background everything is done via iFrames.

> So feel free to use it for something else. Maybe you want to link a calendar or a Node-Red instance or something completly different. Be creative!

Edit:  
Looks like HA works in an i-frame since June 21 [Run Home Assistant in an iframe - #2 by Nick4 - Configuration - Home Assistant Community](https://community.home-assistant.io/t/run-home-assistant-in-an-iframe/309482/2)

2nd Edit 🤔 just realized you said hosted, I presume Farmier, that may complicate it a bit / need help from @mstenta.

---

<div class="post-metadata">

**Author:** ![pat](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/pat/32/1050_2.png) [@pat](https://farmos.discourse.group/u/pat)\
**Post date:** [July 21, 2022, 10:22pm UTC](https://farmos.discourse.group/t/view-home-assistant-in-farmos/1287/3 "2022-07-21T22:22:19Z")

</div>

Thanks for the input @Farmer-Ed. You’re helpful as always.  
Yep, I’m on hosted FarmOS.  
I can’t see any possibility out of the box. I guess it would require a module…

For a first step, I would like some sensor graphics in FarmOS. I see Graphana could work fine for this.  
Or maybe FarmOS inside HomeAssistant could work just as well  
🤔  
IFrame module for FarmOS would be cool tho…

---

<div class="post-metadata">

**Author:** ![Farmer-Ed](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/farmer-ed/32/662_2.png) [@Farmer-Ed](https://farmos.discourse.group/u/Farmer-Ed)\
**Post date:** [July 22, 2022, 7:01am UTC](https://farmos.discourse.group/t/view-home-assistant-in-farmos/1287/4 "2022-07-22T07:01:50Z")

</div>

AKAIK it won’t be out of the box yet…  
But graphs were part of 1.x and I think @paul121 might be working on this for 2.0, I think he may have been waiting on a Charts module dependency that is in the process of being updated for Drupal 9.

farmOS inside Home Assistant is simple but requires x-frame options to be changed to permit farmOS being viewed inside an iframe. This you would need to discuss with @mstenta as you won’t have the permissions and there may be a minor security concern for you with regards website spoofing if your instance can be displayed inside an iframe on any website.

Grafana could well work fine for your needs.  
And as far as I’m aware, the Grafana module above is essentially an i-frame module so it could work for other webapps like Home Assistant or Node-Red Dashboards although it may be a bit off being an approved module for Farmier.

Maybe a general IOT Dashboard module could be an idea?

I’ve added a feature-request tag to the thread as I think some implementation of this could be great.

Have you a local instance of farmOS too? Can be useful for experimenting with.

---

<div class="post-metadata">

**Author:** ![pat](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/pat/32/1050_2.png) [@pat](https://farmos.discourse.group/u/pat)\
**Post date:** [July 24, 2022, 8:48pm UTC](https://farmos.discourse.group/t/view-home-assistant-in-farmos/1287/5 "2022-07-24T20:48:01Z")

</div>

> [@Farmer-Ed](#):
>
> AKAIK it won’t be out of the box yet…  
> But graphs were part of 1.x and I think @paul121 might be working on this for 2.0, I think he may have been waiting on a Charts module dependency that is in the process of being updated for Drupal 9.

Yep. I briefly tested this in FarmOS 1 before I opted for 2.0. Would be nice to get that in 2.0 too.

> [@Farmer-Ed](#):
>
> Maybe a general IOT Dashboard module could be an idea?

I would like that a lot. It should be possible to automatically create observations logs when sensors report home that something has happened or a level is reached  
And maybe activity log with a due date.

I did setup a local FarmOS. Messed it up and did not find time to tinker with it again, but I see it could be fine for testing indeed.

Just scratching the surface yet. I have other software for crops and pig management, so ATM my need for FarmOS is sensor-stuff and Node-Red and manual logging og different events.  
Not even sure I need Home Assistant. I think it’s a “must try” 🙂

---

<div class="post-metadata">

**Author:** ![Farmer-Ed](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/farmer-ed/32/662_2.png) [@Farmer-Ed](https://farmos.discourse.group/u/Farmer-Ed)\
**Post date:** [July 25, 2022, 5:59am UTC](https://farmos.discourse.group/t/view-home-assistant-in-farmos/1287/6 "2022-07-25T05:59:51Z")

</div>

> [@pat](#):
>
> It should be possible to automatically create observations logs when sensors report home that something has happened or a level is reached  
> And maybe activity log with a due date.

Since you are already using Node Red, it is probably the easiest way to achieve all of that at the moment.

> [@pat](#):
>
> Just scratching the surface yet. I have other software for crops and pig management, so ATM my need for FarmOS is sensor-stuff and Node-Red and manual logging og different events

Does your other software packages have API’s, as well as the sensor stuff I’ve been using Node-Red to sync other databases and calendars with farmOS.

> [@pat](#):
>
> Not even sure I need Home Assistant. I think it’s a “must try” 🙂

Truthfully you don’t. I’m a big fan of Home Assistant and it is the basis of all of my home and farm automation, but if you just want to connect simple sensors to farmOS then Node-Red by itself is more than enough. Home Assistant does create a nicer user interface though especially for the home where other users want a dashboard with simple intuitive controls for heating and lighting and also great for integrating CCTV. Node-Red can also generate Graphs they are a little more of a pain to setup compared to a sensor managed by Home Assistant but if it is just graphs you want rather than controls then maybe Grafana is a better choice anyway, but I’ve no experience of it myself.

---

<div class="post-metadata">

**Author:** ![Farmer-Ed](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/farmer-ed/32/662_2.png) [@Farmer-Ed](https://farmos.discourse.group/u/Farmer-Ed)\
**Post date:** [July 25, 2022, 9:12am UTC](https://farmos.discourse.group/t/view-home-assistant-in-farmos/1287/7 "2022-07-25T09:12:46Z")

</div>

> [@pat](#):
>
> > [@Farmer-Ed](#):
> >
> > Maybe a general IOT Dashboard module could be an idea?
> 
> I would like that a lot

Hmmm…  
@pat you have me thinking now.  
I had considered trying to make a Farm Assistant variant of Home Assistant in the past, but was put off for 2 or possibly 3 reasons:

1. It would probably be a lot of work for little benefit, mostly re-skinning with an agri theme.
2. Home Assistants Development has too many frequent breaking changes making keeping a forked version in line a little more difficult. Also potentially less appealing to perspective users as an IOT solution in a live business use case.
3. Lack of necessary skills (But I’ve been working on that one)

I also found someone else actually beat me to it and took this path, but that project seems to have stalled, [Farm Assistant needs help - Third party integrations - Home Assistant Community](https://community.home-assistant.io/t/farm-assistant-needs-help/5166), [AgSense Consulting](https://www.facebook.com/agsensenz).

 ![image](https://global.discourse-cdn.com/free1/uploads/farm_os/original/1X/1e1402aad909f62eb76a8f159e90d83e34ecace4.jpeg)

 ![image](https://global.discourse-cdn.com/free1/uploads/farm_os/original/1X/b8a80ac7f69cf173ff532c5b0d7389700592175b.png)

But maybe a Node Red module with both flow programming and the dashboard accessible within farmOS would be the simplest way to go and cut out Home Assistant altogether.

In my current setup I now have 2 instances of Node-Red running.

1. Node-Red addon in Home Assistant, which is used for everything HA and sensor related including forwarding sensor data to farmOS if necessary.
2. On a separate Raspberry Pi I run farmOS, so I also installed Node-Red here and use it for automation within farmOS, connecting farmOS with other API’s, CSV uploading and a notification/calendar synchronization server. I separated it out as there were too many farmOS flows running on my HA instance and its easier to guarantee it is running while farmOS is.

I’m also working on a module to send log update events from farmOS to Node-Red or other services. [External notifications, webhooks, MQTT etc - #17 by Farmer-Ed](https://farmos.discourse.group/t/external-notifications-webhooks-mqtt-etc/1218/17)

Edit 1:

A poor MS Paint mockup

 ![image](https://global.discourse-cdn.com/free1/uploads/farm_os/original/1X/a15f9e78a5df56388c9ff6e467f97f0272f5ebcd.png)

Edit 2:

Perhaps with some further development of Node-Red nodes for farmOS this could also make a flow based alternative to creating quick forms and CSV importers more accessible?

---

<div class="post-metadata">

**Author:** ![Farmer-Ed](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/farmer-ed/32/662_2.png) [@Farmer-Ed](https://farmos.discourse.group/u/Farmer-Ed)\
**Post date:** [July 26, 2022, 9:44am UTC](https://farmos.discourse.group/t/view-home-assistant-in-farmos/1287/8 "2022-07-26T09:44:01Z")

</div>

A quick play with @SirSundays code this morning, (Nothing changed except labels).

 ![image](https://global.discourse-cdn.com/free1/uploads/farm_os/original/1X/1d2d21f36e30526f52e5294052cad90dc303d415.png)

 ![image](https://global.discourse-cdn.com/free1/uploads/farm_os/original/1X/038def9baadaac680869974110321a17af1570a8.png)

---

<div class="post-metadata">

**Author:** ![pat](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/pat/32/1050_2.png) [@pat](https://farmos.discourse.group/u/pat)\
**Post date:** [July 26, 2022, 9:55am UTC](https://farmos.discourse.group/t/view-home-assistant-in-farmos/1287/9 "2022-07-26T09:55:50Z")

</div>

> [@Farmer-Ed](#):
>
> Since you are already using Node Red, it is probably the easiest way to achieve all of that at the moment.

Yep. One less thing to manage.

> [@Farmer-Ed](#):
>
> Does your other software packages have API’s, as well as the sensor stuff I’ve been using Node-Red to sync other databases and calendars with farmOS.

I don’t think so. Pig management is purly local on phone and computer. (But does this exemplary well). So I see no need to put animals into FarmOS. But there are some management event logging in FarmOS. Waiting for the FieldKit there… Nothing to automate tho.

Using CropPLAN for crops. (Webbased) I also have a LogMaster installed in my tractors. It logs tractor hours at different fields/zones, and puts useage/cost in CropPLAN reports. For those who owns a fancy flashing tractor, it also logs fuel consumption and visualizes this in field maps.  
Gives me great detailed reports with little effort. I just have to enter what kind of work that’s done.  
This is actually a cool idea for an open source solution too. Could very vell be a FarmOS module.  
But that’s another story…

> [@Farmer-Ed](#):
>
> Truthfully you don’t. I’m a big fan of Home Assistant and it is the basis of all of my home and farm automation, but if you just want to connect simple sensors to farmOS then Node-Red by itself is more than enough. Home Assistant does create a nicer user interface though especially for the home where other users want a dashboard with simple intuitive controls for heating and lighting and also great for integrating CCTV. Node-Red can also generate Graphs they are a little more of a pain to setup compared to a sensor managed by Home Assistant but if it is just graphs you want rather than controls then maybe Grafana is a better choice anyway, but I’ve no experience of it myself.

I will try out HomeAssistant at some time, but maybe I’ll wait.  
I’ll consentrate on NodeRed.

> [@Farmer-Ed](#):
>
> But maybe a Node Red module with both flow programming and the dashboard accessible within farmOS would be the simplest way to go and cut out Home Assistant altogether.

Wow…  
I guess one would still need node-red up and running somewhere, and point that to the FarmOS instance? Hosted or not?  
Love the idea tho.

---

<div class="post-metadata">

**Author:** ![pat](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/pat/32/1050_2.png) [@pat](https://farmos.discourse.group/u/pat)\
**Post date:** [July 26, 2022, 9:59am UTC](https://farmos.discourse.group/t/view-home-assistant-in-farmos/1287/10 "2022-07-26T09:59:32Z")

</div>

> [@Farmer-Ed](#):
>
> A quick play with @SirSundays code this morning, (Nothing changed except labels).
> 
> ![image](https://global.discourse-cdn.com/free1/uploads/farm_os/original/1X/1d2d21f36e30526f52e5294052cad90dc303d415.png)

😍  
@mstenta Could this be done in a hosted setup?

---

<div class="post-metadata">

**Author:** ![Farmer-Ed](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/farmer-ed/32/662_2.png) [@Farmer-Ed](https://farmos.discourse.group/u/Farmer-Ed)\
**Post date:** [July 26, 2022, 10:08am UTC](https://farmos.discourse.group/t/view-home-assistant-in-farmos/1287/11 "2022-07-26T10:08:03Z")

</div>

> [@pat](#):
>
> Wow…  
> I guess one would still need node-red up and running somewhere, and point that to the FarmOS instance? Hosted or not?  
> Love the idea tho.

Yes, probably simplest if it is hosted. We will convince @mstenta offer it on Farmier yet 😉  
But Node-red is small and I believe you can host it on Oracles free cloud offering.

---

<div class="post-metadata">

**Author:** ![Farmer-Ed](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/farmer-ed/32/662_2.png) [@Farmer-Ed](https://farmos.discourse.group/u/Farmer-Ed)\
**Post date:** [July 26, 2022, 10:22am UTC](https://farmos.discourse.group/t/view-home-assistant-in-farmos/1287/12 "2022-07-26T10:22:19Z")

</div>

> [@pat](#):
>
> @Farmer-Ed @mstenta  
> Hi there…  
> Is it possible to embed Home-assistant content in a hosted FarmOS?

Just to answer the original question, in case anyone is interested, Home Assistant works within the iFrame too.

 ![image](https://global.discourse-cdn.com/free1/uploads/farm_os/original/1X/eef5ed15e0ba8e1497522f7d48ca2def19193053.png)

Will be useful for the Google calendar module I’ve been working on too.

 ![image](https://global.discourse-cdn.com/free1/uploads/farm_os/original/1X/5044f0f3106c21b1ab662ca9fa52b28643940bac.png)

---

<div class="post-metadata">

**Author:** ![mstenta](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/mstenta/32/4_2.png) [@mstenta](https://farmos.discourse.group/u/mstenta)\
**Post date:** [July 26, 2022, 11:58am UTC](https://farmos.discourse.group/t/view-home-assistant-in-farmos/1287/13 "2022-07-26T11:58:23Z")

</div>

@pat @Farmer-Ed I love the idea of offering Node Red hosting! But realistically I’m not in the position to figure that out in the near future. In the meantime, it sounds like there are existing options for Node Red hosting? Maybe it would be worth compiling a list of options in a dedicated thread?

I’d also be curious to learn more about the hosting considerations myself. Especially curious to understand what it looks like to host Node-Red for multiple users. User isolation, multiple instances, security, maintenance costs, etc etc are all things I would need to understand in order to offer it through Farmier.

---

<div class="post-metadata">

**Author:** ![Farmer-Ed](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/farmer-ed/32/662_2.png) [@Farmer-Ed](https://farmos.discourse.group/u/Farmer-Ed)\
**Post date:** [July 26, 2022, 12:18pm UTC](https://farmos.discourse.group/t/view-home-assistant-in-farmos/1287/14 "2022-07-26T12:18:43Z")

</div>

Thanks for the reply @mstenta, wasn’t really expecting the hosting of Node-Red on Farmier any time soon. I suppose the real question from @pat is what would it take to get an iframes module approved for Farmier?

---

<div class="post-metadata">

**Author:** ![mstenta](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/mstenta/32/4_2.png) [@mstenta](https://farmos.discourse.group/u/mstenta)\
**Post date:** [July 26, 2022, 12:36pm UTC](https://farmos.discourse.group/t/view-home-assistant-in-farmos/1287/15 "2022-07-26T12:36:57Z")

</div>

Ah sorry only somewhat following this. 🙂

> what would it take to get an iframes module approved for Farmier?

If you put something together I’d be happy to take a look!

---

<div class="post-metadata">

**Author:** ![Farmer-Ed](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/farmer-ed/32/662_2.png) [@Farmer-Ed](https://farmos.discourse.group/u/Farmer-Ed)\
**Post date:** [July 26, 2022, 1:05pm UTC](https://farmos.discourse.group/t/view-home-assistant-in-farmos/1287/16 "2022-07-26T13:05:43Z")

</div>

It’s Ok I know you are busy, so there is no panic,  
The Module in question is a Grafana module and is entirely the work of @SirSundays so maybe he’ll join the conversation at some stage, I was experimenting with it this morning and only changed the labels to suit Node-Red.

> **[GitHub - SirSundays/farm\_grafana\_integration: This module provides a basic...](https://github.com/SirSundays/farm_grafana_integration)**
>
> This module provides a basic integration of a Grafana instance into farmOS. - GitHub - SirSundays/farm\_grafana\_integration: This module provides a basic integration of a Grafana instance into farmOS.

Think I will be borrowing some of it though for my Google calendar module.

---

<div class="post-metadata">

**Author:** ![SirSundays](https://avatars.discourse-cdn.com/v4/letter/s/7feea3/32.png) [@SirSundays](https://farmos.discourse.group/u/SirSundays)\
**Post date:** [July 26, 2022, 1:40pm UTC](https://farmos.discourse.group/t/view-home-assistant-in-farmos/1287/17 "2022-07-26T13:40:15Z")

</div>

I was kinda following the discussion here 😃

I think it would be easy to modify the module so you can have a custom iframe accessible from the sidebar. The only thing that would need to change is to make the title customizable. Otherwise, I think it is basically ready to use.

---

<div class="post-metadata">

**Author:** ![Farmer-Ed](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/farmer-ed/32/662_2.png) [@Farmer-Ed](https://farmos.discourse.group/u/Farmer-Ed)\
**Post date:** [July 26, 2022, 1:47pm UTC](https://farmos.discourse.group/t/view-home-assistant-in-farmos/1287/18 "2022-07-26T13:47:02Z")

</div>

Yes, works great with Node-Red and a few other web apps that I tried, and the title is the only thing I have changed, probably not difficult to make customizable, would be nice to figure out the icon too.

well done by the way.

---

<div class="post-metadata">

**Author:** ![SirSundays](https://avatars.discourse-cdn.com/v4/letter/s/7feea3/32.png) [@SirSundays](https://farmos.discourse.group/u/SirSundays)\
**Post date:** [July 26, 2022, 1:48pm UTC](https://farmos.discourse.group/t/view-home-assistant-in-farmos/1287/19 "2022-07-26T13:48:56Z")

</div>

I can already give you an insight into Node-Red because I maybe will start hosting it together with Grafana for some clients (not for the university).

First: There is no real multi-user functionality. Every user can see every flow inside Node-Red. You can hide them but that´s it. Otherwise, every user needs to have their own instance. But is really project-dependent if this is breaking or not. So there is no user isolation in short.

It’s kinda easy to host multiple node-red`s together in one server. I made a script to do that for me and configure everything. We use it already for two years or so. I maybe will go on from that in the future and build a system around it. Here is the link to the documentation:  
[https://wiki.eolab.de/doku.php?id=user:jan001:nigdocu](https://wiki.eolab.de/doku.php?id=user:jan001:nigdocu)

Unfortunately, it is in german. But maybe Google Translate can help 😅

In the end, we had one subdomain and the instances were all linked with their path with help of NGINX.

I´m still not sure what the maintenance cost will be because I´m still not decided on VPS and making my own cloud or going directly over to something like AWS.

---

<div class="post-metadata">

**Author:** ![SirSundays](https://avatars.discourse-cdn.com/v4/letter/s/7feea3/32.png) [@SirSundays](https://farmos.discourse.group/u/SirSundays)\
**Post date:** [July 26, 2022, 1:49pm UTC](https://farmos.discourse.group/t/view-home-assistant-in-farmos/1287/20 "2022-07-26T13:49:44Z")

</div>

It´s nice to see how it helps other people 😃

[Next page](https://farmos.discourse.group/t/view-home-assistant-in-farmos/1287.md?page=2)
