Comments (9)
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.
The template editor says it is a list. Is this the correct way to test the expression?
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.
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.
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.
Hi, the problem persists after updating to the latest version?
from emhass.
Yes, the problem is the same with EMHASS add-on v0.2.20
from emhass.
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.
from emhass.
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)
- logging significantly reduced with 0.4.0 HOT 3
- Solar.Forecast service gives error HOT 1
- SSL Error SSLCertVerificationError HOT 1
- How to create a deferrable load sensor HOT 2
- Feature Request: Color for PV HOT 2
- Feature Request: smooth allocation of power to continuous loads HOT 6
- Feature Request: Some questions HOT 8
- Feature Request: Build in some priority HOT 1
- UnicodeDecodeError HOT 4
- prod_cost not updated.
- prod/load_cost unit_of_measurement €/kWh & $/kWh HOT 3
- Feature Request: unit_prod_price & unit_load_cost forecasts HOT 14
- Feature Request: Pass an array of hourly load_peak_hours costs instead of a constant value ( ex. prices from Tibber) HOT 2
- Solar forcast is broken HOT 3
- Feature request: Grid availability HOT 1
- 'last_window' has missing values error after HASS restart HOT 3
- Add single configuration to prefix all published sensors HOT 8
- When using the custom names there are no attributes is the sensors HOT 2
- Feature request - pass current battery SOC to dayahead-optim to improve optimization HOT 4
- Feature Request: First power deferrable loads from battery then discharge to grid. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from emhass.