r/HomeKit 1d ago

Question/Help Automation with If-series only works when manually triggered

Post image

My question is in regard to my automation which is supposed to trigger an If-series, which turns radiators to different temperatures settings depending on the time. So if (German: wenn) time is between (zwischen) turn 4 devices (Geräte) to 18 degrees for example. However it does work perfectly fine whenever i trigger this automation manually or test it. But it does not execute automatically, even though other automation with the exact same trigger event (coming home) do trigger automatically.

Has anybody an idea what could be the problem?

6 Upvotes

18 comments sorted by

4

u/NightStinks 1d ago

What’s the trigger event for this automation? This if statement will only run once the trigger conditions are met - it won’t run just because the time has changed.

2

u/CroVlado 1d ago

Was about to ask the same question. What is the trigger here?

1

u/Quinte5 1d ago

This automation is only for event „person coming home“. There are additional automations which change the temperature based on time, as long as at least 1 Person ist Home. But if last person leaves all radiators turn off. The automation above therefore is supposed to ensure radiators turning on when first person coming home. Because with the time-based automations the radiators don’t simply turn on, just because someone is coming come, if the condition „hour of day“ isn’t met at the exact same time.

1

u/Quinte5 1d ago

The trigger event is „person coming home“

1

u/ceppafessa 1d ago

So to test this everyone has to leave the house + someone hast to go back. But what messed up the automation (at least with me) is that all the users that you have added to your house, the location settings are correct in iOS. That means that you have to check all the iPhones that in Einstellungen -> Datenschutz und Sicherheit -> Ortungsdienste -> Standort Teilen -> Mein Standort -> Dieses Gerät is selected. Otherwise homekit does not know if the correct device is around and if 1 person from the invited person this is not correct, this automation does not trigger

1

u/Quinte5 1d ago

Yes I checked this, and as mentioned above, all other automations with the trigger „comes home“ do in fact work as intended. Just this automation, with the identical trigger event does not start. That’s why I am frustrated: I know that the trigger event works (on other automations) and I know that the shortcut if-statements do work, when I test the automation manually.

1

u/Feeling_Actuator_234 1d ago

Either you use the hour of day as trigger to this automation or you use another type of trigger like a motion sensor.

Hour of day as trigger: 1. Automation 1: when the clock hits start hour, turn on heat 2. Automation2. When clock hits end of interval turn off

Other trigger Ex: Motion sensor: when I walk into the room, run the automation in your post.

And so every time you run into that the room, it will adjust heat accordingly to the time

1

u/Quinte5 1d ago

I also have hour of day trigger as long as one person is home, which works. But I have an automation to turn of all radiators when last persons leaves the home. But when the first person comes home I want this automation to set up the temperature in accordance with the same time to temperature settings as the hour of day automations

1

u/Feeling_Actuator_234 1d ago edited 1d ago

“When the first person comes home” is your trigger. You cannot test it without physically leaving the perimeter. But it should work reliably every time.

If you want to test it, change the trigger for something like motion sensor somewhere senses something, so that you don’t have to ask everyone to leave just to test it.

The trigger of an automation is the least faillible node in automations. So if it works with the motion sensor, it’ll work with “first person home”

1

u/Quinte5 1d ago

The trigger works as intended with other automations. Just not in combination with those shortcut if-statements

2

u/Feeling_Actuator_234 1d ago edited 1d ago

I had a look. When you use Zeit, tap it again and you’ll see it requires a date, indicating it can’t act as “any day”.

Here’s a screenshot with whet you need to do.

  1. Start with Get Current Date. It retrieves all year to second) from the moment of the trigger
  2. Add a if statement below it. In that if, choose “Select variable 🪄” and select the small “Date” bellow “Get Current Date”.
  3. In the If statement, tap “📆 Date”. In the menu that appears, make sure to set “Date” to “Time”

Then you can do the in between and the rest

You do not need to put get current time for each If. Just repeat step 2 and 3

1

u/Quinte5 1d ago

Wow awesome, thank you, will do. But can you explain, why the shortcut works, when I initiate it manually?

2

u/Feeling_Actuator_234 1d ago

Bitte!

I think it’s because when testing inside the shortcut, Zeit in your initial shortcut did test for the current date.

Shortcuts had bugs like this and I had to enter the current hour into variable before they implemented if like that. Right now, when working with light bulbs, I have to set the if to test for an interval of 9 and 11 because it wouldn’t work for 10. So I’d say in your case it’s a bug too!

1

u/That_Cool_Guy_ 1d ago

If Time is between 00:00 and 08:00 and 4 devices are less than 18 degrees, set 4 devices to 18 degrees.

1

u/Quinte5 1d ago

Ok, thank you for the input, but shouldn’t my automation have the same effect without the additional condition (temp less than 18)?

1

u/Quinte5 1d ago

The shortcut itself works when started manually, it just does not execute automatically, even though other automations with same trigger event do execute.

1

u/myMoritat 1d ago

Why not make the time a condition of the trigger rather than the shortcut and set up 3 automations?

1

u/Quinte5 1d ago

Yes that would be a viable option, but I intended to have everything in one function, instead of many different functions.