Giter VIP home page Giter VIP logo

Comments (9)

davidusb-geek avatar davidusb-geek commented on May 28, 2024

Could you please test if the following expression on your shell command throws a list and not a string?

{{ ((( state_attr('sensor.nordpool', 'raw_today') + state_attr('sensor.nordpool', 'raw_tomorrow')) |map(attribute='value')|list)[:48]) }}

from emhass.

overas avatar overas commented on May 28, 2024

The template editor says it is a list. Is this the correct way to test the expression?

image

Result type: list
[
  7.009,
  6.175,
  5.877,
  5.372,
  5.342,
  5.141,
  5.358,
  5.542,
  5.862,
  5.329,
  4.124,
  6.088,
  6.125,
  6.125,
  6.088,
  5.724,
  4.651,
  5.998,
  6.202,
  7.305,
  8.261,
  7.63,
  7.173,
  6.976,
  6.986,
  6.434,
  6.269,
  6.209,
  6.266,
  7.179,
  7.914,
  8.637,
  8.875,
  8.307,
  7.787,
  7.305,
  6.896,
  6.94,
  6.82,
  7.351,
  7.914,
  8.392,
  9.79,
  10.277,
  10.158,
  9.439,
  8.523,
  7.794
]
This template listens for the following state changed events:

Entity: sensor.nordpool

from emhass.

davidusb-geek avatar davidusb-geek commented on May 28, 2024

Ok, no that list looks fine, this should be working correctly. A quick check: are you refreshing the GUI web server after launching the optimization? You will need to refresh (F5) to update the results table.

from emhass.

overas avatar overas commented on May 28, 2024

Yes I have refreshed the webpage after triggering the service "Shell Command: load_cost_forecast". The page do not update the unit_load_cost using Chrome or with Firefox.

from emhass.

davidusb-geek avatar davidusb-geek commented on May 28, 2024

Hi, the problem persists after updating to the latest version?

from emhass.

overas avatar overas commented on May 28, 2024

Yes, the problem is the same with EMHASS add-on v0.2.20

from emhass.

overas avatar overas commented on May 28, 2024

I solved it! I found out I have done two errors.

The first was passing wrong amount of data in this list. Nordpool publish prices for every hour so the list must have 24 data points, not 48 points.
You need to be careful here to send the correct amount of data on this list, the correct length. For example, if the data time step is defined to 1h and you are performing a day-ahead optimization, then this list length should be of 24 data points.

The second was using template with errors. My template was wrong with the parenthesis and curly bracket. After fixing the template the shell_command worked and the passing of load_cost_forecast and prod_price_forecast was successful.

shell_command:
  publish_data: "curl -i -H 'Content-Type:application/json' -X POST -d '{}' http://localhost:5000/action/publish-data"
  
  post_nordpool_forecast: "curl -i -H 'Content-Type: application/json' -X POST -d '{\"load_cost_forecast\":{{(
        (state_attr('sensor.nordpool_euro', 'raw_tomorrow')|map(attribute='value')|list)[:24])
        }},\"prod_price_forecast\":{{(
        (state_attr('sensor.nordpool_euro', 'raw_tomorrow')|map(attribute='value')|list)[:24])}}}' http://localhost:5000/action/dayahead-optim"

Question:
1)

Load cost forecast: the price of the energy from the grid on the next 24h. This is given in EUR/kWh.
PV production selling price forecast: at what price are you selling your excess PV production on the next 24h. This is given in EUR/kWh.

Can I use NOK (norwegian) as price instead of Euro?

from emhass.

overas avatar overas commented on May 28, 2024

image

from emhass.

davidusb-geek avatar davidusb-geek commented on May 28, 2024

Ok perfect!
I'm glad that you find the problem.
Yes of course you can use whatever currency you want as long as you use the same currency everywhere, no problem at all.

from emhass.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.