Turn on switch when there is no movement- automation help

Hi

I’m trying to configure my first automation. When there will be no movement for 10 minutes turn on switch accessory. Here is my configuration, can you help me ? Please

I get this error in log:
17-03-26 01:10:11 ERROR (MainThread) [homeassistant.loader] Unable to find component automation.rpi_gpio
17-03-26 01:10:11 ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: platform rpi_gpio does not exist for automation for dictionary value @ data[‘trigger’][0][‘platform’]. Got None. (See /var/opt/homeassistant/configuration.yaml, line 24). Please check the docs at https://home-assistant.io/components/automation/

automation:

  • alias: Turn on switch 10 minutes after last movement
    trigger:
    platform: rpi_gpio
    entity_id: binary_sensor.motionsensor
    to: ‘off’
    for:
    minutes: 10
    action:
    service: homeassistant.turn_on
    entity_id: switch.nc_tv_power

Here is my all configuration:

homeassistant:

Name of the location where Home Assistant is running

name: Home

Location required to calculate the time the sun rises and sets

latitude: 53.175
longitude: 17.6167

Impacts weather/sunrise data (altitude above sea level in meters)

elevation: 107

metric for Metric, imperial for Imperial

unit_system: metric

Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time$

time_zone: Europe/Warsaw
customize:
binary_sensor.motionsensor:
friendly_name: “MotionSensor”
device_class: “motion”
sensor.dht_sensor_humidity:
friendly_name: “Upstairs_Wilgotnosc”
homebridge_hidden: true

automation:

  • alias: Turn on switch 10 minutes after last movement
    trigger:
    platform: rpi_gpio
    entity_id: binary_sensor.motionsensor
    to: ‘off’
    for:
    minutes: 10
    action:
    service: homeassistant.turn_on
    entity_id: switch.nc_tv_power

Show links to resources in log and frontend

introduction:

Enables the frontend

Enables configuration UI

config:

http:

Uncomment this to add a password (recommended!)

api_password: raspberry

Uncomment this if you are using SSL or running in Docker etc

base_url: example.duckdns.org:8123

Checks for available updates

updater:

Discover some devices automatically

Allows you to issue voice commands from the frontend in enabled browsers

conversation:

Enables support for tracking state changes over time.

View all events in a logbook

logbook:

Track the sun

sun:

Weather Prediction

binary_sensor:

  • platform: rpi_gpio
    device_class: motion
    ports:
    17: MotionSensor

sensor:

  • platform: dht
    sensor: DHT11
    pin: 4
    monitored_conditions:
    • temperature
    • humidity
  • platform: broadlink
    host: 192.168.8.127
    mac: B4:43:0D:38:48:C6
    monitored_conditions:
    • temperature

switch:
platform: broadlink
host: 192.168.8.126
mac: B4:43:0D:38:48:C6
switches:
tv_phillips:
friendly_name: ‘Tv Power’
command_on: 'JgDaAJKTEjcTNhY0FRATEhEUERMTEhI3EzcUNBMTERQQExMTERMRExM2ExMRFBETEhISExEUETcWDhQ2EjgRNxM2EzcSNxMABfqTkxM2FDYSNxMTERMSExISEhQRNxI3EjcUEhISExIRExITEhQSNRIUEhITEhIU$
command_off: JgDaAJKTEjcTNhY0FRATEhEUERMTEhI3EzcUNBMTERQQExMTERMRExM2ExMRFBETEhISExEUETcWDhQ2EjgRNxM2EzcSNxMABfqTkxM2FDYSNxMTERMSExISEhQRNxI3EjcUEhISExIRExITEhQSNRIUEhITEhIU$
nc_tv:
friendly_name: ‘NC Tv Power’
command_on: JgBQAAABLJQTNhM3FDcTExISExETEhM3ExITNhQ3FDYUOBISFDcSExMSEjcTExETEjcUEhMSExISNhYREjYUNxMUETcTOBM2FAAFAwABLEoSAA0FAAAAAAAAAAA=
command_off: JgBQAAABLJQTNhM3FDcTExISExETEhM3ExITNhQ3FDYUOBISFDcSExMSEjcTExETEjcUEhMSExISNhYREjYUNxMUETcTOBM2FAAFAwABLEoSAA0FAAAAAAAAAAA=

Just looking at your automation, you need to change platform: rpi_gpio to platform: state

Thanks a lot, now it’s showing in Menu. I will try it and let know if it works :wink:

1 Like

My pleasure. I hope it does the trick :slight_smile: