ha-sensor.owlet icon indicating copy to clipboard operation
ha-sensor.owlet copied to clipboard

Issue on HA: 2021.6.2

Open JamieP83 opened this issue 3 years ago • 3 comments

Hey, getting this issue, ive only just tried to set this up, never had it working before.

HA: 2021.6.2

sensor:

## https://github.com/jlamendo/ha-sensor.owlet
  - platform: owlet
    username: !secret owletuname
    password: !secret owletpassword
    region: "world"
Logger: homeassistant.components.sensor
Source: custom_components/owlet/sensor.py:145
Integration: Sensor (documentation, issues)
First occurred: 20:48:01 (1 occurrences)
Last logged: 20:48:01

Error while setting up owlet platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 250, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/owlet/sensor.py", line 286, in setup_platform
    for SmartSockDSN in Owlet.devices:
  File "/config/custom_components/owlet/sensor.py", line 193, in devices
    self.get_devices()
  File "/config/custom_components/owlet/sensor.py", line 168, in get_devices
    r = self.api_get("/devices.json")
  File "/config/custom_components/owlet/sensor.py", line 145, in api_get
    headers={"Authorization": "auth_token " + self.__OWLET_TOKEN},
TypeError: can only concatenate str (not "tuple") to str

JamieP83 avatar Jun 04 '21 19:06 JamieP83

This is probably a result of an authentication error. I'll admit, the error checking on this isn't up to what I'd normally do - I wrote it in the early months of my kid's life when I was sleep deprived and short on time :D I'd recommend double checking to make sure that the "username" is the email address you use to log into your account and not any actual username.

jlamendo avatar Jan 13 '22 08:01 jlamendo

I double checked, it is and was the email.

florianwedler avatar Jan 13 '22 19:01 florianwedler

I double checked, it is and was the email.

If you're based in Europe, as I am, then you need to change the region value on the sensor to "europe". I had the same issue and resolved it by doing that, as mentioned in the mbevand/owlet_monitor repo readme :)

wesjdj avatar Feb 13 '22 10:02 wesjdj