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

Moving YAML code from configuration.yaml to whatever.yaml

$
0
0

Hello good home automation people!

I have this conde in my configuration.yaml file and want to move it to whatever.yaml for example or sonoff.yaml in my case.

# Sonoff RF bridge settings
sonoff:    
  rfbridge:
    Basement contact sensor S opened:  # button/alarm name in eWeLink application (open signal)
      name: Basement door contact sensor S  # optional, you can change sensor name
      device_class: door  # e.g. door, window
      timeout: 0  # disable auto close timeout
      payload_off: Basement contact sensor S closed  # button/alarm name in eWeLink application (close signal)

    Basement contact sensor L opened:  # button/alarm name in eWeLink application (open signal)
      name: Basement door contact sensor L  # optional, you can change sensor name
      device_class: door  # e.g. door, window
      timeout: 0  # disable auto close timeout
      payload_off: Basement contact sensor L closed  # button/alarm name in eWeLink application (close signal)

    Basement motion sensor:  # button/alarm name in eWeLink application
      device_class: motion
      timeout: 30  # optional (default 120), timeout in seconds for auto turn off

so added this to my configuration.yaml

sonoff: !include sonoff.yaml

then created sonoff.yaml in the same folder where configuration.yaml is and pasted the whole conde inside sonoff.yaml but does not work at all. Why? I removed the sonoff: line and moved the whole code 2 character backwards ALT+TAB

# Sonoff RF bridge settings
  rfbridge:
    Basement contact sensor S opened:  # button/alarm name in eWeLink application (open signal)
      name: Basement door contact sensor S  # optional, you can change sensor name
      device_class: door  # e.g. door, window
      timeout: 0  # disable auto close timeout
      payload_off: Basement contact sensor S closed  # button/alarm name in eWeLink application (close signal)

    Basement contact sensor L opened:  # button/alarm name in eWeLink application (open signal)
      name: Basement door contact sensor L  # optional, you can change sensor name
      device_class: door  # e.g. door, window
      timeout: 0  # disable auto close timeout
      payload_off: Basement contact sensor L closed  # button/alarm name in eWeLink application (close signal)

    Basement motion sensor:  # button/alarm name in eWeLink application
      device_class: motion
      timeout: 30  # optional (default 120), timeout in seconds for auto turn off

Isnt this the right way?

I even tried just leaving in the configuration.yaml this:

sonoff:

and then pasting the code info sensors.yaml that I know is linked properly as there are other multiple working sensors:

# Sonoff RF bridge settings
- platform: sonoff
  reload: always
  rfbridge:
    Basement contact sensor S opened:  # button/alarm name in eWeLink application (open signal)
      name: Basement door contact sensor S  # optional, you can change sensor name
      device_class: door  # e.g. door, window
      timeout: 0  # disable auto close timeout
      payload_off: Basement contact sensor S closed  # button/alarm name in eWeLink application (close signal)

    Basement contact sensor L opened:  # button/alarm name in eWeLink application (open signal)
      name: Basement door contact sensor L  # optional, you can change sensor name
      device_class: door  # e.g. door, window
      timeout: 0  # disable auto close timeout
      payload_off: Basement contact sensor L closed  # button/alarm name in eWeLink application (close signal)

    Basement motion sensor:  # button/alarm name in eWeLink application
      device_class: motion
      timeout: 30  # optional (default 120), timeout in seconds for auto turn off

If possible let me know how I can move this code from current working state at configuration.yaml TO:

  1. TO a brand new sonoff.yaml
  2. TO the existing sensors.yaml

thank you!!

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 106298

Trending Articles



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