Oral-B progress card

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;

4 Likes

Question: what is the first set of yaml for? I’m kinda guessing Picture Elements card?

1 Like

You are correct sir

So am I reading this correctly that as soon as the brush reports a sector it becomes white?
Shouldn’t there be a delay at least?

I would love to try it but I’m currently just trying to understand it.

No after the sector is done it becomes white. Only the last sector is a bit tricky and doesnt seem to become white every time.

When I look at the sector sensor from the toothbrush it always list them as sector 1, then 2, 3, 4.
I don’t think I’m that consistent to brush my teeth in the same order all the time.

EDIT.

I just had a look at my neighbour and she too is very consistent in the order. Or this is not what we believe.

You have to create a pattern for yourself or else your life is a lie xD

1 Like