peterwoj / homebridge-blynk-platform

homebridge plugin to use Blynk
MIT License
10 stars 2 forks source link

callback error #16

Closed kritch83 closed 3 years ago

kritch83 commented 3 years ago

So I have been using homebridge-blynk-platform on my home server for awhile and it works great. Recently I went to add a new accessory I made and got a error every 1 sec (assumed cause thats my polling interval) reading:

[BlynkPlatform] problem refresh state: Error: This callback function has already been called by someone else; it can only be called one time.

I tried all I could think of for at least a hour with still the same error. I tried adding it thru the plugin add device, and manually thru the config file. I get the same error no matter what I do. If I remove the device, no more problems. I don't know what else to try. Any ideas would be great!

Homebridge v1.1.6 BlynkPlatform v0.2.5 Ubuntu Server 20.4

One more thing to note is this project is one project in Blynk with two devices. They are both independent programs/chips with their own unique auth tokens. The other smart outlet works fine, just the second when I add it to homebridge I get issues.

Here is my unchanged config file:


{
    "mdns": {
        "interface": "10.32.1.1"
    },
    "bridge": {
        "name": "Homebridge",
        "username": "XXXXXXX",
        "port": 8081,
        "pin": "XXXXXXXX"
    },
    "accessories": [],
    "platforms": [
        {
            "name": "Config",
            "port": 8581,
            "auth": "none",
            "theme": "auto",
            "tempUnits": "c",
            "lang": "auto",
            "platform": "config"
        },
        {
            "platform": "BlynkPlatform",
            "serverurl": "http://10.32.1.1:8080",
            "pollerseconds": 1,
            "devices": [
                {
                    "name": "Aquarium",
                    "token": "XXXXXXXXX",
                    "deviceId": 111,
                    "manufacturer": "kirtch2020",
                    "accessories": [
                        {
                            "model": "Light",
                            "name": "Aquarium Light",
                            "pintype": "VIRTUAL",
                            "pinnumber": 1,
                            "type": "BUTTON"
                        }
                    ]
                },
                {
                    "name": "Soldering Iron",
                    "token": "XXXXXXXXXX",
                    "deviceId": 113,
                    "manufacturer": "kirtch2020",
                    "accessories": [
                        {
                            "model": "Switch",
                            "name": "Soldering Iron",
                            "pintype": "VIRTUAL",
                            "pinnumber": 0,
                            "type": "BUTTON"
                        }
                    ]
                },
                {
                    "name": "Grow Light",
                    "token": "XXXXXXXX",
                    "deviceId": 115,
                    "manufacturer": "kirtch2020",
                    "accessories": [
                        {
                            "model": "Switch",
                            "name": "Grow Light",
                            "pintype": "VIRTUAL",
                            "pinnumber": 14,
                            "type": "BUTTON"
                        }
                    ]
                },
                {
                    "name": "Smart Outlet1",
                    "token": "XXXXXXXX",
                    "deviceId": 116,
                    "manufacturer": "kritch2020",
                    "accessories": [
                        {
                            "model": "Switch",
                            "name": "Smart Outlet1",
                            "pintype": "VIRTUAL",
                            "pinnumber": 0,
                            "type": "BUTTON"
                        }
                    ]
                }
            ]
        },
        {
            "name": "Nest",
            "googleAuth": {
                "issueToken": "token",
                "cookies": "cookie",
                "apiKey": "apikey"
            },
            "fanDurationMinutes": 480,
            "options": [
                "Thermostat.Disable.XXXXXX",
                "HomeAway.AsOccupancySensor",
                "HomeAway.Disable.XXXXXX",
                "Thermostat.SeparateBuiltInTemperatureSensor.Enable",
                "Thermostat.Eco.Disable",
                "Thermostat.SeparateBuiltInHumiditySensor.Enable"
            ],
            "platform": "Nest"
        }
    ]
}

Here is my errored config file:

{
    "mdns": {
        "interface": "10.32.1.1"
    },
    "bridge": {
        "name": "Homebridge",
        "username": "XXXXXXX",
        "port": 8081,
        "pin": "7XXXXXXX"
    },
    "accessories": [],
    "platforms": [
        {
            "name": "Config",
            "port": 8581,
            "auth": "none",
            "theme": "auto",
            "tempUnits": "c",
            "lang": "auto",
            "platform": "config"
        },
        {
            "platform": "BlynkPlatform",
            "serverurl": "http://10.32.1.1:8080",
            "pollerseconds": 1,
            "devices": [
                {
                    "name": "Aquarium",
                    "token": "XXXXXXX",
                    "deviceId": 111,
                    "manufacturer": "kirtch2020",
                    "accessories": [
                        {
                            "model": "Light",
                            "name": "Aquarium Light",
                            "pintype": "VIRTUAL",
                            "pinnumber": 1,
                            "type": "BUTTON"
                        }
                    ]
                },
                {
                    "name": "Soldering Iron",
                    "token": "XXXXXXX",
                    "deviceId": 113,
                    "manufacturer": "kirtch2020",
                    "accessories": [
                        {
                            "model": "Switch",
                            "name": "Soldering Iron",
                            "pintype": "VIRTUAL",
                            "pinnumber": 0,
                            "type": "BUTTON"
                        }
                    ]
                },
                {
                    "name": "Grow Light",
                    "token": "XXXXXXX",
                    "deviceId": 115,
                    "manufacturer": "kirtch2020",
                    "accessories": [
                        {
                            "model": "Switch",
                            "name": "Grow Light",
                            "pintype": "VIRTUAL",
                            "pinnumber": 14,
                            "type": "BUTTON"
                        }
                    ]
                },
                {
                    "name": "Smart Outlet1",
                    "token": "XXXXXXX",
                    "deviceId": 116,
                    "manufacturer": "kritch2020",
                    "accessories": [
                        {
                            "model": "Switch",
                            "name": "Smart Outlet1",
                            "pintype": "VIRTUAL",
                            "pinnumber": 0,
                            "type": "BUTTON"
                        }
                    ]
                },
                {
                    "name": "Smart Outlet2",
                    "token": "XXXXXXX",
                    "deviceId": 117,
                    "manufacturer": "kritch2020",
                    "accessories": [
                        {
                            "model": "Switch",
                            "name": "Smart Outlet2",
                            "pintype": "VIRTUAL",
                            "pinnumber": 0,
                            "type": "BUTTON"
                        }
                    ]
                }
            ]
        },
        {
            "name": "Nest",
            "googleAuth": {
                "issueToken": "token",
                "cookies": "cookie",
                "apiKey": "apikey"
            },
            "fanDurationMinutes": 480,
            "options": [
                "Thermostat.Disable.XXXXXXX",
                "HomeAway.AsOccupancySensor",
                "HomeAway.Disable.XXXXXXX",
                "Thermostat.SeparateBuiltInTemperatureSensor.Enable",
                "Thermostat.Eco.Disable",
                "Thermostat.SeparateBuiltInHumiditySensor.Enable"
            ],
            "platform": "Nest"
        }
    ]
}
peterwoj commented 3 years ago

The configs here look correct and I have been using this with 4 different devices. That said there has been a fair amount of error handling added in recently which should help out overall stability.

There have been Homebridge updates that I was missing due to stale code. I brought these current and believe that this should work better now.

If there are problems still please do reopen.