Plantgateway and Home Assistant

Hi, I got it working. Here are the steps to reproduce it:

You don’t need the component Plant Monitor. That is totally optional to change the look of your sensor in the UI.

1.You need a MQTT Server (Broker). I installed one in Docker from toke/mosquitto because the Home Assistant Broker did not work for me.
2.After that configure Home Assistant to connect to your broker:

mqtt:
  broker: your-mqtt-broker-ip

3.Configure a Home Assistant sensor for each value of your MiFlora sensor
sensor:

  - platform: mqtt
    name: plant_3_moisture
    state_topic: /home/pizero_1/plant_3/
    value_template: '{{ value_json.moisture }}'
    unit_of_measurement: '%'
  - platform: mqtt
    name: plant_3_battery
    state_topic: /home/pizero_1/plant_3/
    value_template: '{{ value_json.battery }}'
  - platform: mqtt
    name: plant_3_temperature
    state_topic: /home/pizero_1/plant_3/
    value_template: '{{ value_json.temperature }}'
    unit_of_measurement: '°C'
  - platform: mqtt
    name: plant_3_conductivity
    state_topic: /home/pizero_1/plant_3/
    value_template: '{{ value_json.conductivity }}'
    unit_of_measurement: 'μS/cm'
  - platform: mqtt
    name: plant_3_brightness
    state_topic: /home/pizero_1/plant_3/
    value_template: '{{ value_json.brightness }}'
    unit_of_measurement: 'lux'

4.Restart Home Assistant
5.Install plantgateway on your Pi Zero W according to the instructions here: https://github.com/ChristianKuehnel/plantgateway
6.Configure plantgateway. Example:

mqtt:
    server: your-mqtt-broker-ip
    prefix: /home/pizero_1
    port: 1883
    client_id: Plant Gateway
sensors:
    - mac: your-miflora-mac-adress
      alias: plant_3
      fail_silent:
logfile: /home/plantgw.log
debug:

7.Execute plantgateway

The sensor values should show up on your Home Assistant Home tab.

You can use a mqtt client on your computer and connect to your broker to check if new messages are correctly published.
When everything works, you should secure your mqtt broker.

Now you can group your sensors in Home Assistant or use the Plant Monitor Component.
Example for grouping without Plant Monitor Component:

palme

5 Likes