Home Assistant Community

Integration method for particle.io?

#22

I’m going to try to write a 3rd party Add-in for Patriot (https://github.com/rlisle/Patriot). This should simplify adding Photon DIY devices to Home Assistant. I’m just starting on this, so I’m very much on the steep part of the learning curve. Does anyone have any suggestions for how to get ramped up quickly on creating Add-Ins?

#23

Just wanted to update this thread as it is the first one that comes up on Google when you search for photon and home assistant integration:

I ended up using a webhook integration between particle.io and Home Assistant and it was perfect (and simple!!).

I used an HTTP Sensor as the end point!

3 Likes
#24

It would be great if you could elaborate on this a bit, perhaps with an example?

#25

First of all you need to have your Home Assistant available from the Internet. (I wont elaborate on this as there are plenty of docs on the subject)

Next you need to create a long-lived access token in your Home Assistant user profile, click on your user at the very top left of your HA ui (yourhomeassistant.url/profile)

After that in your particle.io console go to the integrations page, and create a new Webhook:

Event Name: The name of the particle.io event you want to send to HA
Full URL: https://yourhomeassistant.url/api/states/sensor.nameofthesensorthatwillbecreated
Request Type: POST
Request Format: JSON
Device: pick the particle.io device that is sending that event
JSON:
{
“state”: “{{PARTICLE_EVENT_VALUE}}”,
“attributes”: {
“friendly_name”: “Friendly name of the sensor created in HA”
}
}

Headers:
{
“Content-Type”: “application/json”,
“Accept”: “application/json”,
“Authorization”: “Bearer INSERTTHELONGLIVEDTOKENYOUCREATEDEARLIER”
}

Enforce SSL: Yes

That’s it, you create one integration per metric you want to have from your particle sensor and you get a sensor in HA for each of them!

#26

Update: My particle.io Photons are all running my Patriot code which supports MQTT now. So it was very easy to use the HA MQTT component to send messages to the Photons. Currently all my Photons are only performing control actions (lights, curtains, fans) so that makes it easier. All my inputs are coming in from Smartthings sensors, so I had been using the smartthings-mqtt-bridge, but with the newer HA code I don’t need that. I’ve been away from HA for awhile, and it’s really great to see how far its come.