Particle Photon DH and Apps

I have some particle photons and want to add them as devices. Particularly relay controls devices. Any help is appreciated.

Particle's are just WiFi devices, from Hubitat viewpoint. They CAN be accessed via http(s) and Hubitat can make the calls. However, it needs an App to have that process become functional.

I've found them mentioned twice, so not much volume interest:

I have one, by the way, but it's not actively doing anything yet.

My first thought is they seem like the WeMo app where if they were polled, and a DH was there, then maybe they would follow along the same line of thinking. I am looking through the particle forums for some kind of lead.
I have one controlling my garage doors thru ifttt, and I have 2 more that I have used with a motor controller and another group of sensors. I like the control everything site and the hardware they have,

Yes, that's my similar thinking as well but they are just generic controllers that have completely wild things attached to turn them into more than a blinking blue light. And it's those things that will need the app.

There's a very lengthy thread for yet another general purpose controller:

And of course the highly similar Hubduino:

Since Arduino sketches are similar, this HubDuino, might be the route to port over. I honestly don't understand the love affair with Arduinos, I like the tiny form factor boards that I can hide in almost anything.

HubDuino/ST_Anything can run on something as tiny as a ESP-01 board. In fact, these days most users are not running on Arduino UNO or MEGA boards. Most are using ESP8266 variants and ESP32's.

1 Like

I have a couple of Arduino Nano's (came in a 3 pack, I needed one :slight_smile: ) Tiny Form Factor.

1 Like

Nano's aren't very useful these days. Too little RAM and the Ethernet connectivity is not all that practical. A NodeMCU ESP8266 is about the size of a nano, has built-in WiFi, a lot more memory and CPU power, and is only about $9. It does have fewer usable GPIO pins though... Always tradeoffs... :wink:

Parked in my Amazon wish list from a couple of months ago is:

I only need an extra day in my day...

1 Like

I don't know if the ESP8266 devices are able to mesh network. That is one of the things that I liked about Particle, as a company, is they seem to have a grasp on making things that are different, or follow a direction towards making anything connected. I am no way affiliated with them. I just like what I have been reading.

Can you explain this a little more? Do the Photons create their own WiFi mesh network? Or, if not WiFi, what mesh network protocol are they using?

From what I am able to comprehend, yes, they create their own device to device network, and depending on which item you purchase, it gives options for how they connect. ie. Boron, Argon, and Xenon All Particle Mesh devices support 802.15.4 Thread mesh networking with OpenThread. My understanding is the Boron is cellular to wifi, the argon is bluetooth, and the Xenon is wifi only. I was interested because I wanted to use the "cellular" model to wake up and be used as a WAN for sending requests, (in my case run a routine that would check for variables, and if all ok, start my generator and then the AC or Heat) I was going to use the other devices to control/report statuses and minimize my wiring and complexity in physical layout. All these devices are capable of speaking to each other natively.

1 Like

My understanding is:

The Xenon is simply a Mesh "player" -- it adds to a mesh, but it doesn't connect elsewhere.

The Argon and Boron are also Mesh "players" - but they have an additional radio to connect to somewhere else. Argon is WiFi and Boron uses cellular.

You could create a mesh of 10 Argons, but then you'd have paid more. You could have a mesh of 10 Xenons, but they wouldn't be wirelessly reachable.

In other words, the mesh portion is the same on all of them, with Xenon not having any external wireless portion.

I have a hacked together driver based on a device driver by Justin Wurth. Here is my bastardized version that is working for me.

// Copyright (c) <year>, <copyright holder>
// All rights reserved.

// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//     * Redistributions of source code must retain the above copyright
//       notice, this list of conditions and the following disclaimer.
//     * Redistributions in binary form must reproduce the above copyright
//       notice, this list of conditions and the following disclaimer in the
//       documentation and/or other materials provided with the distribution.
//     * Neither the name of the <organization> nor the
//       names of its contributors may be used to endorse or promote products
//       derived from this software without specific prior written permission.
//     * Redistribution of this software in source or binary forms shall be free
//       of all charges or fees to the recipient of this software.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

/**

 *  Spark Core

 *

 *  Author: Justin Wurth

 *  Date: 2014-09-19
/**
 * 
 *
 
 *
 */

 preferences {

    input("deviceId", "text", title: "Device ID")

    input("token", "text", title: "Access Token")

}


    metadata {
	   definition (name: "Spark/Photon WS2812b", namespace: "jjhtpc", author: "Justin Wurth") 
		{capability "Switch Level"
		capability "Color Control"
		capability "Color Temperature"
		capability "Switch"
        capability "Refresh"
        capability "Polling"
        attribute "colorName", "string"
	}
}

	// tile definitions
	
command "Red"

command "Green"

command "Brown"

command "Gigem"

command "Broncos"

command "effect6"


tiles {
standardTile("switch", "device.switch", width: 1, height: 1, canChangeIcon: false) {
			
	state "off", label: '${name}', action: "switch.on", icon: "st.Seasonal Winter.seasonal-winter-011", backgroundColor: "#ffffff"
			
	state "on", label: '${name}', action: "switch.off", icon: "st.Seasonal Winter.seasonal-winter-011", backgroundColor: "#79b821", iconColor: "#ffffff"
		
}

standardTile("refresh", "device.switch", inactiveLabel: false, decoration: "flat") {
        
	state "default", label:"", action:"refresh.refresh", icon:"st.secondary.refresh"
}		
     	
standardTile("Red", "device.Red") {
			
	state "Red", label: '${name}', action: "Red", icon: "st.Seasonal Winter.seasonal-winter-011", backgroundColor: "#d3ffd3", iconColor: "#ffffff"
}

standardTile("Green", "device.Green") {

	state "Green", label: '${name}', action: "Green", icon: "st.Seasonal Winter.seasonal-winter-011", backgroundColor: "#d3ffd3", iconColor: "#ffffff"
}

standardTile("Brown", "device.Brown") {
			
	state "Brown", label: '${name}', action: "Brown", icon: "st.Seasonal Winter.seasonal-winter-011", backgroundColor: "#d3ffd3", iconColor: "#ffffff"
}

standardTile("Gigem", "device.gigem") {
			
	state "Gigem", label: '${name}', action: "Gigem", icon: "st.Seasonal Winter.seasonal-winter-011", backgroundColor: "#d3ffd3", iconColor: "#ffffff"
}
       
standardTile("Broncos", "device.Broncos") {
			
	state "Broncos", label: '${name}', action: "Broncos", icon: "st.Seasonal Winter.seasonal-winter-011", backgroundColor: "#d3ffd3", iconColor: "#ffffff"
}

standardTile("effect6", "device.effect6") {
			
	state "effect6", label: '${name}', action: "effect6", icon: "st.Seasonal Winter.seasonal-winter-011", backgroundColor: "#d3ffd3", iconColor: "#ffffff"
}
       

//standardTile("color", "device.color") {
        	
//state "alert", label: '${name}', action: "tvdim", icon: "st.Lighting.light13", backgroundColor: "#ff0000", iconColor: "#ffffff"
       
//state "tvdim", label: '${name}', action: "moviedim", icon: "st.Lighting.light13", backgroundColor: "#d3d3d3", iconColor: "#ffffff"
 
//state "moviedim", label: '${name}', action: "alerts", icon: "st.Lighting.light13", backgroundColor: "#ffffff", iconColor: "#ffffff"
//}



controlTile("levelSliderControl", "device.level", "slider", height: 1, width: 1, inactiveLabel: false, range:"(0..100)") {
		state "level", action:"switch level.setLevel"
	}

controlTile("rgbSelector", "device.color", "color", height: 3, width: 3, inactiveLabel: false) {
		state "color", action:"setColor"
    }


                
main(["switch"])   
details(["switch", "Red", "Green", "Brown", "Gigem", "Broncos", "effect6","levelSliderControl", "refresh", "rgbSelector"])
	
}




def parse(String description) {
	log.debug "This device does not support incoming events"
	return null
}
def off(){
	put '0'
    sendEvent(name: "switch", value: "off" )
    log.debug "switch is off"
}

def on() {
	put '1'
	sendEvent(name: "switch", value: "on" )
    log.debug "switch is on"
}

def Red() {
	put '2'
    sendEvent(name: "switch", value: "on" )
    log.debug "this device is on Red"
}

def Green() {
	put '3'
    sendEvent(name: "switch", value: "on" )
    log.debug "this device is on Green"
}


def Brown() {
	put '4'
    sendEvent(name: "switch", value: "on" )
    log.debug "this device is on Brown"
}

def Gigem() {
	put '5'
    sendEvent(name: "switch", value: "on" )
    log.debug "this device is on Gigem"
}

def Broncos() {
	put '6'
    sendEvent(name: "switch", value: "on" )
    log.debug "this device is on Broncos"
}

def effect6() {
	put '7'
    sendEvent(name: "switch", value: "on" )
    log.debug "this device is on effect6"
}

def setColor(value) {
	log.debug "setColor: ${value.hue} and setSaturation: ${value.saturation}"
    def rgb = rgbToShieldRgb(value.red, value.green, value.blue);
}

def rgbToShieldRgb(r,g,b){
	r = r
    b = b
    g = g
    put "$r,$g,$b"
    log.debug "Switch set to $r,$g,$b"
}

def setLevel(value){
	call "$value"
    log.debug "$value"
    
}



def poll() {
	log.debug "Executing 'poll'"
	 checkStatus ()	
}

def refresh() {
	log.debug "executing 'refresh'"
	checkStatus()

}
def checkStatus(){
	
	httpGet(uri: "https://api.particle.io/v1/devices/${deviceId}/checkStatus1?access_token=${token}",
    	contentType: 'application/json',)
    {resp ->           
            log.debug "resp data: ${resp.data}"
            log.debug "result: ${resp.data.result}"
		sendEvent(name: "switch", value: "${resp.data.result}" )
	}
}


private put(led) {

    //Spark Core API Call

    httpPost(

        uri: "https://api.particle.io/v1/devices/${deviceId}/led",

        body: [access_token: token, command: led],  

    )

}

private call(dim) {

    //Spark Core API Call

    httpPost(

        uri: "https://api.particle.io/v1/devices/${deviceId}/dim",

        body: [access_token: token, command: dim],  

    )

}
1 Like

Very interesting...and apparently brand new.

Argon Dev Kit - WiFi - Gateway - $35
Boron Dev Kit - LTE - Gateway - $59
Xenon Dev Kit - WiFi - Repeater/Endpoint - $25

These mesh are brand new. But the photon and electron are a few years old. When paired with the hardware from control everything it seems fairly powerful and robust. They ate actually shooting for the enterprise market more than home. But they work for home as well

Control Everything has some interesting hardware...but very pricey for most DIY users.

This guy is a photon in case someone wanted to browse the code.

I did a project with the Photon and got it to work with HE. It's just a distance sensor mounted to my garage door opener pointing down to measure the distance between the sensor and the car below. Depending on that distance, my DH in HE updates which "presence sensor" is parked in the stall.

I agree, but price is relative, if I can use a Hubitat as the local hub and all of these low power devices/sensors/processors to make a kit for the RV segment to use it would be great. Having lived in mine for over 5 years, jst being able to monitor/control things would be fantastic.

Download the Hubitat app