I’ve create some yaml that uses the Oral-B integration and shows which sector you are done with (white teeth) and which sector needs to be done (blue teeth)
If this makes sense haha…
What you get is:
Here are the yaml and images:
image: /local/teeth/base.png
elements:
- type: state-label
entity: sensor.genius_xxxxx
style:
top: 50%
left: 50%
transform: translate(-50%, -50%)
font-size: 32px
color: white
- type: conditional
conditions:
- entity: binary_sensor.oralb_sector_lower_4
state: "on"
elements:
- type: image
entity: sensor.oralb_sector_number
image: /local/teeth/top_left.png
style:
top: 26%
left: 26%
width: 48%
- type: conditional
conditions:
- entity: binary_sensor.oralb_sector_lower_5
state: "on"
elements:
- type: image
entity: sensor.oralb_sector_number
image: /local/teeth/top_right.png
style:
top: 26%
left: 74%
width: 48%
- type: conditional
conditions:
- entity: binary_sensor.oralb_sector_lower_2
state: "on"
elements:
- type: image
entity: sensor.oralb_sector_number
image: /local/teeth/bottom_left.png
style:
top: 77.4%
left: 25.1%
width: 50%
- type: conditional
conditions:
- entity: binary_sensor.oralb_sector_lower_3
state: "on"
elements:
- type: image
entity: sensor.oralb_sector_number
image: /local/teeth/bottom_right.png
style:
top: 77.4%
left: 75%
width: 50%
Add this to your binary sensors:
sensors:
oralb_sector_lower_1:
value_template: >
{% set s = states('sensor.oralb_sector_number') | int %}
{{ s < 1 and s > 0 }}
oralb_sector_lower_2:
value_template: >
{% set s = states('sensor.oralb_sector_number') | int %}
{{ s < 2 and s > 0 }}
oralb_sector_lower_3:
value_template: >
{% set s = states('sensor.oralb_sector_number') | int %}
{{ s < 3 and s > 0 }}
oralb_sector_lower_4:
value_template: >
{% set s = states('sensor.oralb_sector_number') | int %}
{{ s < 4 and s > 0 }}
oralb_sector_lower_5:
value_template: >
{% set s = states('sensor.oralb_sector_number') | int %}
{{ s < 5 and s > 0 }}
Add this to your sensors:
platform: template
sensors:
oralb_sector_number:
value_template: >
{% set sector = states('sensor.genius_x_1c91_sector') %}
{% if sector.startswith('sector ') %}
{{ sector.replace('sector ', '') | int }}
{% else %}
0
{% endif %}
And the images;