hmm, not sure to be honest. I am used to the data my Solar system provides me, and have that ‘last year’ value. Guess it wouldn’t be too difficult to publish that at 12-31 midnight, and keep it for eternity by recording that sensor in Recorder.
If you require the specific api call for the command_line sensor, you can always ask the main dev at Iungo to assist. Rodney is very helpful in that regard.
You might also have a look at the utility meter integration that can make yearly sensors for you
still, don’t you have these sensors in your system? Depending on your manufacturer, there are several nice integrations in HA, mine is Solaredge, and I dropped the Api calls to the SE server altogether in favor of the integration.
Ping me, or open a dedicated topic for the mqtt publish of the sensor, and I can help you out with the scripts I use for recording the daystart values. (to keep this thread here on-topic)
as for the timestamp, you could try something like {{as_timestamp('2022-12-31 23:59:59')}}
in de tools template editor, and enter that into the command_line?
see what that does:
{{as_timestamp(now())}}
{{as_timestamp('2022-09-27 22:37:30')}}