I have set up a command_line sensor that requests data from my solar inverter’s web API.
It looks like this:
{"loggerSN":xxxx,"tOperationTime":xxxx,"inverterSN":"xxxx","inverterPlateTemp":45,"inverterRadiatorTemp":35,"VDC1":249.4,"VDC2":230.1,"IDC1":4.49,"IDC2":0.82,"PDC1":1.06,"PDC2":0.15,"IAC1":4.83,"IAC2":0,"IAC3":0,"VAC1":240.2,"VAC2":0,"VAC3":0,"fAC":50,"currentPower":1.15,"eToday":1.08,"eTotal":1396.6,"CombinerVoltageGroup1":0,"CombinerVoltageGroup2":0,"StringCurrentGroup1":0,"StringCurrentGroup2":0,"Vbus":0,"year":23,"month":9,"day":10,"hour":10,"minute":22,"second":37}
There are 2 things I need to do:
- somehow filter the output for only the “currentPower” attribure
- multiple the “currentPower” attribute by 100 so I get the output in Watts
I have tried using some regex filtering, but this is the first time I’m doing something with regex and I think there has to be something easier?
Any help would be greatly appreciated!