How-to integrate HomePod Mini Sensors into Home Assistant When Direct Integration Isn't Possible

For sure, the name of your sensor is wrong in the url you’re using. Look at my automation, and you have to make a different URL for every sensor.
You’re also using the webhook url, but that’s option 1… you have to do it with states, that’s option 2.

Make sure state is a number field, not a text (no way to check it when you’ve added it, you can only see it when you add it)

Then: if you’ve created a helper Toggle, it’s fine. You should have an entity id as “input_boolean.name_of_your_sensor”. Make sure you add that to your HomeKit bridge (in devices), so HomeKit can find the toggle.
Your automation should be fine. This is mine:

alias: Homekit - Sensor Collection
description: Processes temperature and humidity data from the HomePod Mini
trigger:
  - platform: time_pattern
    id: time
    seconds: /30
action:
  - service: input_boolean.turn_on
    target:
      entity_id: input_boolean.homekit_sensors_update
    data: {}
  - delay: "00:00:05"
  - service: input_boolean.turn_off
    target:
      entity_id: input_boolean.homekit_sensors_update
    data: {}
mode: single

1 Like

I have tried this but i am getting this error when sending the POST:

  • Error rendering state template for sensor.homepod_humidity: UndefinedError: ‘dict object’ has no attribute ‘json’
  • Error rendering state template for sensor.homepod_temperature: UndefinedError: ‘dict object’ has no attribute ‘json’
- trigger:
      - platform: webhook
        webhook_id: 12345webhook
        allowed_methods:
          - POST
        local_only: false # Depends on your HTTPS setup
  sensor:
      - name: "HomePod Humidity"
        unique_id: "HomePod_Humidity"
        state: "{{ trigger.json.humidity }}"
        unit_of_measurement: "%"
        device_class: humidity
        state_class: measurement
      - name: "HomePod Temperature"
        state: "{{ trigger.json.temperature }}"
        unique_id: "HomePod_Temperature"
        unit_of_measurement: "°C"
        device_class: temperature
        state_class: measurement

You put humidity and temperature into the header, it should go in the body part. The header is empty in that case.

1 Like

Thank you! Wasted a lot of time last night :sweat_smile:
But I guess you are right. Most definitely the easiest way.

Include this input_boolean in the HomeKit configuration

Can someone please tell me where to enter this?

In the configuration of the Homekit Bridge Integration make sure to include “Input Boolean” under “Domains to include”.
Depending on your inclusion mode you have to either select (when inclusion mode = include) or deselect (when inclusion mode = exclude) your newly created input boolean on the next screen (after pressing submit once).

After that your input boolean will appear as a switch in the Home app

And now I don’t know where to enter this. I tried in the configuration.yaml, reloaded, but this doesn’t seem to work. I don’t see it in the automation target.

I could not find out where to modify the HomeKit configuration. The documentation doesn’t help there either.

Nice work! But…. Everything works except making the automation. I can’t assign the shortcut in my HomeKit automation. Everything else works.



Looks like you’re on the right track.
In the last screenshot you just need to add the actions to get the current value for temperature / humidity (under apps - home) and then add the “get contents from URL” (under web) and modify it accordingly.

Ahhhh now I get it! I have to make the shortcut in the automation. Not separate… thank you!

Was my question above so silly that I don’t get an answer here? Please help or explain.

Please refer to the Homekit Bridge Documentation.
The integration can be configured using the UI instead of using configuation.yaml

But you need to edit the yaml anyway to make this project work, depending on which way you choose more or less edits.

Hello guys,

I have used method B to retrieve the temperature and humidity from my Eve Room, which unfortunately I cannot connect to Home Assistant, even through HomeKit (Thread seems to be causing issues). I have followed the tutorial:

I have properly configured my configuration.yaml with:

input_boolean:
  homekit_sensors_update:
    name: Collection of HomeKit Sensors
    initial: off

api:

I have tested the API via Postman, when I do a Get on my /api/states, it returns all the states of my installation.

I have added the sensors in sensors.yaml:

- platform: template
  sensors:
    eve_room_desktop_temperature:
      friendly_name: "Eve Room Desktop Temperature"
      device_class: temperature
      state_class: measurement
    eve_room_desktop_humidity:
      friendly_name: "Eve Room Desktop Humidity"
      device_class: humidity
      state_class: measurement

I have set up the automation in the Home application (see screenshot).

When I manually execute the HA automation or let it execute automatically, I can see the input_boolean activated and deactivated after 5 sec in the Home application. But no information is sent to HA. Do you have any idea where this might be coming from?

Thank you in advance

The sensor you refer to in the URL should start with sensor.
So sensor.eve_room_desktop_temperature

EDIT: Ah, figured out the purpose of that input sensor and mine wasn’t configured correctly. It’s showing up in Homekit now :doh:

I must be missing something very obvious here but I don’t understand how to set up the HomeKit side.

The instructions refer to the “Homekit” app which I figured was the Shortcuts app based on the screenshots and I can create the shortcut and get it to update the sensors in HA but I cannot figure out the automation part, where do I find this “Accessory Automation” on the Homekit side?

Basically I have no idea how to get this screen:

You go to the Home (Maison in French?) app to set up the automation.
What it is: the HomeKit_sensors_update Boolean sensor is the trigger for HomeKit to run the automation (so every 2 minutes, HA sets that sensor to true, and youve exposed that sensor to HomeKit and then the automation in HomeKit gets triggered and runs the automation)

Thank you very much for your help. Unfortunately, it seems that it still doesn’t work. I have doubts about the configuration of my sensors in sensors.yaml because I can’t find them in HA. What do you think?

- platform: template
  sensors:
    eve_room_desktop_temperature:
      friendly_name: "Eve Room Desktop Temperature"
      device_class: temperature
      state_class: measurement
    eve_room_desktop_humidity:
      friendly_name: "Eve Room Desktop Humidity"
      device_class: humidity
      state_class: measurement

EDIT:

OK it looks like I can see them in my entities list now. But I have this error message in my dev tools:

Also, it looks like it doesn’t update the sensor value. Even if the HA automations executes every 5 minutes.

Do you know how I can:

  1. Reduce the number of decimals (I would like 17.7 instead of 17.7000007629395)
  2. Have a graph to display the history like this:


:arrow_up: Basically, this is exactly what I want to achieve with my sensor.eve_room_desktop_temperature

First: You don’t need to set up a template sensor? (it’s not in the instruction :wink: ). You send the necessary info in the URL. Check my screen shots in my earlier posts.
Second, to get it as a graph: also check my posts, you need to set up the HomeKit automation differently. So where you do the “get contents” part, and you add state to the main-part, make sure you use that as a number, not as a text field. So remove state from your command, add it again and make sure you add it as a number.

Hi @ChrisM1983!
I removed my sensors and double checked that I have configured state as a number (what I already did).

Now here is what I can see on my dev tools :


Still don’t have graph and can’t round to the nearest tenth :frowning:

Where is the get contents part for the temperature sensor? I’m doing it for humidity and temperature.