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

Request: Use get_room_mapping Numbers #47

Closed
majorsl opened this issue May 10, 2020 · 23 comments
Closed

Request: Use get_room_mapping Numbers #47

majorsl opened this issue May 10, 2020 · 23 comments
Assignees
Labels
enhancement New feature or request

Comments

@majorsl
Copy link

majorsl commented May 10, 2020

I used miio to retrieve all of my rooms via get_room_mapping. I do not need to use zone coordinates to define my rooms.

Can this card be updated to make use of these for room numbers in addition?

@PiotrMachowski PiotrMachowski self-assigned this May 10, 2020
@PiotrMachowski PiotrMachowski added the enhancement New feature or request label May 10, 2020
@PiotrMachowski
Copy link
Owner

I plan to implement it, but it requires whole card to be rewritten

@r3dsouza
Copy link

r3dsouza commented Aug 3, 2020

+1. Would be great to have an additional setting to include room numbers. It would make this really good card even greater!!

@Maximus97
Copy link

+1 Would be great if this card used the preconfigured rooms in the app

@pznamenskii
Copy link

would love to see this feature - opens up so many possibilities! like asking your VA to clean the kitchen when you drop something with your hands full.

@LucasBednarek
Copy link

LucasBednarek commented Jan 5, 2021

Hey @PiotrMachowski! I have just created a feature of adding rooms:

image
image
image
image

It's a very first version, and I need to clean up code and change some variables names as I used segment nomenclature according to app_segment_clean command, but I want to use names referencing to rooms cleanup. It has multiple rooms selection option, but it causes that card size changing. I am not sure if it's acceptable. I also have a previous version with a list where you may choose only one room at the time.

The code could be not perfect as I am not a programmer anymore, and I have never written in JS. I could send you this initial version, and maybe you would like to review it, share comments and check if it's worth to put additional work on that and commit it in the future? Then I will refactor it and make a pull request.

@PiotrMachowski
Copy link
Owner

@LucasBednarek it looks nice, but there is a small problem from my side: I try to avoid adding new features to this version of a card, because I want to have it completely rewritten in version 2.0.0

@LucasBednarek
Copy link

@PiotrMachowski Great to hear there is a new version on the horizon. Have you already planned any release date?

I am sharing my dirty version here. Maybe it helps someone during the time waiting for a new 2.0.0 version. For languages other than English, the text.js file needs to be aligned accordingly.

Based on v1.2.1: xiaomi_vacuum_map_card.zip

@PiotrMachowski
Copy link
Owner

@LucasBednarek no, I have been postponing it for a quite some time now...

@markrennie71
Copy link

@PiotrMachowski Great to hear there is a new version on the horizon. Have you already planned any release date?

I am sharing my dirty version here. Maybe it helps someone during the time waiting for a new 2.0.0 version. For languages other than English, the text.js file needs to be aligned accordingly.

Based on v1.2.1: xiaomi_vacuum_map_card.zip

works a treat, thank you. Would be nice to select several rooms at once, but does me for now :)

@LucasBednarek
Copy link

@markrennie71 it should be possible to select several rooms at once. Chosen rooms will be bolded. May you check that again?

@markrennie71
Copy link

@markrennie71 it should be possible to select several rooms at once. Chosen rooms will be bolded. May you check that again?

You are right.. I hadn't noticed it was bold. Brilliant. Thanks again. Now only if I cod get th damn S50 to clean edges....

@silentgecko
Copy link

@PiotrMachowski any update on this?
I would love the feature! Personally i don't like zones, and if i can just select rooms, like in the xiaomi app, that would be great!

@roopesh
Copy link

roopesh commented Apr 24, 2021

@LucasBednarek I really want to try the card you created. However, the option for Segments doesn't show up in the card. Is there any trick to this? I am using Xiaomi Map Extractor for the camera & calibration and I've downloaded your card and unzipped it over the existing card.

type: 'custom:xiaomi-vacuum-map-card'
entity: vacuum.s5max_upstairs
map_camera: camera.s5max
camera_calibration: true
segments:
  - name: Master_Bathroom
    segment: 16
  - name: Upstairs_Hallway
    segment: 17
  - name: Master_Bedroom
    segment: 18
  - name: Office_Bathroom
    segment: 19
  - name: Office_Closet
    segment: 20
  - name: Loft
    segment: 21
  - name: Office
    segment: 22
  - name: Laundry_Room
    segment: 23
  - name: KidTwo_Room
    segment: 24
  - name: KidTwo_Closet
    segment: 25
  - name: KidOne_Room
    segment: 26
  - name: KidTwo_Bathroom
    segment: 27
  - name: KidOne_Bathroom
    segment: 28
  - name: KidOne_Closet
    segment: 29
  - name: Master_Closet
    segment: 30

@LucasBednarek
Copy link

@roopesh, did you install the modified version from my previous comment

@roopesh
Copy link

roopesh commented Apr 24, 2021

@LucasBednarek Yep. Is my config correct for segments?

@LucasBednarek
Copy link

LucasBednarek commented Apr 24, 2021

@roopesh It looks ok:

image

I am not sure about that:

map_camera: camera.s5max

Have you properly setup this integration: https://github.com/PiotrMachowski/Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor?

@roopesh
Copy link

roopesh commented Apr 24, 2021

Yeah, the map is showing up, just not Segments in the dropdown. I'm on 2021.4.6. Maybe a breaking change 2021.4?
Screen Shot 2021-04-24 at 4 39 01 PM

@LucasBednarek
Copy link

LucasBednarek commented Apr 24, 2021

Right, I am not using the "name" attribute in Map Extractor. I am on 2021.4.6 too, but I installed it a long time ago. May you check if there are any errors in HA and post screen of the Developer Tools -> Console -> Errors in Chrome:

image

Do you see there xiaomi-vacuum-map-card.js file? What browser do you use?

@LucasBednarek
Copy link

Ah, and I recall some trick - try to clear browsing history or use a private view.

@roopesh
Copy link

roopesh commented Apr 25, 2021

LOL perfect timing, I just cleared cache, reloaded, and it showed up. Apparently reloading resources wasn't enough. Thank you for this awesome enhancement!

@LucasBednarek
Copy link

LucasBednarek commented Apr 25, 2021

Great to hear that! I recall I had this problem when I did the change - the script was cached. You probably used the original addon and then installed the version with my changes. Happy using a modified version! Still, we are waiting for the official 2.0.0 version by @PiotrMachowski, where he should include this functionality.

@mouth4war
Copy link

mouth4war commented May 30, 2021

Is there a way to extract coordinates from rooms and make zones automatically (basically, fill up pre-configured zones from room coordinates)? That way no major change in UI is needed and users can choose room sized zones in the map.

@PiotrMachowski
Copy link
Owner

Handled in v2.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

10 participants