Use weather temp to turn a tuya plus on

New here, set up HA last week and enjoying its features.

But i am having some issues with a certain automation.

I want my tuya plug (connected to a heater) to turn on for 5 minutes if the temp drops below 7 Celsius.

I have this is the YAML

platform: numeric_state
entity_id: weather.home
attribute: temperature
above: ‘1’
below: ‘7’
for: ‘5:00’

It randomly triggers but never consistent.

Would appreciate any help, thanks.

do you not want it to turn on at 1 or less?
Is this YAML from your automatons.yaml ?

The easiest way is for this to be two separate automations.
Turn on when below 7.
Turn off when state on for 00:05:00 (hour, minute, second…must include zeros for blanks)

Thanks for reply.

I’d like it to come on anything below 7

Yes that’s my yaml, I think it’s checking weather hourly hence why this only works periodically

I assume this anyway.

It should look like this: (use the </> above)

alias: Weather Test
description: ''
  - platform: numeric_state
    entity_id: weather.home
    attribute: temperature
    below: '7'
    for: '00:05:00'
condition: []
  - type: turn_off
    device_id: xxxxxxxxxxxxxxxxxxxxxxxx
    entity_id: switch.shelly_shsw_pm_bxxxxx
    domain: switch
mode: single

Thanks seems making them into 2 automations fixed the issue.

Working great now!