add_sensor( sensor_name, object_name, rate, states )

Paras:

  • sensor_name: str, the name of new sensor
  • object_name: str, the name of the object sensor should watch
  • rate: float between 0 and 1, the success rate sensor should has
  • state: array, a list of physical conditions the sensor is watching

Return:

New sensor instance

sensor1 = myhome.add_sensor('c1_p_sensor', 'chair1', rate=0.8, states=['pressure'])