jcgoette / baby_buddy_homeassistant

This custom integration provides sensors for Baby Buddy API endpoints.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Services not working

Shaun-Harrison opened this issue · comments

When calling any of the services to add records to Baby Buddy via Home Assistant, I'm getting the following error

2022-01-03 08:19:56 ERROR (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Error executing script. Unexpected error for call_service at pos 1: 0, message='Attempt to decode JSON with unexpected mimetype: text/html', url=URL('http://192.168.1.70:10405/api/changes/') Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 381, in _async_step await getattr(self, handler)() File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 584, in _async_call_service_step await service_task File "/usr/src/homeassistant/homeassistant/core.py", line 1495, in async_call task.result() File "/usr/src/homeassistant/homeassistant/core.py", line 1530, in _execute_service await handler.job.target(service_call) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 691, in handle_service await service.entity_service_call( File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 663, in entity_service_call future.result() # pop exception if have File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 896, in async_request_call await coro File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 700, in _handle_entity_call await result File "/config/custom_components/babybuddy/sensor.py", line 199, in async_add_diaper_change await self.coordinator.client.async_post(ATTR_CHANGES, data) File "/config/custom_components/babybuddy/client.py", line 64, in async_post error = await resp.json() File "/usr/local/lib/python3.9/site-packages/aiohttp/client_reqrep.py", line 1103, in json raise ContentTypeError( aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/html', url=URL('http://192.168.1.70:10405/api/changes/')

2022-01-03 08:19:56 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [2924599784] Error handling message: Unknown error Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 27, in _handle_async_response await func(hass, connection, msg) File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 527, in handle_execute_script await script_obj.async_run(msg.get("variables"), context=context) File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1260, in async_run await asyncio.shield(run.async_run()) File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 363, in async_run await self._async_step(log_exceptions=False) File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 381, in _async_step await getattr(self, handler)() File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 584, in _async_call_service_step await service_task File "/usr/src/homeassistant/homeassistant/core.py", line 1495, in async_call task.result() File "/usr/src/homeassistant/homeassistant/core.py", line 1530, in _execute_service await handler.job.target(service_call) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 691, in handle_service await service.entity_service_call( File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 663, in entity_service_call future.result() # pop exception if have File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 896, in async_request_call await coro File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 700, in _handle_entity_call await result File "/config/custom_components/babybuddy/sensor.py", line 199, in async_add_diaper_change await self.coordinator.client.async_post(ATTR_CHANGES, data) File "/config/custom_components/babybuddy/client.py", line 64, in async_post error = await resp.json() File "/usr/local/lib/python3.9/site-packages/aiohttp/client_reqrep.py", line 1103, in json raise ContentTypeError( aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/html', url=URL('http://192.168.1.70:10405/api/changes/')

This is running version 2021.12.7 of Home assistant & version V2.3.0 of BabyBuddy - Downgrading baby buddy did not change the issue

What version of BabyBuddy itself are you running? Is this a local instance of BabyBuddy? Did this ever work?

Hello

On the latest tag and its a local instance running on my RPI3 - Was all working fine before but can't say exactly when it stopped working

Hmm. Based on the error I'm wondering if there is some other issue with your setup. I think we are only hitting this line because the diaper change couldn't be created.

Would you be willing to re-setup your baby_buddy_homeassistant integration to see if anything comes up?

Hello

Sorry for the delay, looks like the underlying issue was running baby buddy on an RPI3 - moved back to my RPI4 and all is working fine!