Make sensor data available publicly

Hello,
I’m posting this here because I wasn’t able to find it in the documentation/interface, and it seems like the user accounts are under development per that tab of the config area and this probably fits under that work.

I would like to be able to make certain sensor data (specifically a rain gauge) available to my neighbor. I don’t want to give him full access to all my devices, is there an obvious way to do this that I’m overlooking? If not, my request is to have granular enough control over user accounts that one could allow-list certain entities to be accessed only.

An alternative approach I’d be okay with, but also didn’t see mention/instructions on: is there a way to make any HA data available without authentication? I’d be willing to share it effectively “publicly” … I’m thinking of basically configuring a dashboard that would appear on the login page (before logging in). Or could even be like a default page people see when logging on to my wifi network (or I share with them, but don’t give them credentials, when they are visiting).

What I’m imagining doing in the short term: set up a 2nd instance of HA with my main instance piping the appropriate things to it via a MQTT message (pretty sure this will be one-directional) and then adding an account and letting him access that sub-instance only. This is obviously a bit heavy of a setup for a simple sensor so some built in features in this space would be cool.

I’d of course love to be wrong and have somebody point me to docs on how this might be easier to implement in the current version.
Thanks!
Owen

My search turned up this:

1 Like

Two more ideas:

If this sensor data is received via an MQTT broker, you can set up a second HA connected to that same broker.

If the neighbour has an iPhone, expose a second, limited HomeKit bridge. Probably the simpler or the two options.

1 Like

Hi,
In my opinion, the easiest way is to create non admin user for neighbor, create view with all you want to show to neighbor and restrict views visibility to this view only.
Regards,

1 Like

Public Folders sounds interesting but doesn’t look to include HA API/view access? Just sharing resources?

It’s unfortunately not MQTT already otherwise that would be super handy (and maybe some of my sensors would be eventually, that would be really nice, but mapping them shouldn’t be too hard, though I haven’t tried yet.)

2nd HomeKit Bridge is a creative one I totally overlooked! This might work.

The views approach sounds like about exactly what I need, but unfortunately is “opt-out” instead of “allow list/opt-in”, meaning I need to create a non-admin user and remove them from all other views, and remember to remove them every time I make a new view. It’s not obvious to me then what the security implications of this are (do HA users get access to anything beyond the views they are added to).

Here is a screenshot showing how to get to that settings as it was a bit hard to find for a minute:

To narrow my feature request (if this feels like the right approach, I’m not sure it’s great from a UX point of view) it would be:

  • Allow a “guest” level user to be created, that initially gets access to nothing (and defaults to no visibility in all existing/new views, if that is a sufficient way to gate access from a security perspective), with the ability to grant access to entities on a one by one basis.

Perhaps user:entity security controls is overkill/requires some re-architecture, but seems like it will eventually be required (to solve other problems like accidentally turning off all the lights in the house by a new-voice-user, or kids fooling around with things, etc).

What about Google sheets?
That can be shared I believe (?).
All you need to do is set up an automation to send the new data to a spreadsheet and the neighbor can open the document and have a look at it.

And as a bonus this keeps timestamps and history making it easy to graph data later for a year.

1 Like

Ahh super interesting as well, Sheets looks like a nice solution from a security point of view as I don’t need to open anything up.

1 Like

Yep, and it’s not that hard to set up.
I honestly believe it’s on par or less work than the other suggestions here.

1 Like

The docs say you can include an index.html file in the directory and it will display that.

You will need to either save the sensor to a file (file notifier integration) or use the Home Assistant API to get the sensor into the web page you write.

Google sheets would be easier.

1 Like

Thanks! yeah I might look into that eventually to make it more polished, but as people have been thinking, the Sheets integration was easy and seemed to work well.

In case anyone is curious to monitor the upcoming rain in the Santa Cruz mountains:

I might stick some other sensors in there later on.