Automation: smart sw current less than 1 for an hour turn off sw

Hi, I’m not easy with yaml files. Anyone can show working automation with condition “when pc01_sw is turn on and pc01_current below 1 for an hour” then “turn off pc01_sw”.

Sorry I found MY mistake, every automation setup should start from trigger. After configure trigger based pc01_current < 1, the rest works like a charm.