Car Wash Binary Sensor

Ottima scelta!!
:grinning:

1 Like

I’ve done it yesterday. But for now only in beta-version in develop branch of repository.
You can test new version of script just now, download it from here

For now sensor checks the weather for every day (today and some days forward) for:

  • Temperature transition through zero in Celsius (the moment when snow melts on the roads)
  • Precipitation. All analysis methods available in the weather provider are used: by weather conditions and by precipitation intensity

Also in the last edit I added checks for precipitation in the current weather.

Great … .thanks for the update. I’ll give it a shot today.

Awesome! Works for me! But i only see “On” and not like it’s oke to wash the car.
Also my icon is yellow. Maybe it’s better to change the color of the icon to green if it’s oke to wash your car and to red if it’s not oke.

Same here only on and off

Then by putting the it into a automation

turn the pouch light Blue when its on.

or

- id: 'Tell me when I can Clear the Car'
  alias: Tell me when I can Clear the Car
  trigger:
  - entity_id: binary_sensor.car_wash
    platform: state
    from: off
    to:on
  action:
  - data_template:
      title: "Home Assistant"
      message: "You Should Plan to clean the car."
    service: notify.stephan_phone

un test wrote off top of head

1 Like

Looks great!

I was thinking of doing something similar to let me know if it was ok to put the clothes washing out on the line - would this sensor work for that?

1 Like

Good point thats thinking outside the box

Unfortunately, the binary sensor can show only two states - “on” and “off”.
In the case of this sensor, “on” should be interpreted as “it is worth washing the car”, and “off” - as “you should not wash the car”.

The sensor does not change the visual display, because with different settings it may be different. For example, in HA I have this sensor through a picture entity card changing the interface pictures that visually show the situation.

image
My HA configs for this: HomeAssistantConfiguration/lovelace/00_home_view.yaml at master · Limych/HomeAssistantConfiguration · GitHub

If you want to change the color of the sensor icon, simply add this setting to the configuration:

# Example configuration.yaml entry
homeassistant:
  customize:
    binary_sensor.car_wash:
      templates:
        hs_color: "if (state === 'on') return [100,65]; else return [0, 85];"
2 Likes

ATTENTION!
A serious error was detected in the logic of the sensor operation. I published version 1.2.0, which fixes it.
If you do not have custom_updater configured, please update the component manually.

This sensor monitors the weather conditions under which the car on the road will quickly become dirty. I think for your task, some of them will be a bit redundant. For example, the event of passage of temperature through the melting point of ice/snow.

1 Like

Not working with the latest release … 0.92.0

Thank you.

An update has been released taking into account the new rules for the integration of components in Home Assistant versions 0.92+.

Unfortunately, updating through the custom-updater may not work. In this case, you need to update the component manually. In the future, automatic update will work again correctly.

1 Like

Need your help please!
CAR WASH install with HACS.

configuration.yaml

weather:
  - platform: openweathermap
    api_key: xxxxxxxxxxxxxxxxxxxxxxxxxxx my api xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    mode: daily

binary_sensor:

- platform: car_wash
  weather: weather.openweathermap
  name: Auto waschen
  days: 2

error message:

Log Details (ERROR)
Fri Sep 27 2019 00:03:18 GMT+0200 (Mitteleuropäische Sommerzeit)
Update for binary_sensor.auto_waschen fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 261, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 439, in async_device_update
    await self.async_update()
  File "/config/custom_components/car_wash/binary_sensor.py", line 151, in async_update
    fc_date = fc.get(ATTR_FORECAST_TIME)[:10]
TypeError: 'int' object is not subscriptable

regards
johann

@Limych do you have an idea why it can be?

Fixed.

1 Like

Hello.
Great plugin, I’ve been using it for a while.
I actually hadn’t noticed there was a ‘name’ variable and came here to ask for that.
Could you perhaps add an ‘icon’ variable as well? I’m using it to check if the weather allows for doing the laundry and it would be nice to have a proper icon.

I think it’s not entirely correct to add an icon field. From my point of view, it will not add anything new useful for the main purpose of this sensor.

Nevertheless, you can always force the icon to be changed through the Home Assistant configs. Like this, as example:

# Example configuration.yaml entry
homeassistant:
  customize:
    binary_sensor.car_wash:
      templates:
        icon: >-
          if (state == 'on') return 'mdi:weather-sunny';
          return 'mdi:weather-pouring';

Source: https://github.com/Limych/HomeAssistantConfiguration/blob/11b6c35109489a91549db04203bc3be17b5289d5/packages/car.yaml

2 Likes

Forgive my likely terrible formatting, as I’m on my phone. anyhow I wanted to do something similar but just as simply as possible so I created to quick sensors leveraging dark sky…

car_wash_test:
      value_template: >
        {% set D0 = states('sensor.darksky_weather_precip_probability') | int %}
        {% set D1 = states('sensor.darksky_weather_precip_probability_1d') | int %}
        {% set D2 = states('sensor.darksky_weather_precip_probability_2d') | int %}
        {% set D3 = states('sensor.darksky_weather_precip_probability_3d') | int %}
        {% set D4 = states('sensor.darksky_weather_precip_probability_4d') | int %}
        {% set D5 = states('sensor.darksky_weather_precip_probability_5d') | int %}

        {% if D0 > 50 %} off
        {% elif D1 > 50 %} off
        {% elif D2 > 60 %} off
        {% elif D3 > 70 %} off
        {% elif D4 > 73 %} off
        {% elif D5 > 76 %} off
        {% elif 'rain' in states('sensor.darksky_weather_icon') %} off
        {% elif states('sensor.darksky_weather_humidity') | int > 89 or states('sensor.front_porch_sensor_relative_humidity_measurement') | int > 89 %} off
        {% elif (D1+D2+D3+D4+D5) > 100 %} off
        {% else %} on
        {% endif %}

    car_wash:
      value_template: >-
        {% if is_state('sensor.car_wash_test','on') %}
          Yes
        {% else %}
          No
        {% endif %}
      entity_picture_template: >-
        {% if is_state('sensor.car_wash_test', 'on') %}
          /local/custom_icons/car-wash-yellow-FDD835.png
        {% else %}
          /local/custom_icons/car-wash-blue-44739E.png
        {% endif %}
      attribute_templates:
        D0: "{{states('sensor.darksky_weather_precip_probability')}}"
        D1: "{{states('sensor.darksky_weather_precip_probability_1d')}}"
        D2: "{{states('sensor.darksky_weather_precip_probability_2d')}}"
        D3: "{{states('sensor.darksky_weather_precip_probability_3d')}}"
        D4: "{{states('sensor.darksky_weather_precip_probability_4d')}}"
        D5: "{{states('sensor.darksky_weather_precip_probability_5d')}}"

This is by no means perfect but seems to work fairly well for me.

This sounds pretty useful. I prefer to clean my car on my own and that’s why I rely on forecasts. By the way, recently I decided to read more information here about the best clay bar which is pretty useful if you want to scrub your car thoroughly. What are your thoughts on it?