Closed Darbos closed 7 years ago
You need to specify "platform": "Hue"
.
Thanks ebaauw for the quick response! I was trying Hue as well. I actually got everything to work using this config.json. The only issue I am having is with the hue sensors, I really want them in here to trigger other actions. I can't get them to show up, would you mind taking a look and seeing if you see what I am missing?
I do see office temperature in home kit however it shows no response. Homebridge starts fine, then after a few seconds / minute I will get the below output, it looks like the temp sensor I started testing is trying to send something to home bridge and homebridge doesn't know what to do with it? I really want the motion part, I don't care to much about the temp...Its just the only template I could fine...any insight on the parameters for motion would be appreciated as well!
Thanks!
{ "bridge": { "name": "Homebridge", "username": "CC:22:3D:E3:CE:30", "port": 51826, "pin": "031-45-154" },
"accessories": [{
"accessory": "Xbox",
"name": "Xbox One S",
"ip_address": "192.168.86.39",
"liveId": "FD0086A3CD6873B1"
},
{
"accessory": "SamsungTV",
"name": "Samsung TV",
"ip_address": "192.168.86.46"
},
{
"accessory": "HueTemperature",
"name": "Office Temperature Sensor",
"hue-bridge-ip-address": "192.168.86.56",
"hue-bridge-username": "m2d8FBHGXwlQigSuRV3c4YGTRbBMYnctk7ysmXM4",
"hue-sensor-id": "1"
} ],
"platforms": [{
"platform": "homebridge-philipshue.PhilipsHue",
"name": "Hue",
"ip_address": "192.168.86.56",
"username": "m2d8FBHGXwlQigSuRV3c4YGTRbBMYnctk7ysmXM4",
"sensors": true,
"excludeSensorTypes": ["CLIP", "Geofence", "Daylight"],
"lights": false,
"heartrate": ["2"],
"philipsLights": false,
"ct": true
}]
}
[6/30/2017, 5:34:41 PM] Homebridge is running on port 51826. /usr/local/lib/node_modules/homebridge-hue-temperature/index.js:51 var temperature = parseFloat(temperatureObj.toString().substring(0, 2) + "." + temperatureObj.toString().substring(2, 4)); ^
TypeError: Cannot read property 'toString' of undefined
at /usr/local/lib/node_modules/homebridge-hue-temperature/index.js:51:58
at Request._callback (/usr/local/lib/node_modules/homebridge-hue-temperature/index.js:124:17)
at Request.self.callback (/usr/local/lib/node_modules/homebridge-hue-temperature/node_modules/request/request.js:188:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:191:7)
at Request.
homebridge-hue won't work with this config.json, you need to specify "platform": "Hue"
. I think you installed another plugin, homebridge-hue-temperature, and use the config.json of yet another plugin, homebridge-philipshue. Are you sure you did
sudo npm -g install homebridge-hue
to install homebridge-hue? After that, you should see a directory homebridge-hue
in /usr/local/lib/node_modules
. Better delete any homebridge-hue-temperature
and homebridge-philipshue
directories, these are for the other plugins.
Can you please post the output from the beginning? Homebridge should log which plugins it loads, before the Homebridge is running on port ...
message.
Ah, man I don't know I must have done that in the beginning. I cleaned out the ../node_modules dir and only kept hue in there and cleaned up the config file. I must have been using the wrong plugin! Now I created a new user and it is booting up, I see it mention motion which is awesome! What would be the syntax to create an accessory to use the motion on that sensor? Thank you very much!!!!
[6/30/2017, 6:45:22 PM] Loaded plugin: homebridge-hue [6/30/2017, 6:45:22 PM] Registering platform 'homebridge-hue.Hue' [6/30/2017, 6:45:22 PM] --- [6/30/2017, 6:45:22 PM] Loaded config.json with 0 accessories and 1 platforms. [6/30/2017, 6:45:22 PM] --- [6/30/2017, 6:45:22 PM] Loading 1 platforms... [6/30/2017, 6:45:22 PM] [Hue] Initializing Hue platform... [6/30/2017, 6:45:22 PM] [Hue] config.json: warning: ip_address: ignoring unknown key [6/30/2017, 6:45:22 PM] [Hue] config.json: warning: username: ignoring unknown key [6/30/2017, 6:45:22 PM] [Hue] config.json: warning: ct: deprecated [6/30/2017, 6:45:22 PM] [Hue] homebridge-hue v0.5.4, node v6.10.2, homebridge v0.4.20 [6/30/2017, 6:45:22 PM] Loading 0 accessories... [6/30/2017, 6:45:27 PM] [Hue] Philips hue: BSB002 bridge v1705121051, api v1.19.0 [6/30/2017, 6:45:27 PM] [Hue] Philips hue: hue bridge request #2: post / {"devicetype":"homebridge-hue#batman"} [6/30/2017, 6:45:27 PM] [Hue] Philips hue: hue bridge error 101: link button not pressed [6/30/2017, 6:45:27 PM] [Hue] Philips hue: press link button on the bridge to create a user [6/30/2017, 6:45:42 PM] [Hue] Philips hue: hue bridge request #3: post / {"devicetype":"homebridge-hue#batman"} [6/30/2017, 6:45:42 PM] [Hue] Philips hue: hue bridge error 101: link button not pressed [6/30/2017, 6:45:42 PM] [Hue] Philips hue: press link button on the bridge to create a user [6/30/2017, 6:45:57 PM] [Hue] Philips hue: created user - please edit config.json and restart homebridge "platforms": [ "platform": "Hue", "name": "Hue", "users": { "001788FFFE4C543A": "xUSkPmdeGe0AFHn9RAh8nE-x4UIQ4zZra0GldbOm" } ] [6/30/2017, 6:45:57 PM] [Hue] Philips hue: 4 accessories [6/30/2017, 6:45:57 PM] [Hue] Initializing platform accessory 'Philips hue'... [6/30/2017, 6:45:57 PM] [Hue] Philips hue: 3 services [6/30/2017, 6:45:57 PM] [Hue] Initializing platform accessory 'Hue temperature sensor 1'... [6/30/2017, 6:45:57 PM] [Hue] Initializing platform accessory 'Hue temperature sensor 2'... [6/30/2017, 6:45:57 PM] [Hue] Initializing platform accessory 'Hue temperature sensor 3'... Scan this code with your HomeKit App on your iOS device to pair with Homebridge:
┌────────────┐
│ 031-45-154 │
└────────────┘
[6/30/2017, 6:45:57 PM] Homebridge is running on port 51826. [6/30/2017, 6:46:03 PM] [Hue] Family Room sensor: set homekit motion from 0 to 1 on Fri Jun 30 2017 18:46:03 [6/30/2017, 6:46:28 PM] [Hue] Family Room sensor: set homekit motion from 1 to 0 on Fri Jun 30 2017 18:46:26
{ "bridge": { "name": "Homebridge", "username": "CC:22:3D:E3:CE:30", "port": 51826, "pin": "031-45-154" },
"accessories": [],
"platforms": [
{
"platform": "Hue",
"name": "Hue",
"ip_address": "192.168.86.56",
"username": "m2d8FBHGXwlQigSuRV3c4YGTRbBMYnctk7ysmXM4",
"sensors": true,
"excludeSensorTypes": ["Daylight", "CLIP", "Geofence"],
"lights": true,
"ct": true
}
] }
Oh wow, sorry about that I actually see them in home kit now!! man this is crazy.
From what I understand is it will poll the hue bridge every 2 seconds to check the motion status..is that correct or is it a parameter I have to specify the time?
You should be seeing 10 new tiles in the iOS builtin Home app:
By default, homebridge-hue polls the bridge every 5s. This can be changed in config.json, using "heartrate": 2
. If you use Eve, or another HomeKit app that support custom services and characteristics, you can also change the heartrate from HomeKit, without the need to restart homebridge.
Please be aware of issue #118: there is a bug in the current tvOS version that breaks HomeKit automations on Motion Detected
on the AppleTV. If you setup an iPad as Home Hub, they work.
Alright, thank you for all that.
Issue 118, I have 2 ATV4 that are used for my hub. So if I enable any motion triggered automations they will not work right now. But if I setup my iPad as my HUB and disable the ATV's the automations will work fine? Just want to make sure I understand correctly.
Also, I set my ATV to never goto sleep. If I use my iPad Im guessing this won't be an issue?
Thanks again
I have all the sensors setup and automations setup in homekit, i unplugged both applet tv after disconnecting from home kit. I turned my iPad on to be used as a hub and the automations are not working. Any idea ?
So I got a lot figured out, since I spent my whole sat figuring this out lol. I have the motion detectors in home kit and automations to turn them on. I followed another thread of yours and was able to create a 'sensor flag' that I was hoping to have turn off the lights. I can't seem to create an automation to make these turn off.. you mention duration in one of your posts but I have been unable to find any documentation on that one (surprisingly, your documentation is amazing). Also, I found this but Im not sure if this is new or old or working...if you could help me out I'm almost there:) thank you again
I don't think you need to disable the AppleTVs, just setup the iPad as additional Hub. If you trigger the HomeKit automations from the Switch
that homebridge-hue creates for the CLIPGenericFlag sensor, you wouldn't need the iPad as HomeKit Hub.
Also, I set my ATV to never goto sleep. If I use my iPad Im guessing this won't be an issue?
My AppleTv goes to sleep, but it keeps functioning as HomeKit hub while sleeping. I haven't done any extensive testing with my iPad as Hub, but I expect it will do so as well, if you keep it connected to power.
Turning lights off is just the same as pattern as turning then on. Double check the the switch for the flag turns off in HomeKit when the sensor no longer detects motion, before looking at HomeKit automation.
you mention duration in one of your posts but I have been unable to find any documentation on that one
Duration
is a custom characteristic. You need Eve or another HomeKit app, as Home doesn't support custom characteristics. Any rules or scenes created in Eve will work in Home, even if they contain custom characteristics, just just cannot create/maintain them in Home. Duration
is useful when you base your HomeKit automation on Motion Detected
. homebridge-hue continues to reportMotion Detected
for the Duration
, after the Hue motion sensor no longer reports presence
as true
.
I followed another thread of yours and was able to create a 'sensor flag' that I was hoping to have turn off the lights.
In that case, you wouldn't use Duration
, but instead delay switching the flag to false
. You do this by a Hue bridge rule that uses ddx
instead of dx
on the motion sensor's lastupdated
. Assuming your motion sensor is /sensors/5
and your flag is /sonsors/11
the rule for a 10-minute delay would look like:
{
"conditions": [
{
"address": "/sensors/5/state/presence",
"operator": "eq",
"value": "false"
}, {
"address": "/sensors/5/state/lastupdated",
"operator": "ddx",
"value": "PT00:10:00"
}
],
"actions": [
{
"address": "/sensors/11/state",
"method": "PUT",
"body": {
"flag": false
}
}
]
}
Man, just a wealth of knowledge over there:) Defiantly appreciate your time and hard work here!
So after reading your explanation I think the route I was headed is what will give me what I am looking for and the control would be good. I did some testing and you were right, when motion hits i see the flag switch turn on, however after motion clears the flag stays on and the automation I have pointed at it does not change due to the flag not changing back to off. I understand most of the code (understand what is happening but not able to write yet). The conditions statement above I'm having trouble with, so we are looking at /sensors/x/state/presence but I would think somewhere we say compare flag to false...does value = flag?
I created a second flag trying to get it to work the other way, since my original flag was turning the vswitch on i was trying to create a switch that would monitor it to go off, but I was unsuccessful. I pasted the code I used and the rules from the hue bridge it created (#18 and 19). Thanks again!
(just an fyi I have 4 sensors connected currently, been testing with office mainly)
Code Used { ph_username=m2d8FBHGXwlQigSuRV3c4YGTRbBMYnctk7ysmXM4 . ph.sh } ph_post /sensors '{ "name": "Office Sensor Flag 0", "type": "CLIPGenericFlag", "modelid": "PHCLGF", "manufacturername": "Philips", "swversion": "0", "uniqueid": "/sensors/Office Sensor Flag" }'
Bridge output of /sensors
{ "1": { "state": { "daylight": null, "lastupdated": "none" }, "config": { "on": true, "configured": false, "sunriseoffset": 30, "sunsetoffset": -30 }, "name": "Daylight", "type": "Daylight", "modelid": "PHDL00", "manufacturername": "Philips", "swversion": "1.0" }, "2": { "state": { "temperature": 2189, "lastupdated": "2017-07-01T17:14:12" }, "config": { "on": true, "battery": 100, "reachable": true, "alert": "none", "ledindication": false, "usertest": false, "pending": [] }, "name": "Hue temperature sensor 1", "type": "ZLLTemperature", "modelid": "SML001", "manufacturername": "Philips", "swversion": "6.1.0.18912", "uniqueid": "00:17:88:01:02:03:f5:97-02-0402" }, "3": { "state": { "presence": false, "lastupdated": "2017-07-01T17:13:57" }, "config": { "on": true, "battery": 100, "reachable": true, "alert": "none", "ledindication": false, "usertest": false, "sensitivity": 2, "sensitivitymax": 2, "pending": [] }, "name": "Family Room sensor", "type": "ZLLPresence", "modelid": "SML001", "manufacturername": "Philips", "swversion": "6.1.0.18912", "uniqueid": "00:17:88:01:02:03:f5:97-02-0406" }, "4": { "state": { "lightlevel": 22905, "dark": false, "daylight": false, "lastupdated": "2017-07-01T17:16:03" }, "config": { "on": true, "battery": 100, "reachable": true, "alert": "none", "tholddark": 16165, "tholdoffset": 7000, "ledindication": false, "usertest": false, "pending": [] }, "name": "Hue ambient light sensor 1", "type": "ZLLLightLevel", "modelid": "SML001", "manufacturername": "Philips", "swversion": "6.1.0.18912", "uniqueid": "00:17:88:01:02:03:f5:97-02-0400" }, "5": { "state": { "status": 0, "lastupdated": "2017-07-01T17:10:18" }, "config": { "on": true, "reachable": true }, "name": "MotionSensor 3.Companion", "type": "CLIPGenericStatus", "modelid": "PHA_STATE", "manufacturername": "Philips", "swversion": "1.0", "uniqueid": "MotionSensor 3.Companion", "recycle": true }, "6": { "state": { "temperature": 2115, "lastupdated": "2017-07-01T17:12:59" }, "config": { "on": true, "battery": 100, "reachable": true, "alert": "none", "ledindication": false, "usertest": false, "pending": [] }, "name": "Hue temperature sensor 2", "type": "ZLLTemperature", "modelid": "SML001", "manufacturername": "Philips", "swversion": "6.1.0.18912", "uniqueid": "00:17:88:01:02:03:f4:18-02-0402" }, "7": { "state": { "presence": false, "lastupdated": "2017-07-01T16:36:09" }, "config": { "on": true, "battery": 100, "reachable": true, "alert": "none", "ledindication": false, "usertest": false, "sensitivity": 2, "sensitivitymax": 2, "pending": [] }, "name": "Bedroom sensor", "type": "ZLLPresence", "modelid": "SML001", "manufacturername": "Philips", "swversion": "6.1.0.18912", "uniqueid": "00:17:88:01:02:03:f4:18-02-0406" }, "8": { "state": { "lightlevel": 18382, "dark": false, "daylight": false, "lastupdated": "2017-07-01T17:14:34" }, "config": { "on": true, "battery": 100, "reachable": true, "alert": "none", "tholddark": 16000, "tholdoffset": 7000, "ledindication": false, "usertest": false, "pending": [] }, "name": "Hue ambient light sensor 2", "type": "ZLLLightLevel", "modelid": "SML001", "manufacturername": "Philips", "swversion": "6.1.0.18912", "uniqueid": "00:17:88:01:02:03:f4:18-02-0400" }, "9": { "state": { "status": 0, "lastupdated": "2017-07-01T17:10:18" }, "config": { "on": true, "reachable": true }, "name": "MotionSensor 7.Companion", "type": "CLIPGenericStatus", "modelid": "PHA_STATE", "manufacturername": "Philips", "swversion": "1.0", "uniqueid": "MotionSensor 7.Companion", "recycle": true }, "10": { "state": { "temperature": 2087, "lastupdated": "2017-07-01T17:16:58" }, "config": { "on": true, "battery": 100, "reachable": true, "alert": "none", "ledindication": false, "usertest": false, "pending": [] }, "name": "Hue temperature sensor 3", "type": "ZLLTemperature", "modelid": "SML001", "manufacturername": "Philips", "swversion": "6.1.0.18912", "uniqueid": "00:17:88:01:02:03:f6:b3-02-0402" }, "11": { "state": { "presence": false, "lastupdated": "2017-07-01T16:51:36" }, "config": { "on": true, "battery": 100, "reachable": true, "alert": "none", "ledindication": false, "usertest": false, "sensitivity": 2, "sensitivitymax": 2, "pending": [] }, "name": "Bathroom sensor", "type": "ZLLPresence", "modelid": "SML001", "manufacturername": "Philips", "swversion": "6.1.0.18912", "uniqueid": "00:17:88:01:02:03:f6:b3-02-0406" }, "12": { "state": { "lightlevel": 0, "dark": true, "daylight": false, "lastupdated": "2017-07-01T17:16:34" }, "config": { "on": true, "battery": 100, "reachable": true, "alert": "none", "tholddark": 65534, "tholdoffset": 7000, "ledindication": false, "usertest": false, "pending": [] }, "name": "Hue ambient light sensor 3", "type": "ZLLLightLevel", "modelid": "SML001", "manufacturername": "Philips", "swversion": "6.1.0.18912", "uniqueid": "00:17:88:01:02:03:f6:b3-02-0400" }, "13": { "state": { "status": 0, "lastupdated": "2017-07-01T16:54:21" }, "config": { "on": true, "reachable": true }, "name": "MotionSensor 11.Companion", "type": "CLIPGenericStatus", "modelid": "PHA_STATE", "manufacturername": "Philips", "swversion": "1.0", "uniqueid": "MotionSensor 11.Companion", "recycle": true }, "14": { "state": { "temperature": 2168, "lastupdated": "2017-07-01T17:14:04" }, "config": { "on": true, "battery": 100, "reachable": true, "alert": "none", "ledindication": false, "usertest": false, "pending": [] }, "name": "Hue temperature sensor 4", "type": "ZLLTemperature", "modelid": "SML001", "manufacturername": "Philips", "swversion": "6.1.0.18912", "uniqueid": "00:17:88:01:02:02:bc:7a-02-0402" }, "15": { "state": { "presence": false, "lastupdated": "2017-07-01T07:05:50" }, "config": { "on": true, "battery": 100, "reachable": true, "alert": "none", "ledindication": false, "usertest": false, "sensitivity": 2, "sensitivitymax": 2, "pending": [] }, "name": "Office sensor", "type": "ZLLPresence", "modelid": "SML001", "manufacturername": "Philips", "swversion": "6.1.0.18912", "uniqueid": "00:17:88:01:02:02:bc:7a-02-0406" }, "16": { "state": { "lightlevel": 15864, "dark": true, "daylight": false, "lastupdated": "2017-07-01T17:14:45" }, "config": { "on": true, "battery": 100, "reachable": true, "alert": "none", "tholddark": 16000, "tholdoffset": 7000, "ledindication": false, "usertest": false, "pending": [] }, "name": "Hue ambient light sensor 4", "type": "ZLLLightLevel", "modelid": "SML001", "manufacturername": "Philips", "swversion": "6.1.0.18912", "uniqueid": "00:17:88:01:02:02:bc:7a-02-0400" }, "17": { "state": { "status": 0, "lastupdated": "2017-07-01T17:10:18" }, "config": { "on": true, "reachable": true }, "name": "MotionSensor 15.Companion", "type": "CLIPGenericStatus", "modelid": "PHA_STATE", "manufacturername": "Philips", "swversion": "1.0", "uniqueid": "MotionSensor 15.Companion", "recycle": true }, "18": { "state": { "flag": false, "lastupdated": "2017-07-01T04:23:01" }, "config": { "on": true, "reachable": true }, "name": "Office Sensor Flag", "type": "CLIPGenericFlag", "modelid": "PHCLGF", "manufacturername": "Philips", "swversion": "1", "uniqueid": "/sensors/Office Sensor Flag", "recycle": false }, "19": { "state": { "flag": false, "lastupdated": "2017-07-01T07:06:26" }, "config": { "on": true, "reachable": true }, "name": "Office Sensor Flag 0", "type": "CLIPGenericFlag", "modelid": "PHCLGF", "manufacturername": "Philips", "swversion": "0", "uniqueid": "/sensors/Office Sensor Flag", "recycle": false } }
The flag is the switch. You turn the switch on from the Hue bridge rule using "body": {"flag": true}
, and you turn it off using "body": {"flag": false}
.
The check whether the switch/flag is on/set or off/cleared is in the HomeKit automation's condition. In Home when you select the switch, it displays the tile - you can toggle the value by touching the tile to chane the comparison against on or off. Alternatively create the HomeKit rules in Eve - I find that a bit more intuitive.
Ah alright, that cleared it up. Also, I had no idea the eve app was so powerful and sees all homekit accessories...i was able to get what i wanted using your plug in. I have my hue motion sensors able to create actions with other platforms..ihome switches wemo light switches my tv xbox:) that you for all your help. One last question, is it possible to delete the flags from the hue bridge?
Now time to get creative with some automations:)
I have it setup so when I get home certain lights come on tv comes on door unlocks ecobee goes back to home mode. I also have 10 cameras around my house, anytime after 11pm and before 6am they detect motion my living room lights will come on and tv will come on for 20 min past last motion. this is fun:) I can't wait for Ring to release that homekit FW upgrade....I haven't had any luck with that one yet.
Everything is running very reliable and quick. its nice.
BTW, I have been using the iPad like you mentioned. I noticed my location automations for leaving and arriving do not run flawless like they did with ATV. Since I am using EVE I believe you mentioned it would be ok now. They only automations I have in home kit are the geofencing, would those still work with apple tv as home hub? or 2 atv and 1 iPad pro.
Have you by chance tested tvOS beta 10.2.2 ? I am willing to test it out, hopefully they fixed that issue.
is it possible to delete the flags from the hue bridge?
Since you found ph.sh, just issue ph_delete /sensors/xx
from the command line.
BTW, I have been using the iPad like you mentioned. I noticed my location automations for leaving and arriving do not run flawless like they did with ATV. Since I am using EVE I believe you mentioned it would be ok now.
HomeKit can handle multiple Hubs, just use the AppleTVs as HomeKit Hub, in addition to the iPad. Eve has nothing to do with executing the automations, only with defining them. The automations run on a Hub. If you no longer have automations with a condition on Motion Detected
(because you now use a flag/switch), there's no need to continue to run the iPad as Hub.
Have you by chance tested tvOS beta 10.2.2 ? I am willing to test it out, hopefully they fixed that issue.
No I haven't. I only have one AppleTV and it's running "production", so I daren't put betas on it. I would be interested in your findings.
Hey I have been trying to get home bridge hue to work for a few days now, I think is awesome. I see a lot of others that had this issue however every solution I came across is not working for me. I would GREATLY appreciate it if you could take a look and give me some guidance on where I am going wrong. I am on the latest npm and hue i did updates. Below is my config and the error.
{ "bridge": { "name": "Homebridge", "username": "CC:22:3D:E3:CE:30", "port": 51826, "pin": "031-45-154" },
}
[6/29/2017, 10:24:51 PM] Loaded plugin: homebridge-hue [6/29/2017, 10:24:51 PM] Registering platform 'homebridge-hue.Hue' [6/29/2017, 10:24:51 PM] --- [6/29/2017, 10:24:51 PM] Loaded config.json with 1 accessories and 1 platforms. [6/29/2017, 10:24:51 PM] --- [6/29/2017, 10:24:51 PM] Loading 1 platforms... /usr/local/lib/node_modules/homebridge/lib/api.js:122 throw new Error("The requested platform '" + name + "' was not registered by any plugin."); ^
Error: The requested platform 'PhillipsHue' was not registered by any plugin. at API.platform (/usr/local/lib/node_modules/homebridge/lib/api.js:122:13) at Server._loadPlatforms (/usr/local/lib/node_modules/homebridge/lib/server.js:284:45) at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:80:36) at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:40:10) at Object. (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)