Expand plaato Integration

Hi! Just installed the Plaato integration and I’m using it for Keg info. Great work. Is there a way we can add Keg Date info as attribute (Pin v67 in the API)? “Last Pour” is already there (pin v59) but it would be very convenient to have the first pour also. Thanks!

Hi, thank you for using the integration. Pin v67 is already present as an attribute and is called “Keg Date”

See source code here

@JohNan Thank you for taking the time to respond. That’s what I thought when looking at the code, but somehow I always get today’s date for keg_date attribute. When I do a manual GET call for pin v67 with my auth_token I do get the Keg Date as it appears in the app. Please let me know if there’s something I can try.

Thanks again.

@JohNan For those having the same issue (Keg Date returns today’s date instead of keg’s first pour date as in App), here’s a workaround.

Create a RESTFul sensor with an api GET call to pin v67:

  - platform: rest
    resource: http://plaato.blynk.cc/your_auth_token_here/get/v67
    method: GET
    name: Keg First Pour

For cosmetic purposes, create a template to convert the result to a nice looking date format:

  - platform: template
    sensors:
      keg_first_pour_date:
        friendly_name: Keg First Pour Date
        value_template:  >-
              {% set date_string = states('sensor.keg_first_pour') %}
              {% set dt = strptime(date_string[2:-2], "%b %d %Y") %}
              {{ as_timestamp(dt) | timestamp_custom('%b %d, %Y') }}

Bonus: you can also create a sensor to know how many days since your keg was first opened

  - platform: template
    sensors: 
      keg_days_from_first_pour:
        friendly_name: Keg Days
        value_template: >-
              {{ (now() - (strptime(states('sensor.keg_first_pour')[2:-2], "%b %d %Y", now()) | as_local)).days }}
        unit_of_measurement: 'days'

And this is what you get:

sensor.keg_first_pour (Keg First Pour):  ["Jan 23 2022"]
sensor_keg_first_pour_date (Keg First Pour Date): Jan 23, 2022
sensor.keg_days_from_first_pour (Keg Days): 15

Just for fun, this is what my Lovelace card looks like after a little tinkering:

Looks like there is a subtle bug in the model that causes it to always return the current timestamp: Fixed bug with keg date attribute. by boralyl · Pull Request #2 · JohNan/pyplaato · GitHub

The fix has been included in the upcoming release of Home Assistant. Thank you for you contribution @fahr !

1 Like

Greetings team, As of about a week or so ago, my Plaato keg integration seems to have broken. I’m showing that the entities are all unavailable. I’ve deleted my instance and recreated it with no change. Doing a manual api call via curl works properly, so it’s not the plaato cloud that’s having issues. Has anyone else seen problems?

Same here seems to have been triggered by core-2022.4.5…
@JohNan thanks for a great integration are you aware of the issue?

Heya Bjorn,

I’ve opened an issue with the JoNan. He quickly identified that the vendor (plaato) is returning an invalid date format when their API is queried. I’ve opened a ticket with Plaato, but haven’t gotten any response yet.

Any idea which date? I use the integration and haven’t had any issues, but I only use the keg integration and not the airlock. I believe the only date is the keg date which the user inputs.

I’m using the keg integration as well, but I’m using it in CO2 mode. There may well not be a date associated with it; in that case something may have changed in the HA code that made it reject the empty date.

Yes i defently think there is something linked to HA.

Mine was working before i updated and after I rolled my installation back (I use proxmox so I just activated an earlier image) and it broke after I upgraded again.

I only use the keg part two kegs in beer mode.

Do you know which version of HA broke the integration? Was it definitely 2022.4.5, or possibly an earlier one in 2022.4.x?

Ah ok, yeah I could see how an empty date might be a problem as the code is actually parsing the entered dates now. Before the last release which included a fix for parsing dates, it would always return the current date and not attempt to parse the date the user did or did not enter.

So a quick fix workaround would be to just enter a date for your co2 tank and it should load up.

no But I defently skipped at least one release

Unfortunately in CO2 mode, there’s no option to enter a date. Would actually be a useful feature!

There is actually, it’s just that the app doesn’t do a great job of showing this to you. In fact you can enter text (but it won’t appear in the text input for some reason) and that text ends up in HA. The 2 fields at the bottom of the screen allow you to enter text.

The 1st is the name of the “keg” and the 2nd is the “keg date”. Even though you can’t see anything here, if I click on the input in the app, my keyboard shows that I can add/delete characters. Any invisible text you input into the first text input will be imported as the keg_name attribute for your entities, and any invisible text you input into the 2nd input will be imported as the keg_date attribute for your entities.


I never did get that trick to work (just never updated in the API for me), but the latest 2022.4.7 HA has fixed the issue. Thanks to everyone for the input and especially @JohNan for maintaining the integration.

1 Like