Alert on pump current

I have succesfully set up a Sonoff POW to monitor the current being drawn by a pump. Took nearly a day but I got there!

- platform: mqtt
  name: "Main Pump Current"
  state_topic: "tele/Sonoff_POW/SENSOR"
  value_template: "{{value_json['ENERGY'].Current }}"
  qos: 1
  unit_of_measurement: "amps"

What I need to be able to do now is generate an alert using Prowl (which I’ve used elsewhere), to alert me when the current rises above a certain level.

I’m a bit stuck as to how to do this and would appreciate any pointers as to the right direction.

This is the automation I use for my sump pump:

- alias: 'Pump Notification'
  trigger:
    platform: numeric_state
    entity_id: sensor.tp_link1_cwatts
    above: 100
  action:
    service: notify.mypushbullet
    data_template:
      title: "Home Assistant says:"
      message: '{{now().strftime("%H:%M")}}h: Sump pump started - {{ states.sensor.tp_link1_cwatts.state }} W'

I use that wattage value, not the current and a different notification platform, but I hope it helps.

Thank you!

That helps.

How do I relate your “sensor.tp_link1_cwatts” to what I have?

Is it as simple as sensor.Sonoff_POW.Current?

Is there a way to test it without actually having the current go over the limit?

How does your sensor show up in the /dev-state window?

It will only have one ‘.’ in the name.
The domain is ‘sensor’ and the sensor name is probably something like ‘main_pump_current’ - be careful with the spelling, i.e. capitals vs. lower case.

Re. testing, I’m not sure if you can just set the value for the sensor in the /dev-service tab to something that’s above your trigger value.

I’ve played around with a few things and still aren’t getting there.

I think what I need to do is find a way to have

  state_topic: "tele/Sonoff_POW/SENSOR"
  value_template: "{{value_json['ENERGY'].Current }}"

be recognised as an entity so that I can then act on it’s value.

Does that sound right?

If so, how is this done?

For testing, it can be triggered from the /dev-/state window like this:

This should trigger the automation, i.e. the notification.

With MQTT details, I’m out of my depth, though.
I wanted to look at it in more detail but haven’t managed to do so yet :frowning:

Don’t MQTT entities not just show up like ‘normal’ sensors?
If not, then somebody with more MQTT experience needs to jump in.

Brilliant!

That was all the help I needed. Thank you so much.

One last thing.

Above is above:
Below is below:

What is equal to?

Not really sure about equal - I’d probably define a range anyway, e.g.

above: 98
below: 102

Would you mind sharing your config once you’re done so that I have a working example whenI get around tackling MQTT?

And, in terms of testing the automation for the MQTT setup, I think you should be using something like this from the /dev-mqtt tab:
image

But you probably found that already.

Here’s what I now have:

- alias: 'Main Pump Blocked Notification'
  trigger:
    platform: numeric_state
    entity_id: sensor.main_pump_current
    above: 0.130
  action:
  - service: notify.prowl
    data_template:
     title: "Main Pump"
     message: "Current is high - possibly blocked"

- alias: 'Main Pump Stopped'
  trigger:
    platform: numeric_state
    entity_id: sensor.main_pump_current
    below: 0.130
  action:
  - service: notify.prowl
    data_template:
     title: "Main Pump"
     message: "Main pump is stopped"

It may require some fine tuning of the values and I may well use power instead of current when I’ve tested it.

1 Like

Any thoughts on this?

I’m using the POW R2 to monitor current and power of a series of pumps. The pumps are controlled by a PLC via contactor and the POWs are set to PowerOnState 4 so that they remain on, independent of Hassio.

However, the POWs receive their power from the pump controller contactor. If the pump is turned off the POWs disconnect from WiFi, obviously.

I need to find a way to hack them so that the WiFi stays alive.

Anyone have any experience of this?