limych / ha-car_wash Goto Github PK
View Code? Open in Web Editor NEWCar Wash Binary Sensor for Home Assistant
License: Other
Car Wash Binary Sensor for Home Assistant
License: Other
Version of the custom_component aa197bc
Configuration
Add your configs here.
binary_sensor:
- platform: car_wash
weather: weather.dark_sky
Describe the bug
A clear and concise description of what the bug is.
I get this issue in the logs. It seems that since HA core version 0.11x introduced some breaking changes and this component is affected:
BinarySensorDevice is deprecated, modify CarWashBinarySensor to extend BinarySensorEntity.
To Reproduce
If applicable, describe the steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Debug log
Add your logs here.
Additional context
Add any other context about the problem here.
Is your feature request related to a problem? Please describe.
The icon of the binary sensor is the same for every state.
If you have a budge in Lovelace you can't clearly recognize if it is on or off.
Describe the solution you'd like
Change the icon based on state. i.e. use: mdi:car-off if the sensor is off
Describe alternatives you've considered
Additional context
Configuration
Describe the bug
Problem is darksky reports precipitation as null instead of 0. This means the car wash sensor is alway closed/off.
Expected behavior
When it is "null", it should be act as it is 0 and then open/on the sensor
Additional context
I know darksky is going to be dismissed, but meanwhile it is still working I would like to use it and, maybe, other weather forecast api report "null" as darksky so it worth to fix it.
Environment
Describe the bug
This appears in the logs on every boot of HA:
Detected integration that uses temperature utility. This is deprecated since 2022.10 and will stop working in Home Assistant 2023.4, it should be updated to use unit_conversion.TemperatureConverter instead. Please report issue to the custom integration author for car_wash using this method at custom_components/car_wash/binary_sensor.py, line 143: temperature = convert_temperature(
Configuration.yaml
binary_sensor:
- platform: car_wash
weather: weather.home
Steps to Reproduce
Expected behavior
The log doesn't appear
Debug log
Add your logs here.
Additional context
Is your feature request related to a problem? Please describe.
Describe the solution you'd like
German Translation
binary_sensor.de.json
Describe alternatives you've considered
{
"state": {
"car_wash__": {
"off": "nicht empfehlenswert",
"on": "guter Zeitpunkt"
}
}
}
Additional context
Version of the custom_component
37d4419
Configuration
binary_sensor:
- platform: car_wash
weather: weather.budapest
Description
Seems that script is not working. Take a look on below stack, is there anything I should change?
Latest version of Home Assistant 0.104.3
Debug log
Wed Jan 29 2020 20:40:03 GMT+0100
Update for binary_sensor.car_wash fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 459, in async_device_update
await self.async_update()
File "/config/custom_components/car_wash/binary_sensor.py", line 165, in async_update
fc_date = fc_date[:10]
TypeError: 'datetime.datetime' object is not subscriptable
version | core-2024.4.3 |
---|---|
installation_type | Home Assistant OS |
dev | false |
hassio | true |
docker | true |
user | root |
virtualenv | false |
python_version | 3.12.2 |
os_name | Linux |
os_version | 6.6.25-haos |
arch | x86_64 |
timezone | America/Edmonton |
config_dir | /config |
GitHub API | ok |
---|---|
GitHub Content | ok |
GitHub Web | ok |
GitHub API Calls Remaining | 4578 |
Installed Version | 1.34.0 |
Stage | running |
Available Repositories | 1392 |
Downloaded Repositories | 36 |
logged_in | true |
---|---|
subscription_expiration | January 14, 2025 at 5:00 PM |
relayer_connected | true |
relayer_region | us-east-1 |
remote_enabled | true |
remote_connected | true |
alexa_enabled | true |
google_enabled | false |
remote_server | us-east-1-10.ui.nabu.casa |
certificate_status | ready |
instance_id | fe8583e8d7e546929c040cdec7876469 |
can_reach_cert_server | ok |
can_reach_cloud_auth | ok |
can_reach_cloud | ok |
host_os | Home Assistant OS 12.2 |
---|---|
update_channel | stable |
supervisor_version | supervisor-2024.05.1 |
agent_version | 1.6.0 |
docker_version | 25.0.5 |
disk_total | 46.5 GB |
disk_used | 21.7 GB |
healthy | true |
supported | true |
board | ova |
supervisor_api | ok |
version_api | ok |
installed_addons | Samba share (12.3.1), File editor (5.8.0), Samba Backup (5.2.0), AppDaemon (0.16.5), Mosquitto broker (6.4.0), Glances (0.21.1), Advanced SSH & Web Terminal (17.3.0), Portainer (2023.12.0), Logspout addon (1.6.2), openWakeWord (1.10.0), Piper (1.5.0), Whisper (2.0.0), NGINX Home Assistant SSL proxy (3.9.0) |
dashboards | 4 |
---|---|
resources | 24 |
views | 28 |
mode | storage |
oldest_recorder_run | May 16, 2024 at 3:10 AM |
---|---|
current_recorder_run | May 19, 2024 at 7:41 PM |
estimated_db_size | 484.05 MiB |
database_engine | sqlite |
database_version | 3.44.2 |
A previously working integration of car_wash now is failing consistently with a system error of:
"Platform error 'binary_sensor' from integration 'car_wash' - cannot import name 'EventStateChangedData' from 'homeassistant.core'"
I have deleted the integration and re-downloaded and re-installed (same version v1.5.7) with the same results. I cannot pinpoint the exact time this started to fail, but likely after an HA update (just a guess). No hardware or other software changes have been made.
This appears to come from line 127 in binary_sensor.py.
1.Simply press "Check Configuration" in Developer Tools to see above error message.
2.
3.
...
Logger: homeassistant.config
Source: config.py:1437
First occurred: 9:28:52 AM (1 occurrences)
Last logged: 9:28:52 AM
Platform error: binary_sensor - cannot import name 'EventStateChangedData' from 'homeassistant.core' (/usr/src/homeassistant/homeassistant/core.py)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config.py", line 1437, in _async_load_and_validate_platform_integration
platform = await p_integration.integration.async_get_platform(domain)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 1070, in async_get_platform
platforms = await self.async_get_platforms((platform_name,))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 1145, in async_get_platforms
import_future.result()
File "/usr/src/homeassistant/homeassistant/loader.py", line 1133, in async_get_platforms
platforms.update(self._load_platforms(platform_names))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 1060, in _load_platforms
platform_name: self._load_platform(platform_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 1232, in _load_platform
cache[full_name] = self._import_platform(platform_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 1264, in _import_platform
return importlib.import_module(f"{self.pkg_path}.{platform_name}")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/importlib/__init__.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 995, in exec_module
File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
File "/config/custom_components/car_wash/binary_sensor.py", line 37, in <module>
from homeassistant.core import Event, EventStateChangedData, HomeAssistant, callback
ImportError: cannot import name 'EventStateChangedData' from 'homeassistant.core' (/usr/src/homeassistant/homeassistant/core.py)
could not locate this file.
After restart after upgrade from 0.109.6 to 0.110.2:
Logger: homeassistant.components.binary_sensor
Source: components/binary_sensor/__init__.py:174
Integration: Binaire sensor (documentation, issues)
First occurred: 19:13:00 (1 occurrences)
Last logged: 19:13:00
BinarySensorDevice is deprecated, modify CarWashBinarySensor to extend BinarySensorEntity
Environment
Describe the bug
Sensor if just "off" ? No errors in log, nothing seems wrong!
Configuration.yaml
binary_sensor:
- platform: car_wash
weather: weather.openweathermap
unique_id: car_wash_sensor
days: 2
Steps to Reproduce
Expected behavior
Debug log
Add your logs here.
Additional context
Is your feature request related to a problem? Please describe.
I would like my car wash sensor to update hourly.
Describe the solution you'd like
I would like to be able to in my configuration.yaml setup how often the sensor updates. Similar to how if you set up a binary ping sensor you can define a 'scan_interval'
Describe alternatives you've considered
I have not found any alternative to this addon and have had a look at the code but do not understand enough to modify it for my needs.
From https://community.home-assistant.io/t/car-wash-binary-sensor/110046/28 by Johann_Edelmuller
weather:
- platform: openweathermap
api_key: xxxxxxxxxxxxxxxxxxxxxxxxxxx my api xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
mode: daily
binary_sensor:
- platform: car_wash
weather: weather.openweathermap
name: Auto waschen
days: 2
A clear and concise description of what the bug is.
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
Is your feature request related to a problem? Please describe.
After HA update to version 0.105 icons are by default in only one color and don't react to sensor state. I liked when icon changed it's color, so could you consider bringing icon color feature when the state is on?
Describe the solution you'd like
Maybe we can set up in settings which color we want when we should wash the car? Or at least please bring back yellow color
Describe alternatives you've considered
I have tried overriding state_color attribute to "true" in customization, but no effect. Maybe you know simple solution?
Additional context
Environment
Describe the bug
After updating HA to 2023.4 the integration does not load anymore.
Steps to Reproduce
Update to HA core April beta release.
Expected behavior
Integration still works.
Debug log
Logger: homeassistant.config
Source: config.py:1437
First occurred: 20:50:40 (1 occurrences)
Last logged: 20:50:40
Platform error: binary_sensor - cannot import name 'ATTR_FORECAST' from 'homeassistant.components.weather' (/usr/src/homeassistant/homeassistant/components/weather/__init__.py)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config.py", line 1437, in _async_load_and_validate_platform_integration
platform = await p_integration.integration.async_get_platform(domain)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 1072, in async_get_platform
platforms = await self.async_get_platforms((platform_name,))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 1147, in async_get_platforms
import_future.result()
File "/usr/src/homeassistant/homeassistant/loader.py", line 1135, in async_get_platforms
platforms.update(self._load_platforms(platform_names))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 1062, in _load_platforms
platform_name: self._load_platform(platform_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 1235, in _load_platform
cache[full_name] = self._import_platform(platform_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 1265, in _import_platform
return importlib.import_module(f"{self.pkg_path}.{platform_name}")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/importlib/__init__.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 995, in exec_module
File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
File "/config/custom_components/car_wash/binary_sensor.py", line 18, in <module>
from homeassistant.components.weather import (
ImportError: cannot import name 'ATTR_FORECAST' from 'homeassistant.components.weather' (/usr/src/homeassistant/homeassistant/components/weather/__init__.py)
2020-09-29 21:39:12 INFO (MainThread) [custom_components.average.sensor] Version dev
2020-09-29 21:39:12 INFO (MainThread) [custom_components.average.sensor] If you have ANY issues with this, please report them here: https://github.com/Limych/ha-average/issues
i have on rpi
Operating system HassOS 4.13
Home Assistant 0.114.4
carwash 1.2.16
version | core-2024.5.2 |
---|---|
installation_type | Home Assistant OS |
dev | false |
hassio | true |
docker | true |
user | root |
virtualenv | false |
python_version | 3.12.2 |
os_name | Linux |
os_version | 6.6.28-haos-raspi |
arch | aarch64 |
timezone | Europe/Brussels |
config_dir | /config |
GitHub API | ok |
---|---|
GitHub Content | ok |
GitHub Web | ok |
GitHub API Calls Remaining | 4998 |
Installed Version | 1.34.0 |
Stage | running |
Available Repositories | 1406 |
Downloaded Repositories | 77 |
HACS Data | ok |
logged_in | true |
---|---|
subscription_expiration | April 26, 2025 at 02:00 |
relayer_connected | true |
relayer_region | eu-central-1 |
remote_enabled | true |
remote_connected | true |
alexa_enabled | false |
google_enabled | true |
remote_server | eu-central-1-7.ui.nabu.casa |
certificate_status | ready |
instance_id | 98df8b6855fd40a682abea6ec3befbad |
can_reach_cert_server | ok |
can_reach_cloud_auth | ok |
can_reach_cloud | ok |
host_os | Home Assistant OS 12.3 |
---|---|
update_channel | beta |
supervisor_version | supervisor-2024.05.1 |
agent_version | 1.6.0 |
docker_version | 25.0.5 |
disk_total | 458.4 GB |
disk_used | 25.6 GB |
healthy | true |
supported | true |
board | yellow |
supervisor_api | ok |
version_api | ok |
installed_addons | Spotify Connect (0.13.0), Advanced SSH & Web Terminal (17.2.0), File editor (5.8.0), Studio Code Server (5.15.0), Zigbee2MQTT (1.37.0-1), Home Assistant Google Drive Backup (0.112.1), The Lounge (0.19.1), Glances (0.21.1), Uptime Kuma (0.12.1), ESPHome (2024.4.2), Mosquitto broker (6.4.0), Firefox (1.2.0), Silicon Labs Flasher (0.2.3), AirCast (4.2.1), Music Assistant BETA (2.0.0rc1), eBUSd (23.2.5) |
dashboards | 4 |
---|---|
resources | 42 |
views | 15 |
mode | storage |
oldest_recorder_run | April 29, 2024 at 13:03 |
---|---|
current_recorder_run | May 9, 2024 at 19:35 |
estimated_db_size | 722.18 MiB |
database_engine | sqlite |
database_version | 3.44.2 |
api_endpoint_reachable | ok |
---|
async_track_state_change
is deprecated, details here: https://developers.home-assistant.io/blog/2024/04/13/deprecate_async_track_state_change
Install release 1.5.6 and check the error log.
Logger: homeassistant.helpers.frame
Source: helpers/frame.py:190
First occurred: 19:35:17 (7 occurrences)
Last logged: 19:35:52
Detected that custom integration 'car_wash' calls `async_track_state_change` instead of `async_track_state_change_event` which is deprecated and will be removed in Home Assistant 2025.5 at custom_components/car_wash/binary_sensor.py, line 135: async_track_state_change(, please create a bug report at https://github.com/Limych/ha-car_wash/issues
No response
The method for providing platform translations has changed in Home Assistant Core, and this integration needs to be updated.
Details can be found in https://developers.home-assistant.io/blog/2024/03/05/platform_entity_translations_deprecation
version 78b7f0d
Configuration
- platform: car_wash
weather: weather.dark_sky
Describe the bug
After last update i get errors in logs.
Debug log
2020-01-01 18:40:51 ERROR (MainThread) [homeassistant.helpers.entity] Update for binary_sensor.car_wash fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 281, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 459, in async_device_update
await self.async_update()
File "/config/custom_components/car_wash/binary_sensor.py", line 162, in async_update
if isinstance(fc_date) == int:
TypeError: isinstance expected 2 arguments, got 1
Environment
Describe the bug
HA has since 2023.9 changed the way how weather forecasts works.
See: https://www.home-assistant.io/blog/2023/09/06/release-20239/#weather-forecast-service
and: https://developers.home-assistant.io/blog/2023/08/07/weather_entity_forecast_types/
and: https://developers.home-assistant.io/docs/core/entity/weather#weather-forecasts
Configuration.yaml
binary_sensor:
- platform: car_wash
name: Auto wassen
weather: weather.knmi_purmerend
Steps to Reproduce
I'm using the weather integration that I developed, https://github.com/golles/ha-knmi
Expected behavior
To use the new forecast format, but I understand you need to implement that first
Debug log
2023-09-07 18:36:19.185 ERROR (MainThread) [homeassistant.helpers.entity] Update for binary_sensor.auto_wassen fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 683, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 936, in async_device_update
await self.async_update()
File "/config/custom_components/car_wash/binary_sensor.py", line 164, in async_update
raise HomeAssistantError(
homeassistant.exceptions.HomeAssistantError: Can't get forecast data! Are you sure it's the weather provider?
Additional context
I didn't provide the debug log, just the error. But I guess this is sufficient enough, as the problem is pretty clear due to the new HA feature. If you need more info from me, let me know.
Is your feature request related to a problem? Please describe.
Is not a problem i suggest a spanish translation
Describe the solution you'd like
{
"state": {
"car_wash__": {
"off": "No deberías Lavarlo",
"on": "Merece la pena Lavarlo"
}
}
}
Describe alternatives you've considered
Additional context
Environment
Home Assistant 2023.4.5
Supervisor 2023.04.0
Operating System 10.0
Frontend 20230411.1 - latest
Describe the bug
Configuration.yaml
**Steps to Reproduce**
<!--
Install the integration, configure the yaml, use the forecast sensor from the [Met.no weather integration](https://www.home-assistant.io/integrations/met)
-->
**Expected behavior**
<!--
I would have expected that the car wash sensor triggers "on" for the day you want to get a car wash? But maybe it's some day in the future? I don't know.
-->
**Debug log**
<!--
To enable debug logs check "Troubleshooting" section of README of this component
or this https://www.home-assistant.io/components/logger/
-->
**Additional context**
<!--
<img width="575" alt="image" src="https://user-images.githubusercontent.com/45641587/233389876-2208e8c6-f29c-4c7e-b3fa-c03ca13f6217.png">
-->
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.