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

I think this is the issue, I have now looped back on the initial problem where it continually reports invalid authentication despite the authentication token being newly created and put in the same shortcut that was working before the iOS 18 update.
I recall this happening before and I cannot remember what ultimately clicked it into accepting the authentication token since once it worked, it worked and I didn’t need to think about it.

Here’s the log from it:
Login attempt or request with invalid authentication from fe80::12:xxxx:xxxx:xxxx (fe80::12:xxxx:xxxx:xxxx). Requested URL: '/api/states/sensor.living_room_homepod_l_temperature'. (BackgroundShortcutRunner/3036.0.4 CFNetwork/1568.100.1 Darwin/24.0.0)

After update 2024.10.* there is no need to send state_class.

Now automation looks like this (don’t forget Authorization header):

Summary

json should be like that:

{
"device_class":"measurement",
"state": 30,
"attributes": {
  "unit_of_measurement": "%",
  "friendly_name": "HomePod Mini - Humidity"
}
1 Like

Hi everyone,

I’m experiencing an issue with one of my HomePods. I followed all the instructions from the initial post Typ A, and everything works perfectly, one of them consistently on four out of five HomePods. However sends the value “1” for humidity to the webhook. Temperature works Fine and the other four homepods work Fine with this Solution.

I have recreated the HomeKit automation at least 10 times, but the error persists. Interestingly, when I manually query the HomePod in HomeKit, it returns the correct value.

I’m completely stumped at this point. Has anyone else encountered a similar issue or have any suggestions on how to resolve this?

Thanks in advance for your help!

Edit: now i tried Integration Typ B without python but got the same Problem, in HomeKit it shows the correct humidity but in HA i still just get a „1“ for one of divers homepods, i dont geht it…

1 Like

I just implemented Method B, and it is (now) working fine. In the json being sent, I have just the state and state_class, followed by an “attributes” dictionary with the other data points (unit_of_measurement, friendly_name, device_class) under that.

For those using the UI instead of entering the YAML directly:

  1. For an input_boolean, use the “Toggle” helper.
  2. For adding to HomeKit, go to the “HomeKit Bridge” integration, add a new entry, and include just the input_boolean sensor that you created.

I also added a helper to convert the temperature from Celsius to Fahrenheit.

I had tried putting the state_class under attributes, but then I received notifications about the state_class being missing. Even after moving it back, I’m still getting this message. Any ideas of what needs to be done to fix this?

Did you ever figure out how to solve your problem with humidity dropping to 0 or 1? I have 3 homepods and 1 works well but the other 2 are sending 0 unless I click the test automation button in homekit in which case it sends the correct value.

This is a Homekit issue but can’t seem to figure out what exactly is the issue.

Edit: I did some testing from outside the local network and it seems that the “Test This Automation” is running on that particular device (iPhone or MacBook) and it has access to the info from the Home app. The automation ran by HA will run on your AppleTV which might not see the sensor data properly. I wish Apple had another test button to target the device on which to run the automation.

I’m having the same issue with 2 of my HomePods. 1 works fine. Re-adding it changed it from 1 to 0… not really a solution but at least I saw a change :joy:

Edit: I’ve enrolled into the beta software and updated to 18.2 on Apple TV. Now one of the humidity sensors is correct and just 1 is showing up as 1. I’ve restarted the Apple TV and HomePod in question a few times and no update so it might be something to do with the software on Apple TV.

I gave up trying to use the home pod sensors. Instead I bought the inexpensive bluetooth thermometers from Govee and they work very reliable. Anyway I’m asking myself how a unit that heats up itself when in use is able to measure its surrounding temperature and humidity correctly.

1 Like

Short answer is, it can’t really… The temperature was at 33 yesterday when in reality my balls were frozen at less than 20 degrees :slight_smile:

Ok, I think I figured it out. There’s a bug somewhere, most likely in the way Apple TV interprets the data from variables.

In order to fix this I had to switch a few times between Current Relative Humidity, Name and Status Active for the affected variable.

Now all the values are coming back as expected.

Having an issue here and would be grateful for any assistance.

Am using Method A.

Everything works when I manually “Test This Automation” from my phone, but automated triggers never work.

System details:

Home Assistant
- Version: core-2024.12.3
- Installation type: Home Assistant OS
- Development: false
- Supervisor: true
- Docker: true
- User: root
- Virtual environment: false
- Python version: 3.13.0
- Operating system family: Linux
- Operating system version: 6.6.63-haos
- CPU architecture: x86_64

Phone
- Model: iPhone 12 mini
- iOS Version: 18.2

Homepod
- Model: MY5H2LL/A [HomePod mini - White]
- Version: 18.2 (22K155)

Stepping through Method A and my results:

  1. Create an input_boolean Exposed to HomeKit.

    Created and exposed. Switch is visible + operational in iOS.

  2. Create a Python Script in the config/python_script Directory.

    Created. Operates successfully with manual “Test This Automation” from Home app in phone.

  3. Create an Automation in Home Assistant.

    Created. Successfully controls input boolean switch in Homekit. Successfully processes manual tests from phone automation.

    I see the Time Trigger INFO events every 2 minutes in HA logs:

    2024-12-15 18:26:00.333 INFO (MainThread) [homeassistant.components.automation.homekit_sensor_collection] Homekit - Sensor Collection: Running automation actions

    2024-12-15 18:26:00.334 INFO (MainThread) [homeassistant.components.automation.homekit_sensor_collection] Homekit - Sensor Collection: Choose at step 1: choice 2: Running automation actions

    2024-12-15 18:26:00.335 INFO (MainThread) [homeassistant.components.automation.homekit_sensor_collection] Homekit - Sensor Collection: Choose at step 1: choice 2: Executing step call service

    2024-12-15 18:26:00.337 INFO (MainThread) [homeassistant.components.automation.homekit_sensor_collection] Homekit - Sensor Collection: Choose at step 1: choice 2: Executing step delay 0:00:05

    2024-12-15 18:26:05.339 INFO (MainThread) [homeassistant.components.automation.homekit_sensor_collection] Homekit - Sensor Collection: Choose at step 1: choice 2: Executing step call service

  4. Set Up an Automation in the HomeKit App.

    Created per screenshots below. Operates successfully only with manual testing (“Test This Automation” from Home app in phone).

Notes from experimenting with the iOS automation:

iOS Automation Trigger Output Result
HA via input boolean Turn on a light Success.
Time (“A Time of Day Occurs”) Send JSON sensor data Fail. No record in HA log.
Manual (“Test This Automation”) Send JSON sensor data Success. HA receives and processes Homepod Mini sensor data.

Gotta be something I’m overlooking with the Automation / Shortcut on the phone? Thanks in advance.

1 Like

I have the same problem after updating to iOS 18.2. Automation works only with manual checking. On iOS 18.1 it worked in automatic mode using method B. Has anyone figured out how to fix it?

System details:

Home Assistant

  • Version: 2024.12.3

Homepod

  • Model: MY5H2LL/A [HomePod mini - White]
  • Version: 18.2 (22K155)

Phone

  • Model: iPhone 13
  • iOS Version: 18.2
1 Like

I’m seeing chatter on Reddit and elsewhere that iOS 18.2 has broken a lot of shortcuts and automations.

Guessing that’s the situation for us as well. I’ve not seen any definitive workarounds.

Right now am just waiting for an iOS update with fingers crossed.

2 Likes

It seems that HomePodOS 18.2 has broken some of the automations that run shortcuts.
Hitting ‘Test This Automation’ means running the automation on the device where you hit that button, typically your iOS or Mac OS device. That runs fine as neither iOS nor Mac OS have that same issue.

If you are running your HomeKit on an AppleTV, you should be fine though.

A simpe workaround for the time being, if you have a Mac, is creating a Shortcut with the same actions as your automation, and have it run from cron:

*/2 * * * * /usr/bin/shortcuts run "Your newly created Shortcut"

A caveat is that you may need an iOS device to create that Shortcut because of the HomeKit Variable insertion issue, as mentioned here before.

3 Likes

Also having this issue, which is causing havoc with my heating! I’m looking into setting up an automation using a Pushcut server on a secondary iPhone, I’ll keep you posted while we wait for Apple to fix this with HomePodOS 21 :eyes:

1 Like

Same here, Bathroom fully cold today and living room above 25 degrees :frowning: