Closed s-weise closed 2 weeks ago
Thanks! A bit busy at the moment, will have a look as soon as possible.
@s-weise Hey! It seems like for some reason the API does not return the expected JSON response when you sign in. Could you maybe do the following from the commandline?
curl -X POST -H "Content-Type: application/json" -d '{"email": "foobar", "password": "foobar"}' https://app-api.cowboy.bike/auth/sign_in
Replace foobar
with your username and password. Then, share back the results. Don't forget to remove the username/password when reporting back 🙂
Thank you!
Hi. here is the output of curl:
{
"data": {
"active_subscriptions": [
],
"available_languages": [
"en",
"fr",
"nl",
"de"
],
"available_plans": [
{
"app_texts": {
"asterisk_note": "* Billed annually (€240/year)",
"description": "Keep your bike in perfect shape with our on-demand maintenance service with Cowboy-trained technicians. Now available in 22 cities globally and expanding rapidly.",
"image_url": "https://s3.eu-west-3.amazonaws.com/app.cowboy.bike/assets/cowboy_care_header.webp",
"included": [
{
"description": "There’s no limit to the number of appointments you can book. We’ll be there.",
"title": "Unlimited bookings"
},
{
"description": "An expert technician comes to the address of choice to service your bike.",
"title": "Mobile Service"
},
{
"description": "The replacement parts required to maintain your bike (brake pads, tires, and inner tubes) are included in the cost of the subscription.",
"title": "Spare parts included"
},
{
"description": "We take care of any puncture, replacing the inner tube or the tire, depending on the damage.",
"title": "Flat tires covered"
}
],
"purchase_text": "Subscribe for €20/month*",
"title": "Cowboy Care"
},
"currency": "EUR",
"name": "Cowboy Care",
"period": 12,
"price": 24000,
"purchase_link": "xxx",
"qover_general_conditions_url": "xxx",
"qover_insurance_info_url": "xxx",
"type": "care"
},
{
"app_texts": {
"asterisk_note": "* Billed annually (€159/year)",
"description": "Ride worry-free with theft insurance for your bike. Our Theft Insurance package gives you access to theft detection notifications and a convenient plan to insure your ride.",
"image_url": "https://s3.eu-west-3.amazonaws.com/app.cowboy.bike/assets/theft_insurance_header.webp",
"included": [
{
"description": "Get notified if someone tries to snatch your bike. Whenever your bike moves unexpectedly, we’ll send you real-time tracking via the app.",
"title": "Theft Alerts"
},
{
"description": "In case your bike gets stolen, we will reimburse you your full bike value. There’s no depreciation and no excess in the plan.",
"title": "Insurance with no depreciation or excess"
}
],
"purchase_text": "Subscribe for €13.25/month*",
"title": "Theft Insurance"
},
"currency": "EUR",
"name": "Theft Insurance",
"period": 12,
"price": 15900,
"purchase_link": "xxx",
"qover_general_conditions_url": "xxx",
"qover_insurance_info_url": "xxx",
"type": "theft"
}
],
"avatar_url": null,
"avatars": null,
"bike": {
"activated_at": "xxx",
"autonomies": [
{
"calibrated": false,
"full_battery_range": 61.59,
"ride_mode": "adaptive_eu"
},
{
"calibrated": true,
"full_battery_range": 61.59,
"ride_mode": "static_eu"
},
{
"calibrated": false,
"full_battery_range": 60.0,
"ride_mode": "static_offroad"
},
{
"calibrated": false,
"full_battery_range": 76.99,
"ride_mode": "adaptive_eco_eu"
},
{
"calibrated": false,
"full_battery_range": 60.0,
"ride_mode": "adaptive_us"
},
{
"calibrated": false,
"full_battery_range": 60.0,
"ride_mode": "static_us"
},
{
"calibrated": false,
"full_battery_range": 75.0,
"ride_mode": "adaptive_eco_us"
},
{
"calibrated": false,
"full_battery_range": 60.0,
"ride_mode": "assistance_off"
}
],
"autonomy": 63.09,
"available_features": {
"apple_health": "available",
"auto_unlock": "available",
"connected_ride": "available",
"crash_detection": "available",
"ride_mode": "hidden",
"safety_alerts": "available",
"strava": "available",
"theft_alerts": "available",
"trip_analysis": "available",
"trip_sharing": "available",
"watch_app": "available"
},
"battery_state_of_charge": 70,
"battery_state_of_charge_updated_at": "2024-09-10T11:13:58.277+02:00",
"crashed": false,
"debug_logs": false,
"duration_modifier": 1.5,
"firmware_version": "v4.16.5",
"has_cowboy_connect": true,
"id": xxx,
"insurance_conditions": {
"min_trip_distance": 2.0,
"passed": true,
"starts_at": "xxx"
},
"last_crash_started_at": null,
"last_ride_mode": "static_eu",
"mac_address": "xxx",
"model": {
"description": "Cowboy 2",
"name": "Cowboy 2"
},
"nickname": null,
"passkey": "xxx",
"pcb_battery_state_of_charge": 86.0,
"pending_settings": {
},
"position": {
"accuracy": xxx,
"address": "xxx",
"adjusted_accuracy": "xxx",
"created_at": "2024-08-07T12:49:29.963+02:00",
"elevation": xxx,
"id": xxx,
"latitude": xxx,
"longitude": xxx,
"received_at": "2024-08-07T12:49:21.000+02:00",
"source": "bike",
"type": "trip"
},
"seen_at": "2024-09-10T11:13:58.277+02:00",
"serial_number": "xxx",
"settings": {
"auto_lock": 30,
"auto_unlock": false,
"brake_light_sensitivity": 10,
"crash_detection": false,
"default_ride_mode": null,
"led_brightness": 100,
"manual_unlock": 0,
"max_speed": 28,
"smart_lock": true,
"theft_alerts": false
},
"sku": {
"code": "xxx",
"color": "Black",
"color_hex": "#0C0D0D",
"features": {
"available_sku_conversion": null,
"available_speeds": {
"default": 28,
"offroad": null
},
"battery_autonomy": 60,
"battery_leds": 5,
"default_ble_passkey": "",
"displayed_speeds": {
"default": 25,
"offroad": null
},
"has_wireless_charger": false,
"modbus_devices": [
1,
4,
10
],
"throttle_off_voltage": 0.65
},
"grade": "No Grade",
"market": "EU"
},
"sku_code": "xxx",
"stolen": false,
"total_co2_saved": xxx,
"total_distance": xxx,
"total_duration": xxx,
"trip_sharing": false,
"warranty_ends_at": "xxx",
"warranty_started_at": "xxx"
},
"biography": null,
"country_code": "DE",
"cover_url": null,
"crash_detection": {
"contacts": [
],
"max_contacts": 2
},
"created_at": "xxx",
"email": "xxx",
"emergency_phone_number": "xxx",
"facebook_profile_url": null,
"facebook_username": null,
"first_bike_assigned_at": "xxx",
"first_name": "xxx",
"human_efficiency_factor": xxx,
"id": xxx,
"in_app_shop_enabled": true,
"instagram_profile_url": null,
"instagram_username": null,
"intercom_token": "xxx",
"investor_number": null,
"last_name": "xxx",
"nickname": "xxx",
"phone_number": "xxx",
"profile_link": "xxx",
"provider": "email",
"referral_program": {
"campaign": "de_DE",
"dashboard_link": "xxx",
"enabled": true
},
"role": "user",
"settings": {
"distance_units": "kilometers",
"referral_program": true,
"temperature_units": "celsius",
"weight_units": "kilograms"
},
"social_features": false,
"strava_authorized": false,
"subscription": null,
"sync_apple_health": false,
"sync_google_fit": false,
"sync_strava": false,
"total_co2_saved": xxx,
"total_distance": xxx,
"total_duration": xxx,
"uid": "xxx",
"updated_at": "2024-09-10T20:27:07.510+02:00",
"uuid": "xxx"
}
}
Thank you, I found the problem. The reason it failed is because nickname
is null (ie. you didn't assign a name to it) – I assumed there's always a nickname.
It should be fixed with the latest release, would be great if you could confirm.
Hi, now it works. Thanks. Small problem are the generated sensor names. sensor.cowboy_2_mileage -> good sensor.none_remaining_battery -> better sensor.cowboy_2_remaining_battery
Indeed, need to look into that. Thanks for confirming!
System Health details
System Information
Home Assistant Cloud
logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | okDashboards
dashboards | 2 -- | -- resources | 0 views | 0 mode | storageRecorder
oldest_recorder_run | 11. Mai 2024 um 11:55 -- | -- current_recorder_run | 11. Mai 2024 um 14:01 estimated_db_size | 0.23 MiB database_engine | sqlite database_version | 3.44.2Checklist
Describe the issue
This issue happens in my main instance and in this test instance. HA runs in a docker container. The integration was copied into the config/custom_components/ path. When I fill in my credentials and hit send the error "Unknown error occurred" appears. When I use wrong credetials the correct error "Invalid authentication" appears.
Reproduction steps
Debug logs
Diagnostics dump
No response