Notes to Self

Alex Sokolsky's Notes on Computers and Programming

Home Assistant - MQTT Integration

Discussion: https://community.home-assistant.io/t/pulling-hardware-sensor-data-from-linux-servers-and-posting-them-to-mqtt/54808

Add integration to it.

More about running MQTT.

Adding Device to Home Assistant

I use psmqtt to post metrics from my (local) server (suprox) to the local MQTT broker.

Manual Integration

MQTT Sensor:

From my configuration.yaml:

mqtt:
  sensor:
    - state_topic: "psmqtt/suprox/cpu_percent"
      unit_of_measurement: '%'
      state_class: "measurement"
      name: "CPU activity"
      icon: "mdi:gauge"
      unique_id: "suprox_cpu_activity"
    - state_topic: "psmqtt/suprox/virtual_memory/percent"
      unit_of_measurement: '%'
      state_class: "measurement"
      icon: "mdi:gauge"
      name: "Memory use"
      unique_id: "suprox_memory_use"
    - state_topic: "psmqtt/suprox/sensors_temperatures/coretemp/0/"
      unit_of_measurement: '°C'
      device_class: "temperature"
      state_class: "measurement"
      name: "CPU temperature"
      unique_id: "suprox_cpu_temperature"

TODO: MQTT Discovery

https://www.hwinfo.com/forum/threads/hwinfo-integration-into-home-assistant-via-mqtt.8302/

TODO: MQTT Device Discovery: