GithubHelp home page GithubHelp logo

Retrying setup error about brewfather HOT 9 CLOSED

mvddonk avatar mvddonk commented on August 27, 2024
Retrying setup error

from brewfather.

Comments (9)

MvdDonk avatar MvdDonk commented on August 27, 2024

Hi, is this a problem with a existing integration or are you trying to setup a new connection?
Can you check the Home Assistant logs for Brewfather errors?

from brewfather.

Scales82 avatar Scales82 commented on August 27, 2024

This error originated from a custom integration.

Logger: custom_components.brewfather.coordinator
Source: custom_components/brewfather/models/batch_item.py:34
Integration: Brewfather batch information for Home Assistant (documentation, issues)
First occurred: 16 February 2023 at 17:02:06 (2980 occurrences)
Last logged: 12:32:55

Unexpected error fetching brewfather data:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 239, in _async_refresh
self.data = await self._async_update_data()
File "/config/custom_components/brewfather/coordinator.py", line 54, in _async_update_data
data = await self.update()
File "/config/custom_components/brewfather/coordinator.py", line 66, in update
await self.connection.get_batch(batch.id, DRY_RUN)
File "/config/custom_components/brewfather/connection.py", line 63, in get_batch
return batch_item_from_dict(json.loads(jsonText))
File "/config/custom_components/brewfather/models/batch_item.py", line 285, in batch_item_from_dict
return BatchItem.from_dict(s)
File "/config/custom_components/brewfather/models/batch_item.py", line 261, in from_dict
recipe = from_union([Recipe.from_dict, from_none], obj.get("recipe"))
File "/config/custom_components/brewfather/models/batch_item.py", line 34, in from_union
assert False
AssertionError

from brewfather.

Scales82 avatar Scales82 commented on August 27, 2024

image

from brewfather.

MvdDonk avatar MvdDonk commented on August 27, 2024

Most likely this has to do with missing permissions in Brewfather. Make sure to enable the correct scope (see image below).
image

If things still don't work please click "Enable debug logging" on the Brewfather integration and after a few minutes disable the logging "Disable debug logging". After disabling a log file will be downloaded, please send me the file or all Brewfather errors in the log.

Enable logging:
image

Disable logging:
image

from brewfather.

Scales82 avatar Scales82 commented on August 27, 2024

2023-10-30 12:07:45.205 ERROR (MainThread) [custom_components.brewfather.connection] Unable to create readings from json
2023-10-30 12:07:45.213 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Brewery for brewfather
Traceback (most recent call last):
File "/config/custom_components/brewfather/connection.py", line 105, in get_readings
reading = readings_from_dict(jsonData)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/brewfather/models/reading_item.py", line 118, in readings_from_dict
return from_list(Reading.from_dict, s)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/brewfather/models/reading_item.py", line 50, in from_list
return [f(y) for y in x]
^^^^^^^^^^^^^^^^^
File "/config/custom_components/brewfather/models/reading_item.py", line 50, in
return [f(y) for y in x]
^^^^
File "/config/custom_components/brewfather/models/reading_item.py", line 83, in from_dict
rssi = from_union([from_int, from_none], obj.get("rssi"))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/brewfather/models/reading_item.py", line 30, in from_union
assert False
AssertionError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 399, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/brewfather/init.py", line 45, in async_setup_entry
await coordinator.async_refresh()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 266, in async_refresh
await self._async_refresh(log_failures=True)
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 290, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/brewfather/coordinator.py", line 53, in _async_update_data
data = await self.update()
^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/brewfather/coordinator.py", line 64, in update
readings = await self.connection.get_readings(batch.id, DRY_RUN)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/brewfather/connection.py", line 108, in get_readings
exit(1)
File "", line 26, in call
SystemExit: 1

from brewfather.

Scales82 avatar Scales82 commented on August 27, 2024

That's the error I am getting, recreated the API key and checked scope, still no good.

from brewfather.

MvdDonk avatar MvdDonk commented on August 27, 2024

Which version of the integration are you using?
Can you enable debug logging, try again or wait until the error occurred, disable logging and attach the entire file here?
You can see how to enable debug logging in a few comments above this one.

from brewfather.

Scales82 avatar Scales82 commented on August 27, 2024

Version 1.1.4
File attached. Removed non-integration related data.
home-assistant_brewfather_2023-11-02T23-45-30.747Z.log

from brewfather.

MvdDonk avatar MvdDonk commented on August 27, 2024

@Scales82
It doesn't seem debugging is enabled in the log file. I need to know what the JSON is that is returned by brewfather so I can see what's different in your situation.
When debugging is enabled you should see more logging, something like: "json response: [entire json here]"
You can see in my code here what is logged when debugging is enabled: https://github.com/MvdDonk/brewfather/blob/main/custom_components/brewfather/connection.py#L47

Please make sure debugging is enabled and also make sure your log file has the message "json response: [entire json here]" in it.

from brewfather.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.