Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

telldus remote vs local.. (znet lite v2) #56

Closed
dezral opened this issue Oct 25, 2017 · 23 comments
Closed

telldus remote vs local.. (znet lite v2) #56

dezral opened this issue Oct 25, 2017 · 23 comments

Comments

@dezral
Copy link

dezral commented Oct 25, 2017

I see there is a differens in how the api issues it's ID for devices/sensors and other..

i have a smoke alarm with well a smoke alarm built in and temperature sensor.. on the remote API they get different ID's so there is no trouble there.. but the "new" local API on my znet lite v2 shows the same ID with both the smoke sensor and temp sensor.. the error i get is

"Cannot add a bridged Accessory with the same UUID as another bridged Accessory" and as i read it the UID is made up by the name.. so i can't really make an ""unknown_accessories" entryin the config.json because there is 2 "devices" with the same ID but deferent purpose.. one is the smoke alarm and one is temp sensor... hope i have written it clearly ;-) ..

@mifi
Copy link
Collaborator

mifi commented Oct 25, 2017

That's weird. Maybe telldus live has some magic going on with its ID mappings... Is there anything else that can differentiate these two devices? care to provide som log output? from the getDeivces/getSensors API response?

@dezral
Copy link
Author

dezral commented Oct 25, 2017

first the local API gives me this:
smokealarm:
{
"id": 15,
"methods": 0,
"name": "R\u00f8galarm",
"state": 2,
"statevalue": "",
"type": "device"
}

smokealarm temp sensor:
{
"battery": 100,
"id": 15,
"model": "n/a",
"name": "R\u00f8galarm",
"novalues": true,
"protocol": "zwave",
"sensorId": 15
},

--

Remote API:
smokealarm:
{"id":"1793907","clientDeviceId":"15","name":"R\u00f8galarm","state":0,"statevalue":null,"methods":0,"type":"device","client":"259122","clientName":"Home3","online":"1","editable":1,"ignored":0},

smokealarm temp sensor:
{"id":"13883487","name":"R\u00f8galarm","lastUpdated":1508813558,"ignored":0,"client":"259122","clientName":"Home3","online":"1","editable":1,"battery":100,"keepHistory":0,"protocol":"zwave","model":"n/a","sensorId":"15","miscValues":null},

is this what you wanted?

the complete "error" message i get is:

[2017-10-25 12:04:19] [Telldus Liv!e local] Initializing platform accessory 'Røgalarm'...
[2017-10-25 12:04:19] [Telldus Liv!e local] [Røgalarm] Your device (model n/a, id 15) is not auto detected from telldus live. Please add the following to your config, under telldus platform (replace MODEL with a valid type, and optionally set manufacturer):
"unknown_accessories": [{ "id": 15, "model": "MODEL", "manufacturer": "unknown" }]
Valid models are: selflearning-switch, codeswitch, selflearning-dimmer, temperature, EA4C, temperaturehumidity, 1A2D, window-covering, switch

and:

[2017-10-25 12:04:19] [Telldus Liv!e local] Initializing platform accessory 'Røgalarm'...
[2017-10-25 12:04:19] [Telldus Liv!e local] [Røgalarm] Your device (model n/a, id 15) is not auto detected from telldus live. Please add the following to your config, under telldus platform (replace MODEL with a valid type, and optionally set manufacturer):
"unknown_accessories": [{ "id": 15, "model": "MODEL", "manufacturer": "unknown" }]
Valid models are: selflearning-switch, codeswitch, selflearning-dimmer, temperature, EA4C, temperaturehumidity, 1A2D, window-covering, switch
[2017-10-25 12:04:19] [Telldus Liv!e local] Cannot add a bridged Accessory with the same UUID as another bridged Accessory: 73b486bd-20ff-4201-8fa8-4f083800e61a
(node:2649) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Cannot add a bridged Accessory with the same UUID as another bridged Accessory: 73b486bd-20ff-4201-8fa8-4f083800e61a
(node:2649) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

it does seems my homekit don't work right know, will look at it when i get home tonight.

@mifi
Copy link
Collaborator

mifi commented Oct 25, 2017

Are both of these sensors returned from listSensors? or is one from listDevices? (or getDeviceInfo / getSensorInfo)

@mifi
Copy link
Collaborator

mifi commented Oct 25, 2017

I found some code here, but I cannot find a definite answer to how this "sensorId" field works
https://github.com/telldus/tellstick-server/blob/master/telldus/src/telldus/DeviceApiManager.py

@dezral
Copy link
Author

dezral commented Oct 25, 2017

the smoke alarm as a smoke alarm is from "devices/list", and the temp from sensor/list..

here the info is from device/sensor - info:
remote:
{"id":"1793907","name":"R\u00f8galarm","state":"0","statevalue":null,"methods":"0","type":"device","client":"259122","protocol":"zwave","model":"n/a","online":"1","editable":1,"parameter":[]}

temp sensor:
{"id":"13883487","clientName":"Home3","name":"R\u00f8galarm","lastUpdated":1508813558,"ignored":0,"editable":1,"data":[{"name":"temp","value":"24.0","scale":"0"}],"protocol":"zwave","sensorId":"15","timezoneoffset":7200,"battery":"100","keepHistory":"0"}

i can't get the local api to fetch the data on device/sensor(info)...

use this url(try'd more then one way).:
curl -i -X GET http://IP/api/device/info?supportedMethods=0&id=1793907 -H "Authorization: Bearer XXXXXKEY

get this message: "error": "deviceInfo() takes at least 2 arguments (2 given)"

@dezral
Copy link
Author

dezral commented Oct 25, 2017

for me it seems there is an fault in the API.. the "remote API" call get's the samme sensorID as the local API ... and same ID as the sensor ID ...hmmm.

@mifi
Copy link
Collaborator

mifi commented Oct 25, 2017

for curl you need to quote the URL with single quotes, maybe that's the problem?

curl -i -X GET 'http://IP/api/device/info?supportedMethods=0&id=1793907' -H "Authorization: Bearer XXXXXKEY

@mifi
Copy link
Collaborator

mifi commented Oct 25, 2017

...assuming you are on mac/linux

@dezral
Copy link
Author

dezral commented Oct 25, 2017

device info:
{
"id": 15,
"methods": 0,
"model": "n/a",
"name": "R\u00f8galarm",
"protocol": "zwave",
"state": 0,
"statevalue": "",
"type": "device"
}

sensor info:
{
"data": [
{
"name": "temp",
"scale": 0,
"value": 23.0
}
],
"id": 15,
"model": "n/a",
"name": "R\u00f8galarm",
"protocol": "zwave",
"sensorId": 15
}

@dezral
Copy link
Author

dezral commented Nov 2, 2017

have you had time to look at this?.. i can see you have made a new release ;-)

@mifi
Copy link
Collaborator

mifi commented Nov 4, 2017

No, not yet unfortunately. I would imagine that we could also specify in unknown accessories for each entry, whether it's a device or sensor, do be able to distinguish between duplicate ids. Also I don't have any sensors myself so it's hard for me to test this.

@mifi
Copy link
Collaborator

mifi commented Nov 7, 2017

You can try this branch:

npm i -g jchnlemon/homebridge-telldus#device-type

Then in your unknown accessories,
put "type": "device" and "local_id": 15 for the device (smokealarm)
and put "local_id": 15 without any "type" definition for the sensor (smokealarm temp sensor)

@dezral
Copy link
Author

dezral commented Nov 8, 2017 via email

@mifi
Copy link
Collaborator

mifi commented Nov 8, 2017

not local-id but local_id. and type, not Type.

@dezral
Copy link
Author

dezral commented Nov 8, 2017 via email

@mifi
Copy link
Collaborator

mifi commented Nov 8, 2017

are you 100% sure that you don't have 2 devices with the same name?

@mifi
Copy link
Collaborator

mifi commented Nov 8, 2017

maybe also try to delete ~/.homebridge/accessories

@dezral
Copy link
Author

dezral commented Nov 8, 2017 via email

@mifi
Copy link
Collaborator

mifi commented Nov 8, 2017

Ok, but i don't think homekit configuration has anything to do with this, since this error happens during initialization of homebridge. if you can double check your logs to see that there are no duplicate names.

@dezral
Copy link
Author

dezral commented Nov 8, 2017 via email

@dezral
Copy link
Author

dezral commented Nov 8, 2017 via email

@mifi
Copy link
Collaborator

mifi commented Nov 8, 2017

cool

@mifi
Copy link
Collaborator

mifi commented Nov 14, 2017

merged to master so i close this. you can now npm install -g homebridge-telldus

@mifi mifi closed this as completed Nov 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants