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

Missing calibration data @ Version > 2024.10.0 and RE(rand256) Firmware #297

Closed
2 tasks done
RocketSience opened this issue Dec 6, 2024 · 4 comments · Fixed by #298
Closed
2 tasks done

Missing calibration data @ Version > 2024.10.0 and RE(rand256) Firmware #297

RocketSience opened this issue Dec 6, 2024 · 4 comments · Fixed by #298
Assignees
Labels
bug Something isn't working

Comments

@RocketSience
Copy link

Checklist

  • I have updated the integration to the latest version available
  • I have checked if the problem is already reported

The problem

fetching of:
last_loaded_map = sensor_data.get("last_loaded_map", {})
delivers no data, causing no data at all
also resulting in missing calibration data

Error in Card
image

What version of an integration has described problem?

2024.12.0

What was the last working version of an integration?

2024.10.0

What vacuum model do you have problems with?

Roborock S5

Please firmware installed on your Vacuum.

RE(rand256)

What type of platform you use?

Intel NUC (or generic x86_64)

What version of Home Assistant do you use?

2024.12.0

What type of installation are you running?

Home Assistant OS

Logs or Errors shown in the HA snapshots (please enable the Debug Mode) text will be auto formatted to code.

2024-12-06 08:05:45.897 ERROR (MainThread) [custom_components.mqtt_vacuum_camera.coordinator] Exception raised fetching sensor data: 'NoneType' object has no attribute 'get'

Function, that in your opinion is creating the issue.

Vacuum Status Text

Additional information

Solution:
Adding check:

if not last_loaded_map:
last_loaded_map = {"name": "Unsupported"}

        if sensor_data:
            # Assume sensor_data is a dictionary or transform it into the expected format
            battery_level = await self.connector.get_battery_level()
            vacuum_state = await self.connector.get_vacuum_status()
            vacuum_room = self.shared.current_room
            if not vacuum_room:
                vacuum_room = {"in_room": "Unsupported"}
            last_run_stats = sensor_data.get("last_run_stats", {})
            last_loaded_map = sensor_data.get("last_loaded_map", {})
            if not last_loaded_map:
                last_loaded_map = {"name": "Unsupported"}
            formatted_data = {
                "mainBrush": sensor_data.get("mainBrush", 0),
                "sideBrush": sensor_data.get("sideBrush", 0),
                "filter": sensor_data.get("filter", 0),
                "currentCleanTime": sensor_data.get("currentCleanTime", 0),
                "currentCleanArea": sensor_data.get("currentCleanArea", 0),
                "cleanTime": sensor_data.get("cleanTime", 0),
                "cleanArea": sensor_data.get("cleanArea", 0),
                "cleanCount": sensor_data.get("cleanCount", 0),
                "battery": battery_level,
                "state": vacuum_state,
                "last_run_start": last_run_stats.get("startTime", 0),
                "last_run_end": last_run_stats.get("endTime", 0),
                "last_run_duration": last_run_stats.get("duration", 0),
                "last_run_area": last_run_stats.get("area", 0),
                "last_bin_out": sensor_data.get("last_bin_out", 0),
                "last_bin_full": sensor_data.get("last_bin_full", 0),
                "last_loaded_map": last_loaded_map.get("name", "NoMap"),
                "robot_in_room": vacuum_room.get("in_room", "Unsupported"),
            }
            return formatted_data
        return SENSOR_NO_DATA
@RocketSience RocketSience added the bug Something isn't working label Dec 6, 2024
@sca075
Copy link
Owner

sca075 commented Dec 6, 2024

@RocketSience thanks will check why this happened and get back to you as soon.

@sca075
Copy link
Owner

sca075 commented Dec 6, 2024

@RocketSience I couldn't replicate the issue yet but I will put on the 2024.12.1 scheduled in the next Wednesday a Try with the exceptions that will avoid this issue. Really sorry for the inconvenience, but there is already a check in place in case the value is None additional the conditional check already in place will be improved as following:

if not vacuum_room or last_loaded_map:
                vacuum_room = {"in_room": "Unsupported"}
                if not last_loaded_map:
                    last_loaded_map = {"name", "NoMap"}

@sca075 sca075 linked a pull request Dec 6, 2024 that will close this issue
sca075 added a commit that referenced this issue Dec 7, 2024
@sca075
Copy link
Owner

sca075 commented Dec 7, 2024

@RocketSience released 2024.12.1, the issue was closed automatically from the PR, please let me know if it works now.

@RocketSience
Copy link
Author

@sca075 V2024.12.1 works now perfectly! Thank you for the quick fix. And many thanks in general for the fantastic integration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants