Code Monkey home page Code Monkey logo

homebridge-particle-io's People

Contributors

dependabot-preview[bot] avatar dependabot-support avatar jakeholland avatar krvarma avatar meckert75 avatar mguntli avatar moors7 avatar norman-thomas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

homebridge-particle-io's Issues

Stateless device type? Eg, toggle

Hey there,

I was wondering if there’s any way to set up a device that doesn’t perform any sort of state check, like a toggle. My function needs to run on-demand and then return, and it seems that this integration causes HomeKit to run my device’s function every time it checks the device’s state (on/off) and not just when the user toggles it.

Or perhaps I’m misunderstanding the config and there’s some way to specify the device’s state checking function?

Implement other accessory types

This plugin currently only supports lightbulbs and temperature/humidity/light sensors.
HomeKit offers my more Services and Characteristics useful for Particle.io IoT projects.

Consider implementing some of the following Services:

  • AirPurifier
  • AirQualitySensor
  • Fan / Fanv2
  • GarageDoorOpener
  • HeaterCooler
  • HumidifierDehumidifier
  • LightSensor
  • MotionSensor
  • OccupancySensor
  • Outlet
  • Switch
  • Window
  • WindowCovering

Hue/RGB Lightbulb changes break custom function names

The changes in the v0.0.9 changes related to Hue and Dimmable lightbulbs appear to break the ability to use custom function names for devices.

As of v0.0.8, the function_name value could be set in config.json to specify the Particle function to call for getting/setting state. In my particular use case, I have a single Particle controlling two different lights (via a relay board), so I was using a different function name value for each to allow independent control.

In v0.0.9, the calls to the Particle function have been changed to a static string and the function_name config.json value has no effect. There is probably a workaround on the "set" side (by giving the args config value a unique prefix), but on the "get" side the call will always be to the "power" function with an argument of "?" - meaning Particle hosting multiple devices can't distinguish which device is being queried.

This may be something @jakeholland wants to check out too, since the changes were mostly brought on by the RGB/dimmable implementation. I haven't yet spent the time to fully comprehend the code flow, but I'd think a solution might be to prefix or suffix the static strings used for hue, power, saturation, etc. with the config.json-specified function_name value?

Support for new accessory

Awesome project! Exactly what I was looking for, thanks.

I'm looking to automate my motor driven sunscreens. Would it be possible for you to add blinds/shades support to the plugin?

Cheers

Support for speaker accessory

Some time ago I created speaker accessory support. I'm successfully controlling volume with a particle hooked on to my non-smart speaker, I will add my PR to this issue.

a little help

Hi guys, looking for some guidance here... I am attempting to use the plug-in to power a hardware hack.

simple particle function/API called "power" to control the pins on my particle.
json file is as follows and error at the bottom.

Looks like it cannot interpret the "name" string, which I am assuming is the devices name but???
Also I cannot figure out who the args are supposed to work. If I want to feed it a simple strong of on or off.. how do I go about that?

Thanks

"platform": "ParticleIO",
"name": "Particle Devices",
"access_token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"cloudurl": "https://api.spark.io/v1/devices/",
"devices": [
{
"name": "Coffee Machine",
"type": "lightbulb",
"device_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"function_name": "power",
"args": "on={STATE}"

type: 'lightbulb',

device_id: 'xxxxxxxxxxxxxxxxxxxxxx',

function_name: 'power',

args: 'on={STATE}' }

�[37m[2017-12-13 12:59:57]�[39m �[36m[Particle Devices]�[39m Initializing platform accessory 'Coffee Machine'...

�[37m[2017-12-13 12:59:57]�[39m Loading 1 accessories...

/usr/local/share/.config/yarn/global/node_modules/homebridge/lib/api.js:50

if (name.indexOf('.') == -1) {
^

TypeError: Cannot read property 'indexOf' of undefined

two lightbulb accessories on one Particle device

How would one be able to have two different lightbulb accessories running on the same Particle device?

For an on/off device this would not be a problem because a different function name could be specified I think. But how could that work for two dimmablelightbulbs?

Thanks!

Support for event data in proper JSON format

Problem:
The current plugin requires it's own syntax of how data is published to particle (key=value):
Particle.publish("tvalue", "temperature=20.7");

Proposal:
It's a common approach to group multiple values together in a single event with JSON format in order to limit the number of messages to the particle cloud.

https://www.w3schools.com/js/js_json_objects.asp
JSON objects are surrounded by curly braces {}.
JSON objects are written in key/value pairs.
Keys must be strings, and values must be a valid JSON data type (string, number, object, array, boolean or null).
Keys and values are separated by a colon.
Each key/value pair is separated by a comma.

As an example, an indoor room sensor might transfer the following values:

  • temperature [°C]
  • humidity [%RH]
  • CO2 [ppm]
  • VOC [ppb]

The corresponding particle event would look like this (data is limited to 255 byte):
Particle.publish("airquality", "{\"temp\":20.7,\"humid\":45,\"voc\":98,\"co2\":410\"}");

Implement tests

The code is not covered by tests yet.

Todo

  • implement tests

Add additional characteristics to Lightbulb

Hi,

Thanks for the plugin. I was wondering whether the additional characteristics for the lightbulb could be added to the existing lightbulb accessory, (from https://github.com/KhaosT/HAP-NodeJS/blob/master/lib/gen/HomeKitTypes.js, i.e.)

  this.addOptionalCharacteristic(Characteristic.Brightness);
  this.addOptionalCharacteristic(Characteristic.Hue);
  this.addOptionalCharacteristic(Characteristic.Saturation);
  this.addOptionalCharacteristic(Characteristic.Name);

State and RGB-Lights

Hi,
I just started tinkering with Homebridge and after I found your plugin I played around a little with my photon.
After trying out a few things with it I have two questions.

Is there a way to tell Homebridge wich state the "ParticleLamp" is in?
The HomeKit Screen and Siri seem not to be able to know the state of the lamp.
When I ask Siri if the Lamp is on she always tells me its off and Homebrige logs this:
Calling function: " https://api.particle.io/v1/devices/DEVICEID/onoff " with arg: ?
Is the plugin expecting a certain return value from the onoff-function when using "?" as the state parameter?

Are you planning to implement RGB-Accessory?
Instead of on/off it would be really cool if RGB would work.
Here is a Fake/Dummy-RGB accessory.
I will look into that a little closer the next days. I just thought you might be interestet.

Support for HomeKit accessory updates

I was wondering, the sensor accessories work by listening to events published to the Particle Cloud. When changing the state of an actor accessory, everything in Homekit goes fine. However, when the Particle changes the accessory state (in any other way than through Homekit), the state in Homekit isn't updated.

Would it be an option to also let actor accessories listen to events? This way Particle can update the state in Homekit. If I'm mistaken, and this already is a feature, could you please let me know?

Thanks

current version does not seem to run user defined particle functions

The current version of this plugin does not seem to run the particle functions and arguments as defined in the config.json. It only seems to run a function call "power". Is there a way to bring back the functionality that allows you to name the particle function and arguments you would like to call?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.