I use shell_command and created a service calling API using curl command, that service runs every minute and gives me the following output:
stdout: >-
{“pvSystemId”:“b16d8d79-566d-449d-b809-a5ee0164faf9”,“status”:{“isOnline”:true,“battMode”:1.0},“data”:{“logDateTime”:“2024-07-03T12:34:10Z”,“channels”:[{“channelName”:“PowerFeedIn”,“channelType”:“Power”,“unit”:“W”,“value”:-1455.02},{“channelName”:“PowerLoad”,“channelType”:“Power”,“unit”:“W”,“value”:-81.38},{“channelName”:“PowerBattCharge”,“channelType”:“Power”,“unit”:“W”,“value”:-2521.10},{“channelName”:“PowerPV”,“channelType”:“Power”,“unit”:“W”,“value”:4057.5},{“channelName”:“PowerOutput”,“channelType”:“Power”,“unit”:“W”,“value”:null},{“channelName”:“BattSOC”,“channelType”:“Percentage”,“unit”:“%”,“value”:99.0},{“channelName”:“RateSelfConsumption”,“channelType”:“Percentage”,“unit”:“%”,“value”:5.30},{“channelName”:“RateSelfSufficiency”,“channelType”:“Percentage”,“unit”:“%”,“value”:100.0},{“channelName”:“PowerEVCTotal”,“channelType”:“Power”,“unit”:“W”,“value”:null}]}}
stderr: “% Total % Received % Xferd Average Speed Time Time Time Current\n Dload Upload Total Spent Left Speed\n\r 0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0\r 0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0\r100 878 100 878 0 0 2083 0 --:–:-- --:–:-- --:–:-- 2080”
returncode: 0
This is fine so far, now I want to use the values from that output i.e:
{“channelName”:“PowerPV”,“channelType”:“Power”,“unit”:“W”,“value”:4057.5}, to create an entity. Is this somehow possible to do? This is from my PV system and I want to use the values in lovelace dashboard to get them updated once a minute.
I know there is a custom integration available for this, but unfortunatley this is not working properly for me, so I try to run the API calls in services and that works fine.