Car Wash Binary Sensor

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?

hay bro could post your png files

I just went to https://materialdesignicons.com/, found the one I wanted, then clicked on it, then advanced export - size 20, padding 10 and then pick whatever foreground color you want and then hit ICON button in bottom right corner.

I got this error:

The openweathermap platform for the weather integration does not support platform setup. Please remove it from your config.

weather:
  - platform: openweathermap
    api_key: !secret openweatherapi
    mode: daily

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

And have you removed the part from your configuration as suggested?

which recommendation do you mean? ( Process forecast time as timestamp (#1)?)
`

The OpenWeatherMap integration can only be configured via the UI.

So that part can be removed from the yaml:

weather:
  - platform: openweathermap
    api_key: !secret openweatherapi
    mode: daily
1 Like