Basic understanding of HA

Hi everyone,

I’m having some difficulties to understand how to create some basic automation in HA.

I have a file where it’s written 0 or 1 inside.
I wanted to created a command_line sensor to get the value.

- platform: command_line
  name: ypres
  command: "cat /data/y_home"
  scan_interval: 60

Then I want to trigger a task (email notification for example) when the value change !
I can’t figure out how to do this even if it seems really basic.
I’m totally lost trying everything from what I’m finding on internet ^^

Thx for your help.

Hi @amans, Welcome to HA.

You should start with the docs for automation and the examples.

If your sensor works as expected (you can check this in Developer Tools / States) you can use the state trigger for your automation.
Without the from/to parameters, it triggers on every change.

You seem to have the right idea. You want a sensor and an automation that reacts to the changes in that sensor.

If the command line sensor doesn’t work for your purpose, you may also want to check out the command line binary sensor.