Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95295

Automation trigger with continual check

$
0
0

@Narfel wrote:

I want a sensor that only conditionally runs a shell_command when the criteria device_tracker.pc is “home” and does nothing when it is “not_home”. I thought an automation that checks the device_tracker and then calls shell_command would work:

- id: '<id created by automation editor>'
  alias: Run PC Uptime Sensor
  description: ''
  trigger:
  - entity_id: device_tracker.pc
    platform: state
    to: "home"
  condition: []
  action:
    service: shell_command.get_pc_uptime

But it does never fire at all. Is it because i’m looking for a state change? If yes, how can i have it just periodically check if the state is “home”? Or do i have to check for the state change initially and use a condition checking something like last_run for periodic runs? I’m guess i’m just not clear on the logic behind that.

Posts: 4

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 95295

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>