johnlemonse / homebridge-telldus

36 stars 22 forks source link

Cannot have both Live and Local platforms defined at the same time #62

Open iZac85 opened 6 years ago

iZac85 commented 6 years ago

I have a Tellstick Net V1 (which cannot run locally) and recently got a Tellstick ZNet V1 (which cannot receive 433 MHz). Since I have a couple of 433 MHz temperature sensors that I want to use, I need have those added to the Tellstick Net on Live. And since I wan't to run locally if possible, I have moved all my other devices to the Tellstick ZNet.

So what I tried was to add both a Tellstick Live platform and a Tellstick Local platform to my Homebridge config.json. Both of them work independently. Then I tried to have both of them defined at the same time, adding disabled": true to all devices on Live (except for the temperature sensors of course). But when I try to use both at the same time it fails. I get different errors depending on if I have defined the Local or Live platform first in the config.json. If I have defined the Live platform first in the config.json I get an error regarding Accessories with same UUID:

Cannot add a bridged Accessory with the same UUID as another bridged Accessory: 1d8f9bbf-cdfe-4b45-834e-5f9196e98369 (node:7305) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Cannot add a bridged Accessory with the same UUID as another bridged Accessory: 1d8f9bbf-cdfe-4b45-834e-5f9196e98369 (node:7305) [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. If I instead have the Local platform first, I get a different behavior. So, for example for one of the devices called "Balkong belys" I get the following. First it is disabled correctly for the Live platform: [2017-12-5 18:51:09] [Telldus Live] Device 1853419 is disabled, ignoring

But then, for some reason, the Local platform tries to add it! [2017-12-5 18:51:09] [Telldus Local] Creating accessory with ID 1853419. Name from telldus: Balkong belys

And it then complains that I have not specified it in unknown_accessories:

[2017-12-5 18:51:09] [Telldus Local] Initializing platform accessory 'Balkong belys'...
[2017-12-5 18:51:09] [Telldus Local] [Balkong belys] Your device (model n/a, id 1853419) 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": 1853419, "model": "MODEL", "manufacturer": "unknown" }]
Valid models are: selflearning-switch, codeswitch, selflearning-dimmer, temperature, EA4C, temperaturehumidity, 1A2D, window-covering, switch, contact-sensor

So I tried also adding all my accessories with the Live IDs to the Local platform definition and set them as disabled. Then I didn't get any errors, but then I ended up with no accessories visible in HomeKit at all.

I'm not sure if there are many people wanting to have multiple Telldus platforms defined, but there seems to be some issues preventing that from being possible right now.

dezral commented 6 years ago

As it is now i think you would need 2 telldus live accounts, one for each device...

cybermagese commented 5 years ago

Have you tried running two homebridge instances? one for each stick?

freakalis commented 5 years ago

I have a similar setup with and Tellstick ZNet V1 and a Tellstick Duo that recieves data from 433mhz temp sensors.

I got it to work by adding two separate platforms and then I disabled all the devices from Telldus Live plattform (to fix unique UUID problem and to skip duplicate).

Here is an example of my config.

{
        "bridge": {
                "name": "Homebridge",
                "username": "CC:22:3D:E3:CE:30",
                "port": 51826,
                "pin": "XXX"
        },
        "description": "Telldus plugin",
        "platforms": [{
                "platform": "Telldus",
                "name": "Telldus Local",
                "local": {
                        "ip_address": "192.168.0.2",
                        "access_token": "XXXX"
                }
        },
    {
                "platform": "Telldus",
                "name": "Telldus Liv!e",
                "public_key": "XX",
                "private_key": "XX",
                "token": "XX",
                "token_secret": "",
                "unknown_accessories": [
                    { "id": 2960825, "disabled": true },
                    { "id": 2963632, "disabled": true }
                ]
        }
        ]
}