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 "";