I really like the new Enever plugin, it works great.
But it would be great if this data could be used to :
- Send a telegram message when new prices are retrieved, in a neat format
- Each value would be put in a variable (or lowest x values), so devices can use this to make an on/off planning
the current format of the variable in domoticz is like (string) :
{"status":"true","data":[{"datum":"2023-08-25 00:00:00","prijs":"0.105240","prijsAA":"0.300989","prijsAIP":"0.310038","prijsANWB":"0.300969","prijsEE":"0.310648","prijsEVO":"0.300969","prijsEZ":"0.300969","prijsFR":"0.305188","prijsGSL":"0.300969","prijsMDE":"0.300969","prijsNE":"0.301879","prijsTI":"0.301568","prijsVDB":"0.301665","prijsVON":"0.299753","prijsWE":"0.305189","prijsZG":"0.300969","prijsZP":"0.299788"} ...........
This is way above my knowlegde to achieve this, if someone could help me start to write some dzvents code to read each value into a variable that would be great.
The following code is a great start to know when the variable is updated.
So let's say we use "prijsTI" as supplier and we need those hourly values.
Code: Select all
return {
on = {
variables = {
'Enever_Electricity_15',
},
},
logging = {
level = domoticz.LOG_INFO,
marker = 'Triggers when variable is updated',
},
execute = function(domoticz, variable)
domoticz.log('Variable ' .. variable.name .. ' was changed', domoticz.LOG_INFO)
domoticz.log(domoticz.variables('Enever_Electricity_15').value,domoticz.LOG_INFO)
end
}