Hi,
After few time working with HA, i saw that the configuration.yaml can turn very very very extensive, after adding differents sensors, switches, etc, so i decided to create just small configuration.yaml:
### Devices ###
sensor: !include sensors.yaml
#binary_sensor: !include binary_sensor.yaml
#light: !include light.yaml
cover: !include persianas.yaml
climate: !include climate.yaml
camera: !include camara.yaml
#alarm_control_panel: !include alarma.yaml
zone: !include zones.yaml
device_tracker: !include device_tracker.yaml
automation: !include automation.yaml
notify: !include notify.yaml
group: !include grupos.yaml
switch: !include switches.yaml
input_boolean: !include input_boolean.yaml
input_select: !include input_select.yaml
#scene: !include scenes.yaml
script: !include scripts.yaml
##media_player: !include media_player.yaml
weblink: !include weblinks.yaml
And then, i create a yaml file for each type, as you can see in image below.
For example, my switches.yaml file, have this:
- platform: mqtt
name: "Luz Lavadero"
state_topic: "/node1/gpio/13"
command_topic: "/node1/gpio/13"
payload_on: "0"
payload_off: "1"
optimistic: false
- platform: mqtt
name: "Luz Terraza"
state_topic: "/node1/gpio/15"
command_topic: "/node1/gpio/15"
payload_on: "0"
payload_off: "1"
optimistic: false
- platform: broadlink
view: yes
host: 192.168.1.142
mac: 11:22:33:44:55:EE
type: mp1-1
friendly_name: GW_Xiaomi
- platform: broadlink
view: yes
host: 192.168.1.142
mac: 11:22:33:44:55:EE
type: mp1-2
friendly_name: TV_Play
- platform: broadlink
view: yes
host: 192.168.1.142
mac: 11:22:33:44:55:EE
type: mp1-3
friendly_name: EzCast
- platform: broadlink
view: yes
host: 192.168.1.142
mac: 11:22:33:44:55:EE
type: mp1-4
friendly_name: Decoder_RU
- platform: broadlink
host: 192.168.1.141
mac: '11:22:33:44:55:FF'
timeout: 15
switches:
tv:
friendly_name: "TV"
command_on:
command_off:
decoder:
friendly_name: "DecoderTV"
command_on:
command_off:
airea:
friendly_name: "AireA"
command_on: ''
command_off: ''
# command_on: 'JgC+AF+AQCEeQSAeIx0/IiEdICAeIh4iITwgICAhPSIdIx0kHSIdIR0jHyEeIh4gHiIfIR4iHiAeIh4iHiIhPD8gX4BBIR1CHSEiHj4jHSEfIR8hHiIePyAgICBAHx4iHiIeIh8fHiIeIiEfHiAeIh4iHiIeIB4iHiMdIx1APiFegT8iH0AeICAgPyIeIB4iHyEeIh4/ICAgID8gHiIeIx0jGyMfIR0jHSQfHh0jHiIeIh4gHiIeIx8gHj9AIH0ADQUAAAAAAAAAAAAA'
# command_off: 'JgC+ACUnE4AZSB5BHjoFIT8iHmEdIx2AICAgIAwbFiIeIh45BiQdIB4iGTkLIx4gHjkGIx4iHiAcKxghHiIeQT0hSZY+gh4gIjYnIh4gHzUJIx4iHkAfICAgPTEQIR4iHioXHx4iHiIfIx0gHSMdKgQICiMdIR0jHyMcIh4/PyBfgD8iHEUcICAgQCEeIB4iHiMeIR4/ISEeIT4hHiMcIx0jHiEcIx4iHiIdIh0iHiIeJB4eHiIeJB0iHT8+JHsADQUAAAAAAAAAAAAA'
aspirador:
friendly_name: "Aspirador"
command_on: 'JgBIAAABIpMSExIRERQRExEUERMRNxITETgRExUzEhMROBEUEjUSExITEBQSNhMSERMRFBA5ExATNhE4EhMSNhI3ETgVDxI3EQANBQ=='
command_off: 'JgBIAAABIpMRExISEhMUEBAVEBQSNhITEzYQFBI2EhMSNxITETcRExE4ERQREhITEjcQFRAUERMRExI3ETgSNhITEDkQOBE4EgANBQ=='
Be careful, because in my file i have 2 broadlink devices RM Pro and MP1 plug socket
I have two noobie questions, the host ip os the ip i found in my dhcp router as rm pro?
The host IP, must be the address that you router give to the RM Pro. If you are using DHCP, then this IP address can change, and maybe the RM Pro doesn’t works. So you should put fix IP address (in you router maybe there is option to assign a IP to specific MAC address). To know the IP of your RM Pro, look if the device has the MAC address like : 34:EA:34:XX:XX:XX, because broadlink uses this beginning numbers.
another question can write on yaml until switches and try to call to learn my ir commands? Or do I Need to wirte everything so I can find broadlink as a device?
You don’t need to wait to have all. Once your RM Pro is added to HA, then you can read codes. Then read all ones, put it in the yaml file configuration, and then restart HA, to take effect all changes.
When you will have RM Pro in HA, then you can do this: