Caso Design Integration with HA?

We just got a Caso Smart Wine Fridge and it works great from the app, but I am not able to integrate it into my HA. I am not too worried about the temp readings, but would like to add the lights to one of my scenes. Here is a link to the Wine Fridge https://www.amazon.com/Caso-Design-38-Bottle-10720-Dual-Zone/dp/B07JJDNNZ1 and the app that it uses is https://play.google.com/store/apps/details?id=com.casoapp.control. Anyone have any suggestions?

Hi
Did you get anywhere with this?
I too have the same fridge

Cheers

@Jparring , nope.

Hey hey,
Any progress in that topic? I have the same fridge.
Thank you!

No such luck. I was thinking of replacing the chip, but just haven’t gotten around to it yet.

Caso has published their API here: publickitchenapi.casoapp.com

Using this information I was able to integrate sensor readings from my 2 zone winecooler using the RESTful integration in this setup:

rest:
  - resource: "https://publickitchenapi.casoapp.com/api/v1.0/Winecooler/Status"
    method: "POST"
    headers:
      accept: "text/plain"
      x-api-key: !secret caso_api_key
      Content-Type: "application/json"
    payload: "{\"technicalDeviceId\":\"<TechnicalDeviceID>\"}"
    sensor:
      - name: "White actual"
        unique_id: d9ce4c7a-173a-4da2-9fe9-2e2084838fda
        value_template: '{{ value_json.temperature1 }}'
        unit_of_measurement: "°C"
      - name: "White current"
        unique_id: 1610999e-bc7e-496a-82d4-d36755954a62
        value_template: '{{ value_json.targetTemperature1 }}'
        unit_of_measurement: "°C"
      - name: "Red actual"
        unique_id: 84d5ddba-20da-43c7-b381-7c6a30bdae12
        value_template: '{{ value_json.temperature2 }}'
        unit_of_measurement: "°C"
      - name: "Red current"
        unique_id: 34f3e80e-ff4e-425f-a63a-9b2e4364b9df
        value_template: '{{ value_json.targetTemperature2 }}'
        unit_of_measurement: "°C"
    binary_sensor:
      - name: "White cool"
        unique_id: cde31e6d-9c96-4026-b7d1-a885473bcf24
        value_template: '{{ value_json.power1 }}'
      - name: "White light"
        unique_id: 0430755c-8b1b-477c-817d-d1fc7b2747a6
        value_template: '{{ value_json.light1 }}'
      - name: "Red cool"
        unique_id: d67fe5dd-7845-4cf5-a512-0943aebece55
        value_template: '{{ value_json.power2 }}'
      - name: "Red light"
        unique_id: ebcad8f0-9963-4a02-a9f1-c543a21b8159
        value_template: '{{ value_json.light2 }}'

The caso webpage provides instruction in finding the “TechnicalDeviceID” and the API key used above.

This works very well and allows me to track the cooler.

Going from here I attempted to setup light control like this:

switch:
  - platform: rest
    name: white_light
    unique_id: f9cfd915-3fac-4ed7-9ab7-ae20cddef105
    resource: "https://publickitchenapi.casoapp.com/api/v1.0/Winecooler/SetLight"
    method: "POST"
    headers:
      accept: "*/*"
      x-api-key: !secret caso_api_key
      Content-Type: "application/json"
    body_on: "{\"technicalDeviceId\":\"<TechnicalDeviceID>\",\"zone\":0,\"lightOn\":true}"
    body_off: "{\"technicalDeviceId\":\"<TechnicalDeviceID>\",\"zone\":0,\"lightOn\":false}"
    is_on_template: "{{states('binary_sensor.white_light') }}"
  - platform: rest
    name: red_light
    unique_id: a8fd473c-0091-46d9-918c-a16099b4d765
    resource: "https://publickitchenapi.casoapp.com/api/v1.0/Winecooler/SetLight"
    method: "POST"
    headers:
      accept: "*/*"
      x-api-key: !secret caso_api_key
      Content-Type: "application/json"
    body_on: "{\"technicalDeviceId\":\"<TechnicalDeviceID>\",\"zone\":1,\"lightOn\":true}"
    body_off: "{\"technicalDeviceId\":\"<TechnicalDeviceID>\",\"zone\":1,\"lightOn\":false}"
    is_on_template: "{{states('binary_sensor.red_light') }}"

This is not working. The problem seems to be that Home Assistant expects that GET command to the endpoint would return a payload where the current switch state can be determined, This is not the case, as this endpoint only accepts a POST, and the other endpoint, addressed above has to be used to get the current state of the light. I tried to work around this through the template in the is_on_template, which references the binary sensor above rather than the payload from the endpoint. But the log files still results in 405 error, and Home Assistant does not create the entity.

Any ideas on how to move on from here are much appreciated.

I have since yesterday update the configuration to use the command_lineintegration. The total setup is now like this:


rest:
  - resource: "https://publickitchenapi.casoapp.com/api/v1.0/Winecooler/Status"
    method: "POST"
    headers:
      accept: "text/plain"
      x-api-key: !secret caso_api_key
      Content-Type: "application/json"
    payload: "{\"technicalDeviceId\":\"<TechnicalDeviceID>\"}"
    sensor:
      - name: "White actual"
        unique_id: d9ce4c7a-173a-4da2-9fe9-2e2084838fda
        value_template: '{{ value_json.temperature1 }}'
        unit_of_measurement: "°C"
      - name: "White current"
        unique_id: 1610999e-bc7e-496a-82d4-d36755954a62
        value_template: '{{ value_json.targetTemperature1 }}'
        unit_of_measurement: "°C"
      - name: "Red actual"
        unique_id: 84d5ddba-20da-43c7-b381-7c6a30bdae12
        value_template: '{{ value_json.temperature2 }}'
        unit_of_measurement: "°C"
      - name: "Red current"
        unique_id: 34f3e80e-ff4e-425f-a63a-9b2e4364b9df
        value_template: '{{ value_json.targetTemperature1 }}'
        unit_of_measurement: "°C"
    binary_sensor:
      - name: "White cool"
        unique_id: cde31e6d-9c96-4026-b7d1-a885473bcf24
        value_template: '{{ value_json.power1 }}'
      - name: "Red cool"
        unique_id: d67fe5dd-7845-4cf5-a512-0943aebece55
        value_template: '{{ value_json.power2 }}'
command_line:
  - switch:
      name: white_light
      unique_id: f9cfd915-3fac-4ed7-9ab7-ae20cddef105
      command_on: >
        curl -X POST "https://publickitchenapi.casoapp.com/api/v1.0/Winecooler/SetLight" -H  "accept: */*" -H  "x-api-key: <API key>" -H  "Content-Type: application/json" -d "{\"technicalDeviceId\":\"<TechnicalDeviceID>\",\"zone\":1,\"lightOn\":true}"
      command_off: >
        curl -X POST "https://publickitchenapi.casoapp.com/api/v1.0/Winecooler/SetLight" -H  "accept: */*" -H  "x-api-key: <API key>" -H  "Content-Type: application/json" -d "{\"technicalDeviceId\":\"<TechnicalDeviceID>\",\"zone\":1,\"lightOn\":false}"
      command_state: >
        curl -X POST "https://publickitchenapi.casoapp.com/api/v1.0/Winecooler/Status" -H  "accept: text/plain" -H  "x-api-key: <API key>" -H  "Content-Type: application/json" -d "{\"technicalDeviceId\":\"<TechnicalDeviceID>\"}"
      value_template: "{{ value_json.light1 }}"
  - switch:
      name: red_light
      unique_id: a8fd473c-0091-46d9-918c-a16099b4d765
      command_on: >
        curl -X POST "https://publickitchenapi.casoapp.com/api/v1.0/Winecooler/SetLight" -H  "accept: */*" -H  "x-api-key: <API key>" -H  "Content-Type: application/json" -d "{\"technicalDeviceId\":\"<TechnicalDeviceID>\",\"zone\":2,\"lightOn\":true}"
      command_off: >
        curl -X POST "https://publickitchenapi.casoapp.com/api/v1.0/Winecooler/SetLight" -H  "accept: */*" -H  "x-api-key: <API key>" -H  "Content-Type: application/json" -d "{\"technicalDeviceId\":\"<TechnicalDeviceID>\",\"zone\":2,\"lightOn\":false}"
      command_state: >
        curl -X POST "https://publickitchenapi.casoapp.com/api/v1.0/Winecooler/Status" -H  "accept: text/plain" -H  "x-api-key: <API key>" -H  "Content-Type: application/json" -d "{\"technicalDeviceId\":\"<TechnicalDeviceID>\"}"
      value_template: "{{ value_json.light2 }}"

This allows me to track powerstate, temperature, as well as control the lights.

1 Like

Hello BeeGee,
what exactly do I have to do?
I have the “caso_api_key”
and the “DeviceID” entered correctly and I get the following error message:
“2024-04-28 19:31:09.752 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform rest is taking over 10 seconds.
2024-04-28 19:31:09.994 ERROR (MainThread) [homeassistant.components.rest.data] Timeout while fetching data: https://publickitchenapi.casoapp.com/api/v1.0/Winecooler/Status
2024-04-28 19:32:08.940 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: ‘value_json’ is undefined when rendering ‘{{ value_json.temperature1 }}’
2024-04-28 19:32:08.959 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: ‘value_json’ is undefined when rendering ‘{{ value_json.targetTemperature1 }}’
2024-04-28 19:32:08.965 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: ‘value_json’ is undefined when rendering ‘{{ value_json.temperature2 }}’
2024-04-28 19:32:08.969 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: ‘value_json’ is undefined when rendering ‘{{ value_json.targetTemperature2 }}’
2024-04-28 19:32:08.973 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: ‘value_json’ is undefined when rendering ‘{{ value_json.power1 }}’
2024-04-28 19:32:08.984 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: ‘value_json’ is undefined when rendering ‘{{ value_json.light1 }}’
2024-04-28 19:32:08.987 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: ‘value_json’ is undefined when rendering ‘{{ value_json.power2 }}’
2024-04-28 19:32:08.990 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: ‘value_json’ is undefined when rendering ‘{{ value_json.light2 }}’
2024-04-28 19:32:15.512 ERROR (MainThread) [homeassistant.components.rest.data] Timeout while fetching data: https://publickitchenapi.casoapp.com/api/v1.0/Winecooler/Status”

Can you help me?

I ended up disabling the integration for my part, as my particular model of wine cooler beeps whenever the lights are controlled. They advised that this was not the case on never models, hence I could work around it by upgrading :smiley: It tried reenabling the integration, and it no longer works for me. It seems that Caso might have changed something on their backend, as their API appears to be responding a lot slower even though I have no data to back this. But it takes forever to load when exercising the rest api on the page: Swagger UI