Please help - Shark Vacuum Room cleaning based floorplan

Hi,

I’m using the custom:floorplan-card and I’m trying to setup the Shark Vacuum for room cleaning. I have two SVGs (Den and Dining Room) that represent the shark vacuum in the floorplan. When I press the selected vacuum icon, it cleans that room. I have that working. What I can’t figure out is how to spin the icon for that room it is cleaning.

The shark vacuum integration does not return the room its cleaning, so I have no way to tell which room it is cleaning. So, when I press the shark SVG for a specified room, I’ll need to save off which room its in.

How can I accomplish that?

                - element: shark.clean_den
                  tap_action:
                    action: call-service
                    service: sharkiq.clean_room
                    service_data:
                      entity_id: vacuum.kitchen                    
                      rooms: Den
                  state_action:
                    service: floorplan.class_set
                    service_data: |
                      >  
                        if (element.state === "cleaning")  return "spinning-vacuum";   
                        else  if (element.state === "returning")  return "returning-vacuum";
                        else if (element.state === "error")  return "error-vacuum";
                        else return "";

                - element: shark.clean_dining
                  tap_action:
                    action: call-service
                    service: sharkiq.clean_room
                    service_data:
                      entity_id: vacuum.kitchen                    
                      rooms: "Dining Room" 
                  state_action:
                    service: floorplan.class_set
                    service_data: |
                      >  
                        if (element.state === "cleaning")  return "spinning-vacuum";   
                        else  if (element.state === "returning")  return "returning-vacuum";
                        else if (element.state === "error")  return "error-vacuum";
                        else return "";

Please help!!! I submitted this request for help 16 days ago.

When I select a vacuum icon on my floorplan which indicates that I want to clean that room. I would like to spin the icon and maybe change the color.

Does anyone have any idea how to save off which room is being clean so that I can spin the icon?

The shark vacuum device does not return which room is being cleaned.

Thanks for your help!!

Kevin

Can’t give you specific help on the code you’re using, sorry!

I’d suggest an input_select as helper, where you can save the room the vacuum is in. If you don’t call a service directly from your tap_action, but rather call a script, you can setup a script sequence where you can start the vacuum and set the room value in an input_select.

Afterwards you can easily read the state of the input_select and use it in your other configuration.