Format a value from date to epoch in MSR
-
I have an entity under HAAS pushing solar predictions. Two fields are date-based and are read as-is from the sensor. I've searched for a way to convert a date to epoch, but it seems to be missing.
Here's the output:
{ 'now': '0', 'hour': '0.0', 'nexthour': '0.0', 'today': '10.223', 'tomorrow': '34.254', 'peaktime': '2021-12-17T10:00:00+00:00', 'peaktimetomorrow': '2021-12-18T10:00:00+00:00' }
Is a datetime as string to epoch function missing under expression? Thanks!
-
I have an entity under HAAS pushing solar predictions. Two fields are date-based and are read as-is from the sensor. I've searched for a way to convert a date to epoch, but it seems to be missing.
Here's the output:
{ 'now': '0', 'hour': '0.0', 'nexthour': '0.0', 'today': '10.223', 'tomorrow': '34.254', 'peaktime': '2021-12-17T10:00:00+00:00', 'peaktimetomorrow': '2021-12-18T10:00:00+00:00' }
Is a datetime as string to epoch function missing under expression? Thanks!
@therealdb you should be able to just pass those into
time()
: -
Thanks @toggledbits
Maybe a small note on the docs could prevent a future me from asking the same question. -
Already done!
-
T toggledbits locked this topic on