Show off your picture-elements uses

Sure…
I use both the Home connect integration and a rest sensor to the Home connect API to get all the data I want.

sensor:
  - platform: rest
    name: washing_machine_json
    resource_template: "https://api.home-connect.com/api/homeappliances/<<<<My_Washing_Machine_ID>>>>>/programs/active"
    method: GET
    headers:
      authorization: 'Bearer <<<<<my_auth_code_here>>>>>'
      content-type: 'application/json'
    value_template: '1' 
    json_attributes:
      - "data"
    scan_interval: 180
                
  - platform: template
    sensors:
      washing_machine_finish_time:
        friendly_name: "sensor.washing_machine_finish_time"
        value_template: "{{ as_timestamp(states('sensor.washing_machine_remaining_program_time')) | timestamp_custom('%H:%M') }}"
  
  # Below templates loop to find the key it needs. It may seem cumbersome but
  # the array is indexed and it can shift, I mean it has happened...
  - platform: template
    sensors:
      washing_machine_spin_rpm:
        friendly_name: "sensor.washing_machine_spin_rpm"
        value_template: >-
                        {% if state_attr('sensor.washing_machine_json', 'data') != None %}
                        {% for value in state_attr('sensor.washing_machine_json', 'data').options -%}
                        {% if value.key == "LaundryCare.Washer.Option.SpinSpeed" %}
                        {{ value.value.split(".")[-1:][0].replace("RPM", "") }}
                        {%- endif %}
                        {%- endfor %}
                        {%- endif %}
        
  - platform: template
    sensors:
      washing_machine_temperature:
        friendly_name: "sensor.washing_machine_temperature"
        value_template: >-
                        {% if state_attr('sensor.washing_machine_json', 'data') != None %}
                        {% for value in state_attr('sensor.washing_machine_json', 'data').options -%}
                        {% if value.key == "LaundryCare.Washer.Option.Temperature" %}
                        {{ value.value.split(".")[-1:][0].replace("GC", "") }}°c
                        {%- endif %}
                        {%- endfor %}
                        {%- endif %}

  - platform: template
    sensors:
      washing_machine_prewash:
        friendly_name: "sensor.washing_machine_prewash"
        value_template: >-
                        {% if state_attr('sensor.washing_machine_json', 'data') != None %}
                        {% for value in state_attr('sensor.washing_machine_json', 'data').options -%}
                        {% if value.key == "LaundryCare.Washer.Option.Prewash" %}
                        {{ value.value }}
                        {%- endif %}
                        {%- endfor %}
                        {%- endif %}
                        
  - platform: template
    sensors:
      washing_machine_rinse:
        friendly_name: "sensor.washing_machine_rinse"
        value_template: >-
                        {% if state_attr('sensor.washing_machine_json', 'data') != None %}
                        {% for value in state_attr('sensor.washing_machine_json', 'data').options -%}
                        {% if value.key == "LaundryCare.Washer.Option.RinsePlus" %}
                        {{ value.value.split(".")[-1:][0]}}
                        {%- endif %}
                        {%- endfor %}
                        {%- endif %}
                                              
  - platform: template
    sensors:
      washing_machine_processphase:
        friendly_name: "sensor.washing_machine_ProcessPhase"
        value_template: >-                        
                        {% if state_attr('sensor.washing_machine_json', 'data') != None %}
                        {% for value in state_attr('sensor.washing_machine_json', 'data').options -%}
                        {% if value.key == "LaundryCare.Common.Option.ProcessPhase" %}
                        {{ value.value.split(".")[-1:][0] }}
                        {%- endif %}
                        {%- endfor %}
                        {%- endif %}

  - platform: template
    sensors:
      washing_machine_idos1:
        friendly_name: "sensor.washing_machine_IDos1"
        value_template: >-                        
                        {% if state_attr('sensor.washing_machine_json', 'data') != None %}
                        {% for value in state_attr('sensor.washing_machine_json', 'data').options -%}
                        {% if value.key == "LaundryCare.Washer.Option.IDos1.Active" %}
                        {{ value.value }}
                        {%- endif %}
                        {%- endfor %}
                        {%- endif %}


  - platform: template
    sensors:
      washing_machine_idos2:
        friendly_name: "sensor.washing_machine_idos2"
        value_template: >-                        
                        {% if state_attr('sensor.washing_machine_json', 'data') != None %}
                        {% for value in state_attr('sensor.washing_machine_json', 'data').options -%}
                        {% if value.key == "LaundryCare.Washer.Option.IDos2.Active" %}
                        {{ value.value }}
                        {%- endif %}
                        {%- endfor %}
                        {%- endif %}

That is all the sensors.

The card yaml:

elements:
  - entity: sensor.washing_machine_operation_state
    image: /local/washing_machine.gif
    state_image:
      Run: /local/washing_machine.gif
      Ready: /local/washing_machine_ready.gif
      Finished: /local/washing_machine_finished.gif
    style:
      left: 0%
      top: 0%
      transform: scale(1,1)
    tap_action:
      action: none
    type: image
  - conditions:
      - entity: sensor.washing_machine_operation_state
        state: Run
    elements:
      - entity: sensor.washing_machine_finish_time
        style:
          left: 79%
          top: 3%
          color: black
          transform: scale(2.5,2.5)
        tap_action:
          action: more-info
        type: state-label
      - entity: sensor.washing_machine_prewash
        image: /local/washing_machine_prewash_off.png
        state_image:
          'false': /local/washing_machine_prewash_off.png
          'true': /washing_machine_prewash.png
        style:
          left: '-18%'
          top: '-19%'
          transform: scale(0.23,0.27)
        tap_action:
          action: none
        type: image
      - entity: sensor.washing_machine_rinse
        image: /local/washing_machine_rinse_offt.png
        state_image:
          'Off': /local/washing_machine_rinse_offt.png
          Plus1: /local/washing_machine_rinse_1t.png
          Plus2: /local/washing_machine_rinse_2t.png
          Plus3: /local/washing_machine_rinse_3t.png
        style:
          left: 5%
          top: 17%
          transform: scale(1,1)
        tap_action:
          action: none
        type: image
      - entity: sensor.washing_machine_spin_rpm
        style:
          left: 5%
          top: 34%
          color: black
          transform: scale(2,2)
        tap_action:
          action: none
        type: state-label
      - entity: sensor.washing_machine_temperature
        style:
          left: 6%
          top: 47%
          color: black
          transform: scale(2,2)
        tap_action:
          action: none
        type: state-label
      - entity: sensor.washing_machine_idos1
        image: /local/i-dos_o.png
        state_image:
          'False': /local/i-dos_off.png
          'True': /local/i-dos_on.png
        style:
          left: '-1.8%'
          top: 60%
          transform: scale(0.9,0.9)
        tap_action:
          action: none
        type: image
      - entity: sensor.washing_machine_idos2
        image: /local/i-dos_on.png
        state_image:
          'False': /local/i-dos_off.png
          'True': /local/i-dos_on.png
        style:
          left: '-1.8%'
          top: 75%
          transform: scale(0.9,0.9)
        tap_action:
          action: none
        type: image
      - entity: sensor.washing_machine_processphase
        style:
          left: 40%
          top: 69%
          color: black
          transform: scale(2,2)
        tap_action:
          action: none
        type: state-label
    type: conditional
image: /local/washing_machine_ready.gif
panel: true
type: picture-elements

One thing that I might change is the pre wash icon and rinse icons.
Instead of black I will probably make them red for off and green for on, and use the pre wash on as the off icon also but red.

Images I used
http://www.hoppvader.nu/bilder/washing_machine.zip

If you need help with the Home connect API then just say so and I can guide you on how to get the Auth code.

(I don’t take any credit for the animated gif. That was found)

10 Likes