#IKEA Vindstyrka temperature automation not triggering

1 messages ยท Page 1 of 1 (latest)

limber grove
#

Hello!

Complete newbie at home assistant here (bought the green yesterday) but working as a developer so know a thing or two about code.

Sorry if this have been answered before. I have searched and read the documentation, couldn't find an answer.

I have set up an automation for toggling my smart plug connected to the radiator, based on the temperature reading of my IKEA Vindstyrka. Problem is that it never triggers.

Attaching screenshot of automation and state of sensors. What have I missed? ๐Ÿ˜Š

lean shuttle
#

Please share the YAML of the automation, using a code share site or code markup

#

99.99% likely the problem is that the sensor is already below 20 and you didn't read the description of how a numeric state trigger works

limber grove
#

Sounds very reasonable

lean shuttle
#

The key (bold) word in there is crosses

limber grove
#

Trying to get the automation yaml copied to sandbox, gimme a second. For some reason I cannot reach home assistant in the browser, either through ip or homeassistant.local:8123. So I need to fiddle with VS Code addon via the phone ๐Ÿ˜ Guess there is some VPN problem with the company laptop

lean shuttle
#

If that sensor hasn't been above 20 since you wrote the automation, that's the cause of the automation not running

limber grove
#

Line 110-156

lean shuttle
#
  - type: temperature
    device_id: 7802b19376bb260b025ef5f2589b7575
    entity_id: 73dd55a130bc27412a6c13dec26f150e
    domain: sensor
    trigger: device
    below: 20
``` behaves the same as a numeric state trigger (well, as a limited one of those) - the sensor has to go from _20 or higher_ to _below 20_ since you wrote the automation
pseudo locustBOT
#

There are three sections to an automation:

  • trigger: When any one of these becomes true the automation starts processing. Only one trigger is ever responsible for starting an automation, if you make a condition that checks for more than one having started the automation then the condition can never be true.
  • condition: These are checked after a trigger starts the processing, and must be true for the automation to continue.
  • action: This is the part that does something, and can also include further conditions.
lean shuttle
#

Triggers have to go from false to true for them to fire - if they're already true when the automation is written then they won't fire

limber grove
#

All right, that is probably the case. Any way to make it trigger any time the sensor is below 20?

#

I guess I could try to fool the sensor that it is hotter than it is, and than attempt it to go down, but it feels like there should be a more elegant solution ๐Ÿ˜Š

lean shuttle
#

Depends on how you want to tackle it, the simplest is to add a startup trigger and a numeric state condition

#

Then it'll run when HA starts or the sensor drops below 20, and check that the sensor is below 20

#

(that though won't catch the I just wrote the automation part, but that's a one time thing and you can manually run the automation)

limber grove
#

That is very true. I guess I can just manually trigger it, wait until it goes above 22 which is the turn off trigger, and than we are rolling?

lean shuttle
#

Yup

pseudo locustBOT
#

To test an automation there's three stages you can follow. Testing the action, the condition and action, and the whole automation:

  1. Use Configuration -> Automations to find the automation and then select Run in the three dots menu. If this fails your problem is in the action: section, and details should be found in your log file
  2. Use Developer tools -> Services and call automation.trigger on the automation with skip_condition: false. If the first passes but this fails then the problem is in your condition: block
  3. Use Developer tools -> States to find the trigger entity, click the name, then change the state (at the top) to something that'll trigger the automation before pushing Set State. If this fails then the problem is with your trigger: section, or the automation is turned off (you can check that in Automations, automations that are turned off will show Disabled)

You can also see this section in the docs about testing and automation traces.

limber grove
#

Oh thank you, that is a great resource

#

Didn't know you could temporarily mock state

#

I suppose that mocked state is active until a sensor overrides it?

lean shuttle
#

Yes

limber grove
#

โค๏ธ