LordMike / MBW.BlueRiiot2MQTT

Utility to map between Blue Riiots pool API, and Home Assistant MQTT
47 stars 2 forks source link

Battery sensor always shows 100% #62

Closed dodg3r closed 2 years ago

dodg3r commented 2 years ago

Hi.

Yesterday my blue connect device stopped working. It´s totaly dead and doesnt respond at all. I think my battery is dead. My batterysensor hasnt change from 100% for about two years and it still says 100%.

Although my sensor is dead it still says "awake" When my values are more than 2 days old, shouldnt it be stated as N/A.

image

LordMike commented 2 years ago

I implemented the battery sensor without ever being able to test it.

Could you enable debugging with this environment variable, and copy in the response from BlueRiiot?

It will show me what the values are, so I know what to expect.. :)

LoggingMinimumLevelOverride__MBW.Client.BlueRiiotApi: Verbose

dodg3r commented 2 years ago

Yes. But now the sensor is offline and I have to change battery. Then I suppose it will report 100% battery with a new battery installed.

dodg3r commented 2 years ago
[2021-09-19 15:16:58+00:00 VRB] [MBW.Client.BlueRiiotApi.BlueClient] Received OK for https://api.riiotlabs.com/prod/swimming_pool/1c47f0a1-89ad-4ee9-89c4-f20cc7fbd606/blue, with body: {"data":[{"user_id":"eu-west-1:cb8906b8-211b-4b48-9c7f-ff93ab1594e0","role":"IS_OWNER","swimming_pool_id":"1c47f0a1-89ad-4ee9-89c4-f20cc7fbd606","created":"2020-05-05T10:32:40.701Z","blue_device":{"contract_servicePlan":"plus","sleep_state":"awake","fw_version_psoc":"v2.1.2","last_measure_message_gateway_seq_number":111,"hw_bundle_extender":false,"gateway_id":"BLEX-CC:50:E3:85:B0:A8","contract_isGo":false,"last_measure_message_gateway":"2021-09-16T21:28:00.000Z","hw_region":"eu","contract_isBasic":false,"sf_rc":"rc1","wake_period":4320,"SN":"32192651024","last_measure_message_ble":"2021-06-13T08:58:42.291Z","sf_rc_country":"SE","hw_type":"plus","fw_version_history":[{"timestamp":"2020-05-05T11:11:32.115Z","fw_version_psoc":"v2.1.2"}],"fs_beacon_enabled":true,"contract_isSwaUs":false,"last_measure_message_sigfox":"2020-05-08T10:59:03.000Z","hw_generation":2,"hw_color":"blue","last_measure_message":"2021-09-16T21:28:00.000Z","production_datetime":"2019-07-04T00:00:00.000Z","serial":"00304680","fs_sigfox_enabled":true,"contract_isVpcEligible":true,"location":{"support":"fit50","location":"pipe"},"battery_low":false,"sigfox_geoloc":{"country_name":"Sweden","country":"752","country_code_iso":"SE","timestamp":"2020-05-08T10:59:03.000Z"}},"blue_device_serial":"00304680"}]}
[2021-09-19 15:16:58+00:00 VRB] [MBW.Client.BlueRiiotApi.BlueClient] Received OK for https://api.riiotlabs.com/prod/swimming_pool/1c47f0a1-89ad-4ee9-89c4-f20cc7fbd606/blue/00304680/lastMeasurements?mode=blue_and_strip, with body: {"status":"OK","last_blue_measure_timestamp":"2021-09-16T19:04:00.000Z","blue_device_serial":"00304680","swimming_pool_id":"1c47f0a1-89ad-4ee9-89c4-f20cc7fbd606","data":[{"name":"temperature","priority":10,"timestamp":"2021-09-16T19:04:00.000Z","expired":true,"value":27.9,"trend":"decrease","ok_min":20,"ok_max":40,"warning_high":50,"warning_low":5,"gauge_max":50,"gauge_min":0,"issuer":"gateway"},{"name":"ph","priority":20,"timestamp":"2021-09-16T19:04:00.000Z","expired":true,"value":7.4,"trend":"stable","ok_min":7.2,"ok_max":7.6,"warning_high":8.4,"warning_low":6.6,"gauge_max":10,"gauge_min":5,"issuer":"gateway"},{"name":"orp","priority":30,"timestamp":"2021-09-16T19:04:00.000Z","expired":true,"value":545,"trend":"stable","ok_min":550,"ok_max":650,"warning_high":900,"warning_low":400,"gauge_max":1000,"gauge_min":300,"issuer":"gateway"},{"name":"conductivity","priority":40,"timestamp":"2021-09-16T19:04:00.000Z","expired":true,"value":485,"trend":"decrease","ok_min":300,"ok_max":10000,"warning_high":12000,"warning_low":200,"gauge_max":20000,"gauge_min":0,"issuer":"gateway"}]}
[2021-09-19 15:16:59+00:00 VRB] [MBW.Client.BlueRiiotApi.BlueClient] Received OK for https://api.riiotlabs.com/prod/swimming_pool/1c47f0a1-89ad-4ee9-89c4-f20cc7fbd606/guidance?lang=&mode=interactive_v03, with body: {"guidance":{"swp_global_status":"SP_NOT_OK","chemicalPackId":"riiot_generic","issue_to_fix":{"task_identifier":"ORP_LOW","current_value":545,"ideal_value":600,"products":[{"id":"riiot_ctx200","display_name":"chlorine","brand":"Generic","quantity":196,"ref_product_quantity":50,"ref_product_quantity_unit":"g","ref_water_quantity":10,"ref_water_quantity_unit":"m³","quantity_standardized":196.00000000000003,"quantity_unit":"g","pack_id":"riiot_generic"}],"wait_duration":180,"pool_volume":39.2,"steps":[{"title":"Stop swimming","message":"It is important to avoid exposure to the product. Ensure nobody is in the swimming pool.\nYou should also remove any object from the swimming pool."},{"title":"Add 196 g of chlorine","message":"Place 196 g of chlorine inside the skimmers or in the floating dispensers.\n\nProduct reference: 50 g / 10 m³ of water.\nAlways follow the product instructions."},{"title":"Activate filtration","message":"Start up the filtration system so that the product dissolves when the water flows through the skimmers."}],"user_action":"Done","poststeps":[],"chemicalPackId":"riiot_generic","swp_range":{"ok_min":550,"ok_max":650,"warning_high":900,"warning_low":400,"ideal":600},"action_title":"Add 196 g of chlorine","issue_title":"ORP is too low","info":[]},"status":"COMPUTED","bottom_links":[],"swimming_pool_id":"1c47f0a1-89ad-4ee9-89c4-f20cc7fbd606","lang":"en"},"vpc_sharing":{"sharing_status":"not_shared"}}
[2021-09-19 15:16:59+00:00 VRB] [MBW.Client.BlueRiiotApi.BlueClient] Received OK for https://api.riiotlabs.com/prod/swimming_pool/1c47f0a1-89ad-4ee9-89c4-f20cc7fbd606/lastMeasurements, with body: {"data":[]}
[2021-09-19 15:17:00+00:00 VRB] [MBW.Client.BlueRiiotApi.BlueClient] Received OK for https://api.riiotlabs.com/prod/swimming_pool/1c47f0a1-89ad-4ee9-89c4-f20cc7fbd606/weather?lang=, with body: {"swimming_pool_id":"1c47f0a1-89ad-4ee9-89c4-f20cc7fbd606","data":{"timestamp":"2021-09-19T15:17:00.000Z","temperature_current":12,"wind_speed_current":0.45,"wind_direction_current":34,"weather_current_icon_code":"04d","weather_current_description":"broken clouds","weather_current_code":803,"uv_current":0.5,"temperature_min":7,"temperature_max":13,"weather_future_icon_code":"03n","weather_future_timestamp":"2021-09-19T18:00:00.000Z","weather_future_temp":11,"weather_future_timeframe_one_icon_code":"03d","weather_future_timeframe_one_timestamp":"2021-09-19T17:00:00.000Z","weather_future_timeframe_two_icon_code":"03n","weather_future_timeframe_two_timestamp":"2021-09-19T18:00:00.000Z"},"lang":"en"}
[2021-09-19 15:17:00+00:00 WRN] [MBW.BlueRiiot2MQTT.Service.PoolUpdater.SingleBlueRiiotPoolUpdater] There were 1 consecutive updates without new data for 'HiBerry Pool', setting next run to be 09/19/2021 15:18:00, waiting 00:01:00
[2021-09-19 15:17:00+00:00 INF] [MBW.HassMQTT.HassMqttManager] Pushed 12 discovery documents, 11 values and 12 attribute changes
[2021-09-19 15:18:00+00:00 VRB] [MBW.Client.BlueRiiotApi.BlueClient] Received OK for https://api.riiotlabs.com/prod/swimming_pool/1c47f0a1-89ad-4ee9-89c4-f20cc7fbd606/blue, with body: {"data":[{"user_id":"eu-west-1:cb8906b8-211b-4b48-9c7f-ff93ab1594e0","role":"IS_OWNER","swimming_pool_id":"1c47f0a1-89ad-4ee9-89c4-f20cc7fbd606","created":"2020-05-05T10:32:40.701Z","blue_device":{"contract_servicePlan":"plus","sleep_state":"awake","fw_version_psoc":"v2.1.2","last_measure_message_gateway_seq_number":111,"hw_bundle_extender":false,"gateway_id":"BLEX-CC:50:E3:85:B0:A8","contract_isGo":false,"last_measure_message_gateway":"2021-09-16T21:28:00.000Z","hw_region":"eu","contract_isBasic":false,"sf_rc":"rc1","wake_period":4320,"SN":"32192651024","last_measure_message_ble":"2021-06-13T08:58:42.291Z","sf_rc_country":"SE","hw_type":"plus","fw_version_history":[{"timestamp":"2020-05-05T11:11:32.115Z","fw_version_psoc":"v2.1.2"}],"fs_beacon_enabled":true,"contract_isSwaUs":false,"last_measure_message_sigfox":"2020-05-08T10:59:03.000Z","hw_generation":2,"hw_color":"blue","last_measure_message":"2021-09-16T21:28:00.000Z","production_datetime":"2019-07-04T00:00:00.000Z","serial":"00304680","fs_sigfox_enabled":true,"contract_isVpcEligible":true,"location":{"support":"fit50","location":"pipe"},"battery_low":false,"sigfox_geoloc":{"country_name":"Sweden","country":"752","country_code_iso":"SE","timestamp":"2020-05-08T10:59:03.000Z"}},"blue_device_serial":"00304680"}]}
[2021-09-19 15:18:00+00:00 VRB] [MBW.Client.BlueRiiotApi.BlueClient] Received OK for https://api.riiotlabs.com/prod/swimming_pool/1c47f0a1-89ad-4ee9-89c4-f20cc7fbd606/blue/00304680/lastMeasurements?mode=blue_and_strip, with body: {"status":"OK","last_blue_measure_timestamp":"2021-09-16T19:04:00.000Z","blue_device_serial":"00304680","swimming_pool_id":"1c47f0a1-89ad-4ee9-89c4-f20cc7fbd606","data":[{"name":"temperature","priority":10,"timestamp":"2021-09-16T19:04:00.000Z","expired":true,"value":27.9,"trend":"decrease","ok_min":20,"ok_max":40,"warning_high":50,"warning_low":5,"gauge_max":50,"gauge_min":0,"issuer":"gateway"},{"name":"ph","priority":20,"timestamp":"2021-09-16T19:04:00.000Z","expired":true,"value":7.4,"trend":"stable","ok_min":7.2,"ok_max":7.6,"warning_high":8.4,"warning_low":6.6,"gauge_max":10,"gauge_min":5,"issuer":"gateway"},{"name":"orp","priority":30,"timestamp":"2021-09-16T19:04:00.000Z","expired":true,"value":545,"trend":"stable","ok_min":550,"ok_max":650,"warning_high":900,"warning_low":400,"gauge_max":1000,"gauge_min":300,"issuer":"gateway"},{"name":"conductivity","priority":40,"timestamp":"2021-09-16T19:04:00.000Z","expired":true,"value":485,"trend":"decrease","ok_min":300,"ok_max":10000,"warning_high":12000,"warning_low":200,"gauge_max":20000,"gauge_min":0,"issuer":"gateway"}]}
[2021-09-19 15:18:01+00:00 VRB] [MBW.Client.BlueRiiotApi.BlueClient] Received OK for https://api.riiotlabs.com/prod/swimming_pool/1c47f0a1-89ad-4ee9-89c4-f20cc7fbd606/guidance?lang=&mode=interactive_v03, with body: {"guidance":{"swp_global_status":"SP_NOT_OK","chemicalPackId":"riiot_generic","issue_to_fix":{"task_identifier":"ORP_LOW","current_value":545,"ideal_value":600,"products":[{"id":"riiot_ctx200","display_name":"chlorine","brand":"Generic","quantity":196,"ref_product_quantity":50,"ref_product_quantity_unit":"g","ref_water_quantity":10,"ref_water_quantity_unit":"m³","quantity_standardized":196.00000000000003,"quantity_unit":"g","pack_id":"riiot_generic"}],"wait_duration":180,"pool_volume":39.2,"steps":[{"title":"Stop swimming","message":"It is important to avoid exposure to the product. Ensure nobody is in the swimming pool.\nYou should also remove any object from the swimming pool."},{"title":"Add 196 g of chlorine","message":"Place 196 g of chlorine inside the skimmers or in the floating dispensers.\n\nProduct reference: 50 g / 10 m³ of water.\nAlways follow the product instructions."},{"title":"Activate filtration","message":"Start up the filtration system so that the product dissolves when the water flows through the skimmers."}],"user_action":"Done","poststeps":[],"chemicalPackId":"riiot_generic","swp_range":{"ok_min":550,"ok_max":650,"warning_high":900,"warning_low":400,"ideal":600},"action_title":"Add 196 g of chlorine","issue_title":"ORP is too low","info":[]},"status":"COMPUTED","bottom_links":[],"swimming_pool_id":"1c47f0a1-89ad-4ee9-89c4-f20cc7fbd606","lang":"en"},"vpc_sharing":{"sharing_status":"not_shared"}}
[2021-09-19 15:18:01+00:00 VRB] [MBW.Client.BlueRiiotApi.BlueClient] Received OK for https://api.riiotlabs.com/prod/swimming_pool/1c47f0a1-89ad-4ee9-89c4-f20cc7fbd606/lastMeasurements, with body: {"data":[]}
[2021-09-19 15:18:02+00:00 VRB] [MBW.Client.BlueRiiotApi.BlueClient] Received OK for https://api.riiotlabs.com/prod/swimming_pool/1c47f0a1-89ad-4ee9-89c4-f20cc7fbd606/weather?lang=, with body: {"swimming_pool_id":"1c47f0a1-89ad-4ee9-89c4-f20cc7fbd606","data":{"timestamp":"2021-09-19T15:18:01.000Z","temperature_current":12,"wind_speed_current":0.45,"wind_direction_current":34,"weather_current_icon_code":"04d","weather_current_description":"broken clouds","weather_current_code":803,"uv_current":0.5,"temperature_min":7,"temperature_max":13,"weather_future_icon_code":"03n","weather_future_timestamp":"2021-09-19T18:00:00.000Z","weather_future_temp":11,"weather_future_timeframe_one_icon_code":"03d","weather_future_timeframe_one_timestamp":"2021-09-19T17:00:00.000Z","weather_future_timeframe_two_icon_code":"03n","weather_future_timeframe_two_timestamp":"2021-09-19T18:00:00.000Z"},"lang":"en"}
[2021-09-19 15:18:02+00:00 WRN] [MBW.BlueRiiot2MQTT.Service.PoolUpdater.SingleBlueRiiotPoolUpdater] There were 2 consecutive updates without new data for 'HiBerry Pool', setting next run to be 09/19/2021 15:22:02, waiting 00:04:00
[2021-09-19 15:18:02+00:00 INF] [MBW.HassMQTT.HassMqttManager] Pushed 0 discovery documents, 0 values and 5 attribute changes`
LordMike commented 2 years ago

Was this after the battery was replaced?

It should have been possible to get a response from the API, even with the sensor offline.

dodg3r commented 2 years ago

Sorry. I haven't bought a new battery yet. This log is when my device still is offline.

LordMike commented 2 years ago

In your logs, there's this:

{
    "data": [{
            "user_id": "eu-west-1:cb8906b8-211b-4b48-9c7f-ff93ab1594e0",
            "role": "IS_OWNER",
            "blue_device": {
                // ....
                "battery_low": false, <--- Battery is "not low".. 
                "sigfox_geoloc": ...
            },
            "blue_device_serial": "..."
        }
    ]
}
LordMike commented 2 years ago

Oh cool - then the value is useless..

What does the blue riiot app say?

dodg3r commented 2 years ago

It says that the readings is 3 days old. I have no history graph and no contact with the sensor.

dodg3r commented 2 years ago

Where does your battery sensor gets its values from. Or is the value just a true/false value?

LordMike commented 2 years ago

I believe it's just this boolean true/false - I mapped false to 100% and true to something like 20%.

But if it's useless, I'll just remove the sensor.

... the app shows nothing with regards to battery? :|

dodg3r commented 2 years ago

No not what I can see. In blueriiot manual it says that the device makes a sound when there is low battery but I didn't notice any sound.

LordMike commented 2 years ago

Well - I'll remove the battery sensor - and see if I can improve the unavailability of the sensors instead.. If the device is "awake", it should report in 20-ish times a day, so if it doesn't - that's bad.

dodg3r commented 2 years ago

Yeah. Thanks for your great work. 👍

dodg3r commented 2 years ago

Hi

I talked to blueriiot support and they said that they are working on a low battery warning but couldn't say when it is ready.

LordMike commented 2 years ago

Great.. Now at least we know it's completely useless :D

dodg3r commented 2 years ago

😂😂😂