wez / govee2mqtt

Govee2MQTT: Connect Govee lights and devices to Home Assistant
MIT License
426 stars 24 forks source link

Can't get the bridge to start #179

Closed marclefevre closed 5 months ago

marclefevre commented 5 months ago

I'm trying to get the bridge going from the start. I installed it from HACS and configured it with my already-installed mosquitto. I acquired an api key and have double checked my e-mail, password and api key values in the configuration but I still get this in the logs when I start the add-on. From what I can guess, this error suggests that my credentials are wrong. If that is the case, how do I troubleshoot the issue?

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
GOVEE_API_KEY=REDACTED
GOVEE_MQTT_HOST=10.248.0.40
GOVEE_TEMPERATURE_SCALE=F
GOVEE_EMAIL=REDACTED
GOVEE_PASSWORD=REDACTED
GOVEE_MQTT_PASSWORD=REDACTED
GOVEE_MQTT_USER=hass
GOVEE_MQTT_PORT=1883
++ cd /app
++ exec /app/govee serve
[2024-04-27T07:19:42 INFO  govee::commands::serve] Starting service. version 2024.01.24-ea3cd430
[2024-04-27T07:19:42 INFO  govee::commands::serve] Querying platform API for device list
[2024-04-27T07:19:43 WARN  govee::cache] request https://openapi.api.govee.com/router/api/v1/user/devices status 401: Unauthorized. Response body: , will use prior results
Error: request https://openapi.api.govee.com/router/api/v1/user/devices status 401: Unauthorized. Response body: 

Stack backtrace:
   0: anyhow::error::<impl anyhow::Error>::msg
   1: anyhow::__private::format_err
   2: govee::cache::CacheResult<T>::into_result
   3: govee::platform_api::GoveeApiClient::get_devices::{{closure}}
   4: govee::commands::serve::ServeCommand::run::{{closure}}
   5: govee::Args::run::{{closure}}
   6: tokio::runtime::park::CachedParkThread::block_on
   7: tokio::runtime::runtime::Runtime::block_on
   8: govee::main
   9: std::sys_common::backtrace::__rust_begin_short_backtrace
  10: std::rt::lang_start::{{closure}}
  11: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/ops/function.rs:284:13
  12: std::panicking::try::do_call
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panicking.rs:552:40
  13: std::panicking::try
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panicking.rs:516:19
  14: std::panic::catch_unwind
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panic.rs:142:14
  15: std::rt::lang_start_internal::{{closure}}
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/rt.rs:148:48
  16: std::panicking::try::do_call
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panicking.rs:552:40
  17: std::panicking::try
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panicking.rs:516:19
  18: std::panic::catch_unwind
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panic.rs:142:14
  19: std::rt::lang_start_internal
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/rt.rs:148:20
  20: std::rt::lang_start
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped
fitchlay commented 5 months ago

Removing the MQTT port number from the configuration worked for me. Maybe it will for you as well.

marclefevre commented 5 months ago

Thanks for the suggestion. I tried that and got the same error. I also tried removing the MQTT user and password to see if that made any difference. It didn't. My MQTT broker is not running on the same machine as my HA so I left the broker entry pointing to that IP address.

fitchlay commented 5 months ago

Taking a closer look at your error, it looks like it is failing to confirm the API key. I assume you checked for typos in the API key but if not, give that a try.

Or, you may want to get a new API key.

marclefevre commented 5 months ago

I probably checked and re-checked that original key a half dozen times. I took your advice and requested a new key and that one worked! I don't know why that option didn't occur to me but I'm glad you suggested it.