SMAsolar not logging to EmonCMS since upgrade (TypeError: ‘<’ not supported between instances of ‘int’ and ‘str)

Actually we should possibly tag @bwduncan too, it was him that added the sorted() aspect to the returned data.

The error message is correct you cannot compare str and ints, I don’t know what is expected or possible in this data, a numerical name perhaps? It can be a None that causes an issue when sorting dicts and lists in python, maybe not all the data is being retrieved as expected?

For Python3 the fix is apparently to use a “lambda”, see python 3.x - Sorting list containing value:None, results to TypeError: '<' not supported between instances of 'NoneType' and 'str' - Stack Overflow

Depending on the data’s key types the lambda could incorporate a type cast if needed I expect.