Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potentially useful HA template #19

Open
sjwright opened this issue Jan 19, 2021 · 3 comments
Open

Potentially useful HA template #19

sjwright opened this issue Jan 19, 2021 · 3 comments

Comments

@sjwright
Copy link

Thanks for a great plug-in.

Here is a simple sensor template that has been very practical for me. I publish this sensor in lovelace as a gauge to see at a glance if it's a suitable time to be starting the dishwasher, laundry etc. I can also imagine many ways where I could use this in automations. For example I could send notification to my phone if the forecast will be going high while the air conditioner is running.

sensor:
  - platform: amberelectric
    postcode: "2000"
    
  - platform: template
    sensors:
      amber_peak_predicted_2h:
        friendly_name: "Amber 2 hour peak predicted"
        unit_of_measurement: "c/kWh"
        value_template: >-
          {% set forecast = states.sensor.amber_general_usage_price.attributes['price_forcecast'] %}
          {% set highest = forecast[0:4] | sort(reverse=true, attribute='price') | first() %}
          {{highest['price']}}
      amber_peak_predicted_4h:
        friendly_name: "Amber 4 hour peak predicted"
        unit_of_measurement: "c/kWh"
        value_template: >-
          {% set forecast = states.sensor.amber_general_usage_price.attributes['price_forcecast'] %}
          {% set highest = forecast[0:8] | sort(reverse=true, attribute='price') | first() %}
          {{highest['price']}}
@CRCinAU
Copy link

CRCinAU commented Mar 6, 2021

This works quite well, thanks :)

@bengAThome
Copy link

Great work. Thanks for sharing.

@davewatson91
Copy link

@sjwright

I've created a fork which I hope to be able to maintain (also noting there are breaking changes next release which need to be fixed, and this repo hasn't moved since last year).

I've added your template onto the doco on my fork :)

davewatson91/hass-amber-electric

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants