Skip to content

Fix roomba 980 position report#35316

Merged
balloob merged 2 commits into
home-assistant:devfrom
shenxn:roomba-pos
May 7, 2020
Merged

Fix roomba 980 position report#35316
balloob merged 2 commits into
home-assistant:devfrom
shenxn:roomba-pos

Conversation

@shenxn
Copy link
Copy Markdown
Contributor

@shenxn shenxn commented May 7, 2020

Breaking change

Proposed change

According to #35120 the Roomba 980 seems to report position data under wifistat topic. To fix that, the wifistat exclusion is removed. This leads to a lot more state updates so I think we need to implement something to filter out wifi info for all devices eventually.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example entry for configuration.yaml:

# Example configuration.yaml

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 🥈 Silver
  • 🥇 Gold
  • 🏆 Platinum

@probot-home-assistant
Copy link
Copy Markdown

Hey there @pschmitt, @cyr-ius, mind taking a look at this pull request as its been labeled with a integration (roomba) you are listed as a codeowner for? Thanks!
(message by CodeOwnersMention)

@bdraco
Copy link
Copy Markdown
Member

bdraco commented May 7, 2020

@shenxn You weren't kidding about "a lot more state updates". That is going to have a bit of performance impact.

How about a check in all the on_messages to avoid the self.schedule_update_ha_state() if the only thing being reported is signal?

2020-05-07 05:15:29 DEBUG (Thread-7) [custom_components.roomba.irobot_base] Got new state from the vacuum: {'state': OrderedDict([('reported', OrderedDict([('signal', OrderedDict([('rssi', -45), ('snr', 45), ('noise', -90)]))]))])}
2020-05-07 05:15:30 DEBUG (Thread-7) [custom_components.roomba.irobot_base] Got new state from the vacuum: {'state': OrderedDict([('reported', OrderedDict([('signal', OrderedDict([('rssi', -47), ('snr', 43), ('noise', -90)]))]))])}
2020-05-07 05:15:30 DEBUG (Thread-6) [custom_components.roomba.irobot_base] Got new state from the vacuum: {'state': OrderedDict([('reported', OrderedDict([('signal', OrderedDict([('rssi', -47), ('snr', 43), ('noise', -90)]))]))])}
2020-05-07 05:15:30 DEBUG (Thread-8) [custom_components.roomba.irobot_base] Got new state from the vacuum: {'state': OrderedDict([('reported', OrderedDict([('signal', OrderedDict([('rssi', -42), ('snr', 48), ('noise', -90)]))]))])}
2020-05-07 05:15:31 DEBUG (Thread-7) [custom_components.roomba.irobot_base] Got new state from the vacuum: {'state': OrderedDict([('reported', OrderedDict([('signal', OrderedDict([('rssi', -48), ('snr', 42), ('noise', -90)]))]))])}
2020-05-07 05:15:31 DEBUG (Thread-6) [custom_components.roomba.irobot_base] Got new state from the vacuum: {'state': OrderedDict([('reported', OrderedDict([('signal', OrderedDict([('rssi', -46), ('snr', 44), ('noise', -90)]))]))])}
2020-05-07 05:15:31 DEBUG (Thread-8) [custom_components.roomba.irobot_base] Got new state from the vacuum: {'state': OrderedDict([('reported', OrderedDict([('signal', OrderedDict([('rssi', -41), ('snr', 49), ('noise', -90)]))]))])}

@shenxn shenxn changed the title Remove wifistat exclusion from roomba Fix roomba 980 position report May 7, 2020
@shenxn
Copy link
Copy Markdown
Contributor Author

shenxn commented May 7, 2020

@bdraco I implemented some kind of filter to get rid of wifistate updates. Now it should work well.

@bdraco
Copy link
Copy Markdown
Member

bdraco commented May 7, 2020

2020-05-07 14:21:08 DEBUG (Thread-7) [custom_components.roomba.irobot_base] Got new state from the vacuum: {'state': OrderedDict([('reported', OrderedDict([('cleanMissionStatus', OrderedDict([('cycle', 'clean'), ('phase', 'run'), ('expireM', 0), ('rechrgM', 0), ('error', 0), ('notReady', 0), ('mssnM', 0), ('sqft', 3), ('initiator', 'localApp'), ('nMssn', 54)]))]))])}
2020-05-07 14:21:08 DEBUG (Thread-7) [custom_components.roomba.irobot_base] Got new state from the vacuum: {'state': OrderedDict([('reported', OrderedDict([('cleanMissionStatus', OrderedDict([('cycle', 'clean'), ('phase', 'run'), ('expireM', 0), ('rechrgM', 0), ('error', 0), ('notReady', 0), ('mssnM', 0), ('sqft', 3), ('initiator', 'localApp'), ('nMssn', 54)]))]))])}
2020-05-07 14:21:08 DEBUG (Thread-7) [custom_components.roomba.irobot_base] Got new state from the vacuum: {'state': OrderedDict([('reported', OrderedDict([('pose', OrderedDict([('theta', 0), ('point', OrderedDict([('x', 91), ('y', -45)]))]))]))])}
2020-05-07 14:21:13 DEBUG (Thread-7) [custom_components.roomba.irobot_base] Got new state from the vacuum: {'state': OrderedDict([('reported', OrderedDict([('pose', OrderedDict([('theta', 167), ('point', OrderedDict([('x', 130), ('y', -35)]))]))]))])}

Much better. No more noticeable cpu impact.

Great work 👍

@bdraco bdraco added this to the 0.109.6 milestone May 7, 2020
@balloob balloob merged commit 9d57043 into home-assistant:dev May 7, 2020
@balloob
Copy link
Copy Markdown
Member

balloob commented May 7, 2020

Wifi signal sensors preferably should be their own sesnor entities and disabled by default (return False from entity_registry_enabled_default property on entity)

balloob pushed a commit that referenced this pull request May 7, 2020
@balloob balloob mentioned this pull request May 7, 2020
@shenxn shenxn deleted the roomba-pos branch May 7, 2020 19:05
@lock lock Bot locked and limited conversation to collaborators May 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Roomba 980 does not show position information as of 0.109

4 participants