Goobie
Expert Member
You could get hold of a mercury switch and glue it inside a small plastic bottle. This can hang in your tank, and when it reaches the required level, it will go sideways, activating the switch.
Connect this to Pin 4 (Ground) and Pin 5 (GPIO14).
Configure the Sonoff-Tasmota basic unit as attached:
View attachment 577886
It is now a simple matter to set it up in Home Assistant.
YAML:#In my sensors.yaml file, I added: # MQTT binary sensors - platform: mqtt name: Pool Alarm state_topic: "cmnd/poolfence/POWER2" payload_on: “ON” payload_off: “OFF” #switch on alarm if switch2 (GPIO14) is toggled. - id: pool_alarm_triggered alias: Pool Alarm Triggered trigger: platform: state entity_id: sensor.pool_alarm to: 'ON' condition: - condition: state entity_id: input_boolean.pool_alarm_active state: 'on' action: entity_id: switch.pool_siren service: switch.turn_on #switch off alarm and reset Switch2 state. - id: pool_alarm_reset alias: Pool Alarm Reset trigger: platform: state entity_id: sensor.pool_alarm to: 'ON' for: minutes: 10 action: - service: switch.turn_off entity_id: switch.pool_siren - service: mqtt.publish data: topic: 'cmnd/poolfence/POWER2' payload: 'OFF' retain: 'true'
Thanks for this. I will have to investigate this further