cgarwood / homeassistant-fullykiosk

Fully Kiosk Browser integration for Home Assistant
Apache License 2.0
153 stars 27 forks source link

Error thrown when trying to turn on/off the screensaver (or other switches in the integration) #104

Closed fribse closed 2 years ago

fribse commented 2 years ago

I have two Fully Kiosk's running here. One is the browser version, the other is the single app version. The error is thrown for both versions.

HA is 'core' 2022.05.05 Integration is 1.02

The integration shows quite a few switches and buttons. In the later versions of Home Assistant all the switches are starting to show errors like the one below I'm not sure if this change has anything to do with it? https://developers.home-assistant.io/blog/2022/04/20/saying-goodbye-to-event_time_changed/

Error shown in log:

Logger: homeassistant.helpers.script.websocket_api_script
Source: custom_components/fullykiosk/sensor.py:115
Integration: Fully Kiosk Browser (documentation, issues)
First occurred: 15.05.06 (1 occurrences)
Last logged: 15.05.06

websocket_api script: Error executing script. Unexpected error for call_service at pos 1: Unknown string format: 13/05/2022 11.42.24 PM
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 447, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 680, in _async_call_service_step
    await service_task
  File "/usr/src/homeassistant/homeassistant/core.py", line 1627, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1664, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in handle_service
    await service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 677, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 964, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 714, in _handle_entity_call
    await result
  File "/config/custom_components/fullykiosk/switch.py", line 91, in async_turn_off
    await self.coordinator.async_refresh()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 168, in async_refresh
    await self._async_refresh(log_failures=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 270, in _async_refresh
    update_callback()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 533, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 571, in _async_write_ha_state
    state = self._stringify_state(available)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 539, in _stringify_state
    if (state := self.state) is None:
  File "/config/custom_components/fullykiosk/sensor.py", line 115, in state
    time = parser.parse(self.coordinator.data[self._sensor])
  File "/usr/local/lib/python3.9/site-packages/dateutil/parser/_parser.py", line 1368, in parse
    return DEFAULTPARSER.parse(timestr, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/dateutil/parser/_parser.py", line 643, in parse
    raise ParserError("Unknown string format: %s", timestr)
dateutil.parser._parser.ParserError: Unknown string format: 13/05/2022 11.42.24 PM
fribse commented 2 years ago

Same issue (I think) as https://github.com/cgarwood/homeassistant-fullykiosk/issues/103#issue-1240433427. Rolling back to 1.0.1 makes it work again.

BombusAlpinus commented 2 years ago

same issue here... but looks like that it is working... when turning screens on or off the above error messages are logged. rolling back to 1.0.1 didnt help... as mentioned in this comment i deactivated the "last app restart" entity and the errors where gone...

HA: Home Assistant OS - core-2022.5.5

fribse commented 2 years ago

That didn't work for me, just tried it, if I go to 1.0.2, I can't disable the last app restart entity, only delete it, and after a reboot, it is recreated. So the error is still thrown

cobirnm commented 2 years ago

hat didn't work for me, just tried it, if I go to 1.0.2, I can't disable

That did the trick for me.... Never the less this should be fixed