bhyve-home-assistant icon indicating copy to clipboard operation
bhyve-home-assistant copied to clipboard

Python Script Error bhyve_next_watering

Open holger-tangermann opened this issue 2 years ago • 2 comments

Describe the bug when calling the script in HA via developer tools page with << service: python_script.bhyve_next_watering data: {entity_id: switch.beet_zone, switch.rasen_seite_zone, switch.tropfbewasserung_zone, switch.rasenflache_zone}

I get an error (see log below)

Expected behaviour creates or updates entities named sensor.{zone_name}_next_watering and sensor.{device_name}_rain_delay_finishing.

BHyve devices Bhyve Indoor 4 zones

Logs

Logger: homeassistant.components.python_script.bhyve_next_watering.py Source: core.py:1041 Integration: Python Scripts (documentation, issues) First occurred: 18:00:42 (3 occurrences) Last logged: 18:08:47

Error executing script: Invalid entity id encountered: sensor.garten_bewässerung_rain_delay_finishing. Format should be .<object_id> Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/python_script/init.py", line 224, in execute exec(compiled.code, restricted_globals) File "bhyve_next_watering.py", line 55, in File "/usr/src/homeassistant/homeassistant/core.py", line 1290, in set run_callback_threadsafe( File "/usr/local/lib/python3.9/concurrent/futures/_base.py", line 445, in result return self.__get_result() File "/usr/local/lib/python3.9/concurrent/futures/_base.py", line 390, in __get_result raise self.exception File "/usr/src/homeassistant/homeassistant/util/async.py", line 64, in run_callback future.set_result(callback(*args)) File "/usr/src/homeassistant/homeassistant/core.py", line 1361, in async_set state = State( File "/usr/src/homeassistant/homeassistant/core.py", line 1041, in init raise InvalidEntityFormatError( homeassistant.exceptions.InvalidEntityFormatError: Invalid entity id encountered: sensor.garten_bewässerung_rain_delay_finishing. Format should be .<object_id>

holger-tangermann avatar Apr 10 '22 16:04 holger-tangermann

I suspect the issue is the ä character being invalid for HA entities. I don't have plans to fix this anytime soon due to time, perhaps you could submit a small change via a PR?

sebr avatar May 02 '22 11:05 sebr

I removed the character. The script runs now. However, the sensor values calculated by the script, do not match to the values calculated within the b-hyve app and do not fit to the runtime of the programs for the zones. Any hint what I can do?

holger-tangermann avatar Jul 10 '22 11:07 holger-tangermann