식물 관리(Plant Monitor)


plant 구성 요소를 사용하면 식물의 수분, 전도도, 광도, 온도 및 배터리 수준을 단일 UI 요소로 병합할 수 있습니다. 또한 각 측정에 대한 최소값과 최대 값 설정을 지원하며 해당 한계 내에 있지 않은 경우 상태를 “problem”로 변경합니다.

설정

plant 센서를 사용하려면 configuration.yaml 파일에 다음을 추가하십시오.

# Example configuration.yaml entry
plant:
  name_of_your_plant:
    sensors:
      moisture: sensor.my_sensor_moisture
      battery: sensor.my_sensor_battery
      temperature: sensor.my_sensor_temperature
      conductivity: sensor.my_sensor_conductivity
      brightness: sensor.my_sensor_brightness
    min_moisture: 20

Configuration Variables

entity_id

(list)(Required)

Set by you and is used by the integration as the entity_id.

sensors

(list)(Required)

List of sensor measure entities.

moisture

(string)(Optional)

Moisture of the plant. Measured in %. Can have a min and max value set optionally.

battery

(string)(Optional)

Battery level of the plant sensor. Measured in %. Can only have a min level set optionally.

temperature

(string)(Optional)

Temperature of the plant. Measured in degrees Celsius. Can have a min and max value set optionally.

conductivity

(string)(Optional)

Conductivity of the plant. Measured in µS/cm. Can have a min and max value set optionally.

brightness

(string)(Optional)

Light exposure of the plant. Measured in Lux. Can have a min and max value set optionally.

min_moisture

(integer)(Optional)

Minimum moisture level before triggering a problem.

Default value:

20

max_moisture

(integer)(Optional)

Maximum moisture level before triggering a problem.

Default value:

60

min_battery

(integer)(Optional)

Minimum battery level before triggering a problem.

Default value:

20

min_conductivity

(integer)(Optional)

Minimum conductivity level before triggering a problem.

Default value:

500

max_conductivity

(integer)(Optional)

Maximum conductivity level before triggering a problem.

Default value:

3000

min_temperature

(float)(Optional)

Minimum temperature before triggering a problem.

max_temperature

(float)(Optional)

Maximum temperature before triggering a problem.

min_brightness

(integer)(Optional)

Minimum brightness before triggering a problem. In contrast to the other values, this check is not looking at the current situation, but rather at the last days. A problem is only reported if the maximum brightness over the last days was lower than min_brightness. You can use this to check if the plant gets enough light during the course of the day.

max_brightness

(integer)(Optional)

Maximum brightness before triggering a problem.

check_days

(integer)(Optional)

time interval (in days) used when checking min_brightness.

Default value:

3

사례

일반 MQTT 센서를 사용하여 데이터 가져 오기

이는 plant 센서가 사용하는 판독값을 제공하기 위해 다수의 MQTT sensors를 사용하는 실제 예입니다. 이 데이터의 또 다른 좋은 소스는 Mi Flora 구성 요소입니다.

센서 데이터가 최소/최대값 내에있는 경우 상태는 ok이며, 그렇지 않으면 상태는 problem입니다. plant에 문제가있는 경우 이를 사용하여 알림을 트리거 할 수 있습니다. 물론 센서가 설정되고 데이터를 제공하는 시스템의 속성만 모니터링 할 수 있습니다.

데이터 소스

데이터의 주요 소스는 일반적으로 PlantGateway에서 데이터를 수신하는 MiFlora sensor 또는 MQTT sensor입니다.

PlantGateway를 통해 데이터를 얻기위한 MQTT 센서의 일반적인 설정입니다.

# Example configuration.yaml entry
plant:
  simulated_plant:
    sensors:
      moisture: sensor.mqtt_plant_moisture
      battery: sensor.mqtt_plant_battery
      temperature: sensor.mqtt_plant_temperature
      conductivity: sensor.mqtt_plant_conductivity
      brightness: sensor.mqtt_plant_brightness
    min_moisture: 20
    max_moisture: 60
    min_battery: 17
    min_conductivity: 500
    min_temperature: 15

sensor:
  - platform: mqtt
    name: my_plant_moisture
    state_topic: my_plant_topic
    value_template: '{{ value_json.moisture | int }}'
    unit_of_measurement: '%'
  - platform: mqtt
    name: my_plant_battery
    state_topic: my_plant_topic
    value_template: '{{ value_json.battery | int }}'
    unit_of_measurement: '%'
  - platform: mqtt
    name: my_plant_temperature
    state_topic: my_plant_topic
    value_template: '{{ value_json.temperature | float }}'
    unit_of_measurement: '°C'
  - platform: mqtt
    name: my_plant_conductivity
    state_topic: my_plant_topic
    value_template: '{{ value_json.conductivity | int }}'
    unit_of_measurement: 'µS/cm'
  - platform: mqtt
    name: my_plant_brightness
    state_topic: my_plant_topic
    value_template: '{{ value_json.brightness | int }}'
    unit_of_measurement: 'Lux'

state_topic을 PlantGateway에서 설정한 값으로 바꿔야합니다. 또한 MQTT 서버의 글로벌 설정에 따라 다릅니다.