Threasholds to command devices with rules on global variables

Issue #21 resolved
David Karlsson repo owner created an issue

Possibility to configure a Threashold value When a global variable transition over this value it should be configurable to make a device command. (one for transission up and another for transission down).

Comments (2)

  1. Geir Gullestad Pettersen

    This is a good idea.

    I think it could also be very useful to support more than just thresholds such as boolean (true/false) and string matching. Also, supporting multiple conditions on global values would be great.

    Psuedo config example:

    Rule: "Turn on heating in bedroom when below desired temperature" conditions (logical and): * $bedrom_temperature_actual < $bedroom_temperature_target - 0.5" * $house_status != "vacation" action: device command (heater on)

    Rule: "Turn off heating in bedroom when above desired temperature" conditions (logical and): * $bedrom_temperature_actual > $bedroom_temperature_target + 0.5" * $house_status != "vacation" action: device command (heater off)

    The +/- 0.5 is to avoid a rapid sequence of on/offs as some temperature sensor I've tested tend to bounce up and down 0.1degrees when temperature is dropping/falling at a slow pace. For other inputs it may not be necessary, so that could be optional.

  2. Log in to comment