How to retrieve ENTSOE electrical consumption of France?

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

willemd
Posts: 631
Joined: Saturday 21 September 2019 17:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.1
Location: The Netherlands
Contact:

Re: How to retrieve ENTSOE electrical consumption of France?

Post by willemd »

I just remembered where I have another script with variable number of data points.
I use this:

Code: Select all

    				    local response=item.json.result
				        for datehour,value in pairs(response) do
				            domoticz.log("solar forecast date "..domoticz.utils.stringSplit(datehour)[1].." hour "..domoticz.utils.stringSplit(domoticz.utils.stringSplit(datehour)[2],":")[1].." value "..value,domoticz.LOG_INFO)
				            local previousHour=domoticz.utils.stringSplit(domoticz.utils.stringSplit(datehour)[2],":")[1]-1
				            if previousHour<10 then 
				                previousHour="0"..tostring(previousHour)
				            else
				                previousHour=tostring(previousHour)
				            end    
				            domoticz.log("previousHour "..previousHour)    
				            if value>0 then
				                sensorDateHour=domoticz.utils.stringSplit(datehour)[1].." "..domoticz.utils.stringSplit(domoticz.utils.stringSplit(datehour)[2],":")[1]..":00:00"
				                sValueStr="0;"..value
				                domoticz.log("sensorDateHour "..sensorDateHour.." sValueStr "..sValueStr,domoticz.LOG_INFO)
				                domoticz.devices(idxSolarForecastCounter).updateHistory(sensorDateHour,sValueStr)
				                if sensorDateHour==currentHR then
				                    domoticz.devices(idxSolarForecastCounter).updateCounter(value)
				                end    
				            end    
				        end
Wilop91
Posts: 44
Joined: Tuesday 05 March 2024 17:14
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: France
Contact:

Re: How to retrieve ENTSOE electrical consumption of France?

Post by Wilop91 »

Hello willemd
Thanks for you reply.
I will have a look into later - for the time being I'm trying to adapt your script to retrieve the data for 2 or 3 production types for which I'm sure there are 24 values. This will take some time because of my limited skills....
Btw I have some very basic questions:
- I understand for each production type I need to create a "device". But do I need to create also a "hardware"?
- If I have 3 devices (representing 3 production types) how to I display them in a single log (i.e. with 3 curves)?

In advance thanks a lot for you valuable help.

BR

Willy
willemd
Posts: 631
Joined: Saturday 21 September 2019 17:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.1
Location: The Netherlands
Contact:

Re: How to retrieve ENTSOE electrical consumption of France?

Post by willemd »

You can use either an existing or create a new hardware setup of the type "dummy (does Nothing, used for virtual switches only)." and then create your devices linked to that hardware.

To display 3 devices in one graph you will have to use dashticz.
Wilop91
Posts: 44
Joined: Tuesday 05 March 2024 17:14
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: France
Contact:

Re: How to retrieve ENTSOE electrical consumption of France?

Post by Wilop91 »

Hello willemd
Thanks for your reply

I could create the devices for each production type creating a hardware as "dummy" and each device as "counter"

But in your script you have also a device called idxCurrentHourIndicator.

How did you create this device?

PS: for the time being I want to run the script which only gets the XML data (i.e. processing of the responseKey is empty)

BR

Willy
Last edited by Wilop91 on Sunday 10 March 2024 10:31, edited 1 time in total.
Jan Jansen
Posts: 229
Joined: Wednesday 30 April 2014 20:27
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: The Netherlands
Contact:

Re: How to retrieve ENTSOE electrical consumption of France?

Post by Jan Jansen »

willemd wrote: Wednesday 06 March 2024 10:58 Here is my latest dzvents script to load the prices onto a managed counter for later display in domoticz and dashticz.
@willemd,

Thanks for sharing the script I was looking for! However, I am amazed at the script's output. I created a user variable VAT (integer 21) and a user variable energy tax (string 13.2).
Output.png
Output.png (24.34 KiB) Viewed 342 times
I know the option to set a divisor. But I don't understand the result of the 2 counters on the right?

Thanks in advance.
willemd
Posts: 631
Joined: Saturday 21 September 2019 17:55
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.1
Location: The Netherlands
Contact:

Re: How to retrieve ENTSOE electrical consumption of France?

Post by willemd »

You need to adapt the counter divider on the managed counter to 100000.

The first counter is excluding tax (red line below), the second is including tax(blue line below). Both show the full list of available prices.

The third counter only shows the tariff of the current hour and is used as a sort of arrow in a dashtic graph to highlight the current hour, see the yellow line below in the graph.

Here is also the graph definition

Code: Select all

blocks['graph_ElPrice'] = {
    title: 'Dynamic El Price',
    width:12,
    height: '260px',
    graph: 'line',
    steppedLine: ['before','before','before'],
    buttonsText: ['last hours','today',''],
    devices: [177,179,184],
    beginAtZero: true,
    customHeader: 'devices[184].Data+" incl taxes"',
    range: 'today',
    legend: false
}
Attachments
Screenshot 2024-03-08 192406.png
Screenshot 2024-03-08 192406.png (188.11 KiB) Viewed 330 times
Wilop91
Posts: 44
Joined: Tuesday 05 March 2024 17:14
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.4
Location: France
Contact:

Re: How to retrieve ENTSOE electrical consumption of France?

Post by Wilop91 »

I could complete my script after having solved a Domoticz crash:
https://www.domoticz.com/forum/viewtopic.php?t=42176
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest