Sigh - this is what happens when you have too much fun with HA - washing machine

This isn’t really that big a deal, but I had a lot of fun with this, and it actually improved WAF on the HA project because of the duck (yes, there IS a duck)
It’s a simple SONOF POW R2 attached to the washer, with a few automations attached.
There are still some work left, and the animation isn’t perfect, but I can’t find a tool that can crop an animated GIF circular.
Btw. the clock is showing current time :slight_smile:

CLICK THE IMAGE to see the screencast of it :slight_smile:

The sensors:

  - platform: mqtt
    name: "Vaskemaskine Strøm"
    state_topic: 'tele/washer/SENSOR'
    value_template: '{{ value_json.ENERGY.Current }}'
    unit_of_measurement: "ampere"  
  - platform: mqtt
    name: "Vaskemaskine Forbrug"
    state_topic: 'tele/washer/SENSOR'
    value_template: '{{ value_json.ENERGY.Power }}'
    unit_of_measurement: "Watt"  
  - platform: mqtt
    name: "Vaskemaskine spændingsforskel"
    state_topic: 'tele/washer/SENSOR'
    value_template: '{{ value_json.ENERGY.Voltage }}'
    unit_of_measurement: "Volt"  
  - platform: mqtt
    name: "Vaskemaskine samlet forbrug i dag"
    state_topic: 'tele/washer/SENSOR'
    value_template: '{{ value_json.ENERGY.Today }}'
    unit_of_measurement: "kWh"
  - platform: mqtt
    name: "Vaskemaskine samlet forbrug i går"
    state_topic: 'tele/washer/SENSOR'
    value_template: '{{ value_json.ENERGY.Yesterday }}'
    unit_of_measurement: "kWh"

The automations:

- id: '156008'
  alias: Vaskemaskine is done
  trigger:
  - below: '5'
    entity_id: sensor.vaskemaskine_forbrug
    for: 00:01:00
    platform: numeric_state
  condition:
  - condition: state
    entity_id: switch.vaskemaskine
    state: 'on'
  action:
  - data:
      entity_id: ' media_player.faellesomrader'
      language: da
      message: Huhej hvor det går, ligepludselig er vaskemaskinen færdig
    service: tts.google_translate_say
- id: '156016'
  alias: Vaskemaskine - turn off
  trigger:
  - below: '5'
    entity_id: sensor.vaskemaskine_forbrug
    for: 00:10:00
    platform: numeric_state
  condition: []
  action:
  - data:
      entity_id: switch.vaskemaskine
    service: switch.turn_off

But the real fun is the illustration of it all:

washer-overview

Which is made with a picture element card:

cards:
  - elements:
      - entity: sensor.vaskemaskine_forbrug
        style:
          left: 38%
          top: 85%
        type: state-label
      - entity: sensor.vaskemaskine_spaendingsforskel
        style:
          left: 53%
          top: 85%
        type: state-label
      - entity: sensor.vaskemaskine_strom
        style:
          left: 69%
          top: 85%
        type: state-label
      - entity: switch.vaskemaskine
        state_image:
          'off': /local/wash-off.png
          'on': /local/wash-on.png
        style:
          left: 51%
          top: 18%
        tap_action:
          action: toggle
        type: image
      - entity: switch.vaskemaskine
        state_image:
          'on': /local/display2.png
          'off': /local/display.png
        style:
          width: 20%
          left: 68%
          top: 18%
        type: image
      - type: conditional
        conditions:
          - entity: switch.vaskemaskine
            state: 'off'
        elements:
          - type: state-label
            entity: sensor.time
            style:
              color: yellow
              left: 69%
              top: 16%
      - entity: switch.vaskemaskine
        state_image:
          'on': /local/washer-animated2.gif
        style:
          left: 52%
          top: 50%
          clip-path: circle(38% at center)
        tap_action:
          action: toggle
        type: image
    image: /local/siemens-washer.jpg
    type: picture-elements
  - columns: 1
    entities:
      - entity: sensor.vaskemaskine_samlet_forbrug_i_dag
      - entity: sensor.vaskemaskine_samlet_forbrug_i_gar
    show_icon: false
    show_state: true
    type: glance
type: vertical-stack
10 Likes

Having fun is a positive addition to all the things HA can offer. Good job on this.
Fun fact: You cant crop any image to be circular. You can only have transparent corners and make it “look” like circular.

1 Like

Yes, but there is no transparency on GIF :frowning:
And I gave up on doing a ‘conversion’, implanting the background to the background outside the drum, 366 frames, no way :slight_smile:

GIFs support transparency. I wouldnt bother if the frames were so many. Nice work anyway!

Ha, got it solved, instead of working with the animated gif, I just added this to the image entity style:
clip-path: circle(38% at center)
That solved it, looks much better :slight_smile:

1 Like

Excellent!!!
I will take it, I don’t even have to translate it!

1 Like

Du skal være velkommen :smiley:

Hi ,

Cool project and very good indeed visual wise.
Is there any where I can get the animated GIF file ?? Do you have a GIT location or can share the files …Also I assume that the SONOFF POW is loaded with custom software correct ??

Thanks,
MJ

1 Like

Sure.
I got it from here: https://tenor.com/view/washer-duck-rubber-ducky-gif-7354686
I don’t have a GIT set up, and it says it’s too big to upload here.
I’ve tried placing it on a ONE drive, I hope that works:
https://1drv.ms/u/s!AncbkEDUWhO6g24ZRwtLFZzp7pLL
The Sonoff is with tasmota, and using mqtt

Thank you so much for quick reply , I will try and let you know.
Hope you have some good ones , coming up. I will wait…
Thanks,
MJ

1 Like

It is a lot of fun indeed, I did something like it a few months ago

Really cool, I just need some door sensors for my washing machine/dryer doors so that I can automate it further.

Very nice, might use a bit of your code to tweak some of mine. Ty for sharing!

2 Likes

Youre welcome, what theme is that, looks nice!

It is a custom theme I made, but not finished yet. Will share it when it’s done around next week. My current code can be found here, but the theme is messy atm especially in the menu’s (the hamburger menu). https://github.com/jimz011/homeassistant

1 Like

How is power controlled using this setup?
I can’t imagine asking my wife to tell alexa to power on the wash machine or using a phone to power it on…well maybe but I think a requirement would be to still operate the machine via normal buttons.

Does the sonoff device allow the power button on the wash machine to still be used?

The Sonoff is placed next to it, the WAF is ok here, mostly because of powersavings and statistics on use.

Hi ,

I can see there are more than one jpg,gif or png is been used.
I believe the animated file is " /local/washer-animated2.gif"
But I can see there are more , please let me know how to get these files…
'/local/wash-off.png
‘/local/display2.png’
‘/local/siemens-washer.jpg’

I’ve placed them here:
https://1drv.ms/f/s!AncbkEDUWhO6g3PMA5IJrlb7UADK
Hope you get it working.

Thank you very much.

1 Like

Hi jim please can you sendme picture by qmail? or saved link?

You can get the photos from my repo if you want them

Click Here

Choose the beta branch or you wont see files.