Hi Guys,
first off thanks to @Tetsuo for this Widget nice work
I’m trying to adopt it for my ecovas Deebot. I got everything done and working fine. Just got one problem with the area cleaning. I got no numbers for the room i got letters. My skills are just to low to figure out how to send the correct command.
If i select a room i need to send the command: “spotArea:A;B;C” and so on…
Here is the part that’s needs attention:
- component: oh-repeater
config:
sourceType: range
for: i
rangeStart: 0
rangeStop: =JSON.parse(props.rooms).length / props.chunkSize
fragment: true
visible: =items[props.itemPrefix+"_State"].state !== "cleaning"
slots:
default:
- component: f7-row
config: {}
slots:
default:
- component: oh-repeater
config:
for: roomChunk
in: =JSON.parse(props.rooms).slice(loop.i * props.chunkSize, props.chunkSize * (loop.i + 1))
fragment: true
slots:
default:
- component: f7-col
slots:
default:
- component: f7-card
config:
style:
height: 3rem
line-height: 3rem
slots:
default:
- component: f7-card-content
config:
style:
padding: 0
marging: 0
height: 3rem
slots:
default:
- component: oh-button
config:
iconF7: =loop.roomChunk.icon
iconSize: 1.2em
active: '=vars["clean" + loop.roomChunk.roomId] ? true : false'
text: =loop.roomChunk.label
large: true
action: variable
actionVariable: ="clean" + loop.roomChunk.roomId
actionVariableValue: '=undefined === vars["clean" + loop.roomChunk.roomId] ? true : !vars["clean" + loop.roomChunk.roomId]'
style:
height: 3rem
line-height: 3rem
text-align: center
font-size: 1.1em
- component: f7-row
config: {}
slots:
default:
- component: f7-col
slots:
default:
- component: f7-card
slots:
default:
- component: f7-card-content
config:
style:
padding: 0
slots:
default:
- component: oh-button
config:
visible: =items[props.itemPrefix+"_State"].state !== "cleaning"
iconF7: map_pin_ellipse
iconSize: 1.2em
text: '=items[props.itemPrefix+"_State"].state === "cleaning" ? "Wird ausgeführt" : "Bereiche reinigen"'
large: true
action: command
actionItem: =props.itemPrefix+"_Command"
actionCommand: "='spotArea:' + ((vars.cleanA ? 'A';'') + (vars.cleanB ? 'B';'') + (vars.cleanC ? 'C';'') + (vars.cleanD ? 'D';'') + (vars.cleanD ? 'D';'') + (vars.cleanE ? 'E';'') + (vars.cleanF ? 'F';'') + (vars.cleanG ? 'G';'') + (vars.cleanH ? 'H';''))"
style:
height: 2.5em
line-height: 2.5em
text-align: center
font-size: 2em
My props for Room looks like this:
{"icon": "chat_bubble_2","roomId": "A","label": "Testraum1"},{"icon": "chat_bubble_2","roomId": "B","label": "Testraum2"},{"icon": "chat_bubble_2","roomId": "C","label": "Testraum3"},{"icon": "chat_bubble_2","roomId": "D","label": "Testraum4"},{"icon": "chat_bubble_2","roomId": "E","label": "Testraum5"},{"icon": "chat_bubble_2","roomId": "F","label": "Testraum6"},{"icon": "chat_bubble_2","roomId": "G","label": "Testraum7"},{"icon": "chat_bubble_2","roomId": "H","label": "Testraum8"}]
i think the problem is that this script use calculation for the room numbers and i use letters
Thanks for the help
Cheers