Dynamically create sensor based on current time?

HI,

Im am trying to readout my SolarEdge Panels via the Api with succes. Using a Serialnumber, Api-key and Site-id we can read-out many details.

see SolarEdge solar panels support for previous sensor creation using json_rest and rest api’s.

Unfortunately one can only read the full equipment setup below with data and full phase details, configured with a date-range with a max span of one week in the url. like:

https://monitoringapi.solaredge.com/equipment/[site-id]/[serial-number]/data?startTime=2018-01-28%2011:00:00&endTime=2018-01-28%2013:00:00&api_key=[api-key]

the above works fine in a browser, and gives the full telemetry ea. see https://www.solaredge.com/sites/default/files/se_monitoring_api.pdf page 34 for reference.

Of course we can’t create a sensor with the hard coded date-range like this, so i’m looking for a way to have that created automatically and dynamically based on the current timestamp. Or maybe with an input selector?

A great start would be to have the sensor created with the current day, and, based on that, the same day one year ago for reference.

Please have a look if this is at all possible?

Caveat: site-id, api-key and serial-number are stored in secrets.yaml, so the url has to read those…

Thanks!

Cheers,
Marius

1 Like