Server

We need to configure the yaml file so we can add our sensors and also modify the view of our web page. Open a terminal an execute

$ nano ~/.homeassistant

Then paste the next code

homeassistant:
  # Name of the location where Home Assistant is running
  name: Home
  # Location required to calculate the time the sun rises and sets
  latitude: 22.65
  longitude: -103
  # Impacts weather/sunrise data (altitude above sea level in meters)
  elevation: 0
  # metric for Metric, imperial for Imperial
  unit_system: metric
  # Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zo$
  time_zone: America/Mexico_City

  customize:

  #House

    sensor.house_temperature:
      friendly_name: Temperature
      icon: mdi:temperature-celsius
    sensor.house_pressure:
      friendly_name: Pressure
      icon: mdi:weather-windy
    sensor.house_humidity:
      friendly_name: Humidity
      icon: mdi:water
    binary_sensor.doorbell:
      frindly_name: Doorbell
      icon: mdi:door

# Show links to resources in log and frontend
#introduction:

# Enables the frontend
frontend:

# Enables configuration UI
config:


http:
  # Uncomment this to add a password (recommended!)
  # api_password: PASSWORD
  # Uncomment this if you are using SSL or running in Docker etc
  # base_url: example.duckdns.org:8123
  server_port: 8123

history:

mqtt:
  broker: broker.hivemq.com
  port: 1883
  client_id: RBTautomation
  keepalive: 60

sensor:
  - platform: mqtt
    name: house temperature
    state_topic: "XDK/RFT/temperature/status"
    sensor_class: heat
  - platform: mqtt
    name: house pressure
    state_topic: "XDK/RFT/pressure/status"
  - platform: mqtt
    name: house humidity
    state_topic: "XDK/RFT/humidity/status"

binary_sensor:
  - platform: mqtt
    name: doorbell
    state_topic: "XDK/RFT/switch"
    payload_on: "1"
    payload_off: "0"

group:

  default_view:
    view: yes
    entities:
      - group.house

  house:
    name: House
    entities:
      - sensor.house_temperature
      - sensor.house_pressure
      - sensor.house_humidity
      - binary_sensor.doorbell

What we are doing here is defining the sensor and which topic they are subscribe so they could print the data.

You can modify the icon of each item with the tag icon:

You can use this material designs icos to personalized

https://cdn.materialdesignicons.com/2.3.54/

Here you can also find which type of sensor you are going to use: light, movement, etc.

https://www.home-assistant.io/components/binary_sensor/

Last updated

Was this helpful?