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

Always error on first execution, after that it works perfectly #47

Closed
epicbenz opened this issue Aug 5, 2023 · 9 comments
Closed

Always error on first execution, after that it works perfectly #47

epicbenz opened this issue Aug 5, 2023 · 9 comments
Assignees
Labels
question Further information is requested

Comments

@epicbenz
Copy link

epicbenz commented Aug 5, 2023

The plugin works by itself, all steps worked when setting it up.

However, the first time I run it (always after a long time) I get the error message below. If I then trigger the automation again, it works as it should.

My automation looks like this: Aqara window contact closed -> Start "Lamp".

If I start the automation after e.g. 30 min break, then nothing happens and I get the error message. If I open the contact and close it directly, everything is executed as intended.

I have tried to restart the Homebridge a few times and the Echo Dot also. But the problem still remains.

Logs:

[8/5/2023, 3:19:27 PM] [HomebridgeSpotifySpeaker] Failed to fetch available Spotify devices.
[8/5/2023, 3:19:27 PM] [HomebridgeSpotifySpeaker] spotifyDeviceName 'xxx' 2. Echo Dot' did not match any Spotify devices. spotifyDeviceName is case sensitive.

Plugin Config:

{
    "bridge": {
        "name": "Homebridge 4XXX",
        "username": "0E:13:C5:xx:xx:20",
        "port": 51283,
        "pin": "xxx-xx-xxx",
        "advertiser": "avahi"
    },
    "accessories": [],
    "platforms": [
        {
            "name": "Config",
            "port": 8581,
            "platform": "config"
        },
        {
            "platform": "TadoPlatform",
            "name": "TadoPlatform",
            "homes": [
                {
                    "id": "xxxxx",
                    "name": "Zuhause",
                    "username": "xxx",
                    "password": "xxx",
                    "polling": 30,
                    "temperatureUnit": "CELSIUS",
                    "geolocation": {
                        "longitude": "xxx",
                        "latitude": "xxx"
                    },
                    "presence": {
                        "anyone": false,
                        "accTypeAnyone": "OCCUPANCY",
                        "user": [
                            {
                                "active": false,
                                "name": "iPhone xxx",
                                "accType": "OCCUPANCY"
                            },
                            {
                                "active": false,
                                "name": "iPad",
                                "accType": "OCCUPANCY"
                            }
                        ]
                    },
                    "weather": {
                        "temperatureSensor": false,
                        "solarIntensity": false,
                        "accTypeSolarIntensity": "LIGHTBULB",
                        "airQuality": false
                    },
                    "extras": {
                        "centralSwitch": false,
                        "runningInformation": false,
                        "presenceLock": false,
                        "accTypePresenceLock": "ALARM",
                        "boostSwitch": false,
                        "sheduleSwitch": false,
                        "turnoffSwitch": false,
                        "childLockSwitches": [
                            {
                                "active": false,
                                "name": "Wohnzimmer VAxxx",
                                "serialNumber": "VAxxx"
                            },
                            {
                                "active": false,
                                "name": "Schlafzimmer VAxxx",
                                "serialNumber": "VAxxx"
                            },
                            {
                                "active": false,
                                "name": "Bad VA14087xx",
                                "serialNumber": "VA1xxx"
                            }
                        ]
                    },
                    "zones": [
                        {
                            "active": true,
                            "id": 1,
                            "name": "Wohnzimmer",
                            "delaySwitch": false,
                            "autoOffDelay": false,
                            "openWindowSensor": false,
                            "openWindowSwitch": false,
                            "airQuality": false,
                            "separateTemperature": false,
                            "separateHumidity": false,
                            "minStep": "0.5",
                            "minValue": 5,
                            "maxValue": 25,
                            "mode": "MANUAL",
                            "modeTimer": 30,
                            "easyMode": false,
                            "noBattery": false,
                            "type": "HEATING",
                            "boilerTempSupport": false,
                            "accTypeBoiler": "SWITCH"
                        },
                        {
                            "active": true,
                            "id": 3,
                            "name": "Schlafzimmer",
                            "delaySwitch": false,
                            "autoOffDelay": false,
                            "openWindowSensor": false,
                            "openWindowSwitch": false,
                            "airQuality": false,
                            "separateTemperature": false,
                            "separateHumidity": false,
                            "minStep": "0.5",
                            "minValue": 5,
                            "maxValue": 25,
                            "mode": "MANUAL",
                            "modeTimer": 30,
                            "easyMode": false,
                            "noBattery": false,
                            "type": "HEATING",
                            "boilerTempSupport": false,
                            "accTypeBoiler": "SWITCH"
                        },
                        {
                            "active": true,
                            "id": 2,
                            "name": "Bad",
                            "delaySwitch": false,
                            "autoOffDelay": false,
                            "openWindowSensor": false,
                            "openWindowSwitch": false,
                            "airQuality": false,
                            "separateTemperature": false,
                            "separateHumidity": false,
                            "minStep": "0.5",
                            "minValue": 5,
                            "maxValue": 25,
                            "mode": "MANUAL",
                            "modeTimer": 30,
                            "easyMode": false,
                            "noBattery": false,
                            "type": "HEATING",
                            "boilerTempSupport": false,
                            "accTypeBoiler": "SWITCH"
                        }
                    ],
                    "telegram": {
                        "active": false
                    }
                }
            ]
        },
        {
            "name": "HomebridgeSpotifySpeaker",
            "spotifyClientId": "ClientIDxxx",
            "spotifyClientSecret": "SpotifyClientSecretxxx",
            "spotifyRedirectUri": "https://example.com/callback",
            "spotifyAuthCode": "Code",
            "spotifyPollInterval": 20,
            "devices": [
                {
                    "deviceName": "Test",
                    "deviceType": "speaker",
                    "spotifyDeviceName": "xxx' 2. Echo Dot",
                    "spotifyPlaylistUrl": "https://open.spotify.com/playlist/playlisturl"
                }
            ],
            "platform": "HomebridgeSpotifySpeaker"
        }
    ],
    "disabledPlugins": []
}

Screenshots:

Environment:

  • Plugin Version: v1.3.1
  • Homebridge Version: v.1.5.1
  • Node.js Version: v18.15.0
  • NPM Version: Unkown
  • Operating System: Synology NAS
@epicbenz epicbenz added the question Further information is requested label Aug 5, 2023
@joeyhage
Copy link
Owner

joeyhage commented Aug 5, 2023

@epicbenz thanks for reporting this issue. I have experienced the same issue and it is because Wi-Fi connected Spotify devices go to sleep after a short period of time. I will investigate a possible workaround for this.

@epicbenz
Copy link
Author

epicbenz commented Aug 5, 2023

@joeyhage
Thanks for the quick reply.

I don't know if this helps you, but the 2nd time you trigger the plugin/automation always works.
So the echo must be "awakened" at the first time, so at the first trigger or am I wrong?

@joeyhage
Copy link
Owner

joeyhage commented Aug 6, 2023

@epicbenz that's my understanding as well. I made a few changes that I am going to test for the next day or so. I will provide an update tomorrow.

@epicbenz
Copy link
Author

epicbenz commented Aug 6, 2023

@epicbenz that's my understanding as well. I made a few changes that I am going to test for the next day or so. I will provide an update tomorrow.

Thank you!
Do you have the same issue, that your Echo Dot always starts with the first song in the Playlist even though Shuffle is activated?

@joeyhage
Copy link
Owner

joeyhage commented Aug 6, 2023

Do you have the same issue, that your Echo Dot always starts with the first song in the Playlist even though Shuffle is activated?

That’s not something I had noticed before but that happens for me as well. I will see if that is a behavior I can change.

@joeyhage
Copy link
Owner

joeyhage commented Aug 6, 2023

I still need to do more testing on the sleeping Amazon devices issue. Hopefully will be close to a reliable solution by next week.

@joeyhage
Copy link
Owner

joeyhage commented Aug 8, 2023

Hi @epicbenz, I have published v1.3.2 which I have tested and verified resolves the issue. You may need to configure the retry delay for your device - I recommend 2000 milliseconds (2 seconds).

@joeyhage joeyhage closed this as completed Aug 8, 2023
@epicbenz
Copy link
Author

epicbenz commented Aug 8, 2023

Hi @epicbenz, I have published v1.3.2 which I have tested and verified resolves the issue. You may need to configure the retry delay for your device - I recommend 2000 milliseconds (2 seconds).

You Sir are a genius. Thanks a lot.

Do you know why the Shuffle function don't work at the beginning? Or should i open a new Issue for this?

@joeyhage
Copy link
Owner

joeyhage commented Aug 8, 2023

You're welcome!

If you could open a separate issue that would be great! I am going to start looking into it as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants