Skip to content

OpenWB Integration published range to %f' #378

@jmerifjKriwe

Description

@jmerifjKriwe

version of addon: 0.10.0-rc8

I'm using the gateway with openWB (charging-stations.json) and receive this error:

--- Logging error ---
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/logging/__init__.py", line 1160, in emit
    msg = self.format(record)
          ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/logging/__init__.py", line 999, in format
    return fmt.format(record)
           ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/logging/__init__.py", line 703, in format
    record.message = record.getMessage()
                     ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/logging/__init__.py", line 392, in getMessage
    msg = msg % self.args
          ~~~~^~~~~~~~~~~
TypeError: must be real number, not str
Call stack:
  File "/usr/src/app/./main.py", line 30, in <module>
    asyncio.run(mqtt_gateway.run(), debug=debug_log_enabled())
  File "/usr/local/lib/python3.12/asyncio/runners.py", line 195, in run
    return runner.run(main)
  File "/usr/local/lib/python3.12/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 678, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 645, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1999, in _run_once
    handle._run()
  File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/src/app/handlers/vehicle.py", line 138, in handle_vehicle
    await self.__polling()
  File "/usr/src/app/handlers/vehicle.py", line 200, in __polling
    self.__refresh_openwb(
  File "/usr/src/app/handlers/vehicle.py", line 226, in __refresh_openwb
    self.openwb_integration.update_openwb(
  File "/usr/src/app/integrations/openwb/__init__.py", line 43, in update_openwb
    LOG.info("OpenWB Integration published range to %f", range_topic)
Message: 'OpenWB Integration published range to %f'
Arguments: ('openWB/set/mqtt/vehicle/1/get/range',)

I guess it's more or less cosmetically.

btw: it would be great to also write to the soc_timestamp-Topic. Which should be configurable also in charging-stations.json

So with the lastest version of openWB you should write to:
openWB/set/mqtt/vehicle/1/get/soc_timestamp
openWB/set/mqtt/vehicle/1/get/soc
openWB/set/mqtt/vehicle/1/get/range
they added a mqtt to the topics.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions