Show alert if values don't match

I’m monitoring my IP address at my gateway and with my dynamic dns address as two entities. Is there a card that I can use to only show the card when the values do not match? I don’t want to setup an automation to alert me, tried that before and it’s too noisy. I’d rather just see that there is a difference and see why it didn’t update properly.

A markdown card with a template that says matching or not matching?

I didn’t think you can you do an entities card with a sub markdown card. Or is there a template that I can use to pull in the values of sensors?

If you use markdown you just use templates to make the card say whatever you want.

If you don’t want to do it that way and have a sensor entity showing your up address you could use Conditional card. If condition=true show card, false - do not show card.

If I figure out how to do either markdown or conditional card I’d do it. The conditional card I looked at but the sensor doesn’t have a state that I can require for it. I also tried using as a

type: conditional
conditions: 
  - entity:  freebsd_router_external_ip
    state: homeassistant_dns_lookup
...

… but that’s not a valid state.

I also tried adding | string around it as a value_template but that didn’t work either.

Edit: Sorry I missed the sensor. in front of those two entries when I recreated it here. I did have them in my “attempt”.

What are the two entities you are comparing?

sensor.freebsd_router_external_ip
sensor.homeassistant_dns_lookup

Just in case someone else runs across this, this was the solution:

Both @nickrout and @NathanCu were right, Nathan’s answer came closest to the final card.

type: conditional
conditions:
  - entity: sensor.freebsd_router_external_ip
    state: ''
card:
  type: markdown
  content: |-
    {% set iip = states('sensor.freebsd_router_external_ip') %}
    {% set eip = states('sensor.homeassistant_dns_lookup') %}

    {% if iip != eip -%}
      IP mismatch  {{ states('sensor.freebsd_router_external_ip') }} != {{ states('sensor.homeassistant_dns_lookup') }}
    {%- endif %}
1 Like