Skip to content

POINTTAPI: generic Bosch services are not compatible with POINTTAPI #24

Description

@jfhautenauven

Description

I'm currently using Bosch Home Assistant integration v1.5.0-beta.1 with a CT200 connected through POINTTAPI.

While testing the available Bosch services, I noticed that the generic services such as:

  • bosch.send_custom_get
  • bosch.send_custom_put_string
  • bosch.send_custom_put_float
  • bosch.update_thermostat
  • bosch.debug_scan

appear to have been designed for the legacy XMPP/HTTP implementation and are not fully compatible with the new POINTTAPI implementation.

In particular, bosch.send_custom_get is exposed in Home Assistant, but calling it with a POINTTAPI device results in:

Failed to perform action bosch.send_custom_get. Unknown error

Technical details

In v1.5.0-beta.1, POINTTAPI uses the new PoinTTAPIClient, which exposes:

async def get(self, uri: str)
async def put(self, uri: str, value)
async def bulk(self, paths: list[str])

However, the generic services still call the legacy methods through BoschGatewayEntry:

async def custom_get(self, path):
    return await self.gateway.raw_query(path=path)

async def custom_put(self, path: str, value):
    await self.gateway.raw_put(path=path, value=value)

For a POINTTAPI device, self.gateway is a PoinTTAPIClient, which does not provide raw_query() or raw_put().

Therefore the current call chain is effectively:

bosch.send_custom_get
        ↓
custom_get()
        ↓
self.gateway.raw_query()
        ↓
PoinTTAPIClient
        ↓
Unknown error

The POINTTAPI client instead provides get() and put().

Suggested implementation

Could the generic services be adapted to support both protocols?

For example:

async def custom_get(self, path):
    async with self._update_lock:
        if self._protocol == POINTTAPI:
            return await self.gateway.get(path)
        return await self.gateway.raw_query(path=path)

And similarly for PUT:

async def custom_put(self, path, value):
    if self._protocol == POINTTAPI:
        return await self.gateway.put(path, value)
    return await self.gateway.raw_put(path=path, value=value)

This would allow the existing Home Assistant services to work transparently with both legacy Bosch protocols and POINTTAPI.

debug_scan

The same issue seems to apply to bosch.debug_scan.

Currently, debug_scan is not registered for POINTTAPI. The code deliberately registers the debug services only on the XMPP/HTTP path.

However, POINTTAPI already has a useful bulk() mechanism which can query multiple resources in a single request.

It would therefore be very useful if bosch.debug_scan could also support POINTTAPI, ideally using the existing PoinTTAPIClient.bulk() implementation.

This would make it possible to discover the resources exposed by a CT200 through POINTTAPI and would greatly simplify troubleshooting and development of additional entities.

Expected behaviour

For a POINTTAPI CT200, I would expect:

bosch.send_custom_get

to perform a GET against:

/gateways/<deviceId>/resource/<path>

using the existing POINTTAPI authentication/token mechanism.

Likewise:

bosch.send_custom_put_string
bosch.send_custom_put_float

should use the POINTTAPI PUT endpoint.

And ideally:

bosch.debug_scan

should be available for POINTTAPI devices as well.

Why this would be useful

Having the generic GET/PUT/debug services working with POINTTAPI would make the integration significantly easier to extend.

It would allow users and developers to test newly discovered Bosch resources directly from Home Assistant without having to modify the integration every time a new POINTTAPI resource is found.

This is particularly useful for the CT200 / EasyControl, where POINTTAPI exposes many resources that are not yet represented as Home Assistant entities.

Thanks for the work on the POINTTAPI implementation! This seems like a relatively small gap between the existing generic service layer and the new POINTTAPI client, and fixing it would make the integration much more powerful for POINTTAPI users.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions