Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95295

Help with triggers based on sensor state

$
0
0

@Peter_West wrote:

Hi,

I’m using the ILO integration to monitor key components of an HP Server i’m running. I’ve made a number of sensors using the template functionality, and example of which looks like this.

      # Storage Status
      - name: storage_status
        sensor_type: server_health
        value_template: "{{ ilo_data.health_at_a_glance['storage']['status'] }}"

I had initially attempted to get the notification to fire if the sensor reported any value other than ‘OK’, but I couldn’t get that working. I then tried creating an automation based on the state changing specifically from OK to Degraded but that also failed to work. The code i’m using is below.

  - alias: "PushOver Notification: HP ILO Storage Issue"
    trigger:
      - platform: state
        entity_id: sensor.hp_ilo_storage_status
        to: 'Degraded'
      - platform: state
        entity_id: sensor.hp_ilo_storage_status
        from: 'OK'
    action:
      - service: notify.pushover
        data:
          message: "HP Server Fault"
          title: "The HP Server located at home has raised an alert regarding it's in-built Storage."
          data:
            url: "https://www.home-assistant.io/"
            sound: pianobar
            priority: 0

However, it seems this also fails to trigger. Is anyone able to help me with this please?

Posts: 7

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 95295

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>