Retrieving of EDF electricity pricing information using eedomus
The following php script is based on work done by Djmomo which is available through the links below. Djmomo propose a script that have to be installed on a personnal server or a NAS.
For several months, eedomus controller can run php scripts. The entire list of php librairies is not installed on eedomus, meaning that Djmomo scripts can’t be run directly on eedomus. I then propose an adapted version of it which is compatible with eedomus.
The php script
This script can be downloaded here.
To install it please refer to eedomus documentation.
When installed, here is data feedback given when calling the script :
Creating virtual sensors
We have now to retrieve the values contained into xml and store them in virtual sensors, called “http sensors”. Those sensors will be available for display and to trigger rules. For each interesting value into xml, we have to create one http sensor. To add this sensor, use option “Add or remove a peripheral” into configuration page.
Select “Add another type of sensor”, this one being an HTTP sensor with this icon :
Here are the parameters to be set in one of those sensors for edf tempo option :
The “Xpath” can have those values :
- Firstly, for ejp option which depends on location :
- then for tempo option :
The numerical type sensors ( example : …/jours_restants) will have to have type equal to “Decimal number”. For the other values, you must define all accepted values in the list of values associated to the sensor. Here are the values corresponding to /ejp_tempo/tempo/aujourdhui xpath :
Update of http sensor
It’s possible to setup a delay between updates for each sensor. Proposed php script is using quite a big amount of resources from eedomus, computing is taking several seconds. It’s then not possible to update all sensors too quickly, we shoud set long refresh time, or no automatic update.
Sensor update can be triggered by a rule at the best period of time. In this case, we know that values are changing after 5PM and after midnight, and we want to be sure to have updated values at lunch. A rule will then trigger the updates at selected period.
It’s now possible to have electricity pricing conditions for edf ejp or tempo options available on our smarthome controller, without investment in some hardware. A personal server is not necessary although, the script being launched by eedomus. Be careful however, this script is analysing a web page on EDF website and retrieves values from there. This is an heavy task, then using a personnal server is still the prefered solution if one is available.