PiotrMachowski / Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor

This custom integration provides a way to present a live view of a map for Xiaomi (Roborock/Viomi/Roidmi/Dreame) vacuums without a need for rooting.
MIT License
1.14k stars 121 forks source link

Docker Desktop for Mac - Problems Logging In #389

Closed dro-ex closed 1 year ago

dro-ex commented 1 year ago

Checklist

The problem

When running token extractor and in home assistant container on a mac machine using docker desktop - log in request times out. On host machine and other virtual machines not using docker desktop loin and token extractor works fine.

What version of an integration has described problem?

v2.2.0

What was the last working version of an integration?

No response

What vacuum model do you have problems with?

Roborock s4

What version of Home Assistant do you use?

Home Assistant 2023.1.2

What type of installation are you running?

Home Assistant Container

Camera's configuration

atform: xiaomi_cloud_map_extractor
  host: "192.168.0.24"
  token: "45436247575331714963526e30453779"
  username: "xxxxxx"
  password: "xxxxxx!"
  country: "us"
  auto_update: "true"
  scan_interval: 5
  draw: ['all']
  attributes:
    - calibration_points
    - charger
    - cleaned_rooms
  #  - country
    - goto
    - goto_path
    - goto_predicted_path
    - image
  #  - is_empty
  #  - map_name
    - no_go_areas
    - obstacles
  #  - ignored_obstacles
  #  - obstacles_with_photo
  #  - ignored_obstacles_with_photo
    - path
    - room_numbers
    - rooms
    - vacuum_position
    - vacuum_room
    - vacuum_room_name
    - walls
    - zones
  colors:
      color_map_inside: [49, 52, 59]
      color_map_outside: [32,33,36]
      color_map_wall_v2: [32,33,36]
      color_grey_wall: [32,33,36]
      color_ignored_obstacle: [0, 0, 0, 127]
      color_ignored_obstacle_with_photo: [0, 0, 0, 127]
      color_obstacle: [0, 0, 0, 127]
      color_obstacle_with_photo: [0, 0, 0, 127]
      color_path: [208, 177, 135]
      color_goto_path: [0, 255, 0]
      color_predicted_path: [255, 255, 0, 0]
      color_cleaned_area: [127, 127, 127, 127]
      color_zones: [0xAD, 0xD8, 0xFF, 0x8F]
      color_zones_outline: [0xAD, 0xD8, 0xFF]
      color_virtual_walls: [255, 0, 0]
      color_no_go_zones: [255, 33, 55, 127]
      color_no_go_zones_outline: [255, 0, 0]
      color_charger: [0x66, 0xfe, 0xda, 0x7f]
      color_robo: [235, 235, 235]
      color_room_names: [255, 255, 255, 150]
      color_unknown: [0, 0, 0]
      color_scan: [0xDF, 0xDF, 0xDF]
  room_colors:
      16: [210, 73, 31]
      17: [39, 117, 139]
      18: [116, 141, 59]
      19: [243, 103, 51]
      20: [154, 89, 29]
  map_transformation:
      scale: 2
      trim:
        top: 30
        bottom: 30
        left: 10
        right: 10

Errors shown in the HA logs (if applicable)

This camera config works fine in the operating system version of home assistant

Additional information

I believe this may have to do with the netowrk-host setting not available in docker desktop for mac.

PiotrMachowski commented 1 year ago

HA must be able to talk with the vacuum over LAN for this integration to work.

By the way, I suggest to remove unnecessary entries from attributes section, as they cause additional load on RAM and recorder

dro-ex commented 1 year ago

Is there any work around for this?

PiotrMachowski commented 1 year ago

Check out this section in documentation of python-miio

dro-ex commented 1 year ago

For anyone experiencing this issue while using Docker Desktop for Mac, the workaround that I am using is to switch to Rancher Desktop for Mac using the containerd engine and no Kubernetes services. It somehow gets a bridged network to see the other devices.