Skip to content

Instantly share code, notes, and snippets.

@Danielhiversen
Last active September 10, 2022 07:36
Show Gist options
  • Save Danielhiversen/7b51b9c8ce50334fc61e14e4850680b1 to your computer and use it in GitHub Desktop.
Save Danielhiversen/7b51b9c8ce50334fc61e14e4850680b1 to your computer and use it in GitHub Desktop.
This automation blueprint sends a notification on high energy price.
blueprint:
name: High electricity price
description: 'This automation blueprint sends a notification on high energy price.'
domain: automation
input:
energy_sensor:
name: Tibber price sensor
selector:
entity:
integration: tibber
domain: sensor
default: ''
notify_device:
name: Device to notify
description: Device needs to run the official Home Assistant app to receive
notifications
selector:
device:
integration: mobile_app
mode: single
max_exceeded: silent
variables:
energy_sensor: !input 'energy_sensor'
energy_sensor_state: '{{ float(states[energy_sensor].state)}}'
energy_sensor_max: '{{ float(states[energy_sensor].attributes[''max_price''])}}'
trigger:
platform: state
entity_id: !input 'energy_sensor'
condition:
condition: template
value_template: '{{energy_sensor_state > 0.9 * energy_sensor_max}}'
action:
- device_id: !input notify_device
domain: mobile_app
type: notify
title: Electricity price
message: The electricity price is now {{energy_sensor_state}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment