firmware icon indicating copy to clipboard operation
firmware copied to clipboard

Home Assistant brainstorm

Open joshpirihi opened this issue 3 years ago • 8 comments
trafficstars

It'd be really cool to have a proper Home Assistant integration that allows for 2-way interaction between your home assistant instance and the mesh.

commence brain dump

The integration should:

  • register node positions within home assistant
  • allow messages to be sent to the mesh (broadcast or direct). Eg from an automation (garage door opens -> message sent to my meshtastic node)
  • handle incoming messages in some way (so you could message HA and ask it something. eg "report tank level" responds with "tank 1: 94% tank 2: 73%". query the state of any entity)
  • connect to the mesh via mqtt (to a gateway node mounted remotely and connected to mqtt), or via direct usb connection to a node
  • collect environmental plugin data, and publish as sensors within home assistant
  • allow control of the remote GPIO pins of nodes this would be so awesome
  • allow communication via the Serial Plugin
  • link to the gateway node's webUI, if applicable

The integration should not:

  • provide any wifi/network extension. Meshtastic does not have the bandwidth for this

joshpirihi avatar Jan 24 '22 02:01 joshpirihi

I've been pondering a similar idea: https://discord.com/channels/429907082951524364/524177279270780928/924048338666524692

I want to use Meshtastic as a transport layer for ESPHome API messages; something like this: image

My approach would not flash Meshtastic to the radios; rather, ESPHome would be flashed to the radio, with a Meshtastic component.

crossan007 avatar Jan 24 '22 13:01 crossan007

The Meshtastic protobuf defines a number of application port; with the idea that more may be added: https://github.com/meshtastic/Meshtastic-protobufs/blob/master/portnums.proto#L9

I am thinking about registering ESPHome as an application port, so that other "real Meshtastic" radios can still forward ("mesh") ESPHome packets

crossan007 avatar Jan 24 '22 13:01 crossan007

any idea what sort of bandwidth ESPHome uses? The issue would be by creating a wifi network, devices will generally expect more than a few bytes per second and I can see the mesh being swamped very very easily.

joshpirihi avatar Jan 24 '22 16:01 joshpirihi

Not totally sure, but it's all sensor data (I think wrapped in protobufs).

crossan007 avatar Jan 24 '22 17:01 crossan007

protobufs you say? an ESPHome application port number would be perfect

joshpirihi avatar Jan 24 '22 17:01 joshpirihi

I've been looking all over for an option that in my head was titled "Meshtastic... but with any sensors". Meshtastic+ESPHome would just be pure gold. Opens up a ton of possibilities. Exactly what I've been imagining to get set up across my parent's fruit orchards. I'm open to chipping in if I see somewhere I can help.

pete1450 avatar Jan 26 '22 03:01 pete1450

It sounds like a module for ESPHome that allows communications over some RF link (not wifi) is the sort of thing you're after. You could certainly write a module that's compatible with the meshtastic protocol, but at that point there doesn't seem much point in making it compatible - other meshtastic nodes won't be able to interact other than forwarding traffic.

The idea I was more leaning to is an integration in HA that gives HA visibility into and messaging access to the mesh, running on meshtastic nodes. In that instance you could certainly pull meshtastic temperature sensor data into HA, process somehow, and command meshtastic GPIO pins from HA. Would that go some way to solving your use case? What sort of sensors are you wanting to integrate here?

That said, I know very very little about ESPHome, and don't know if it's possible or feasible to add another transport layer to it. It could well be very easy!

joshpirihi avatar Jan 26 '22 06:01 joshpirihi

Seems to me like anything that is restricted to ESP only devices and really focused on WiFi not a great choice, the NRF52 chip is so much lower power it is a considerably better remote sensor node.

garthvh avatar Jan 27 '22 00:01 garthvh

This issue has been mentioned on Meshtastic. There might be relevant details there:

https://meshtastic.discourse.group/t/home-assistant-integration/378/6

geeksville avatar Nov 13 '22 22:11 geeksville