I hope it works for you,
here is a better way of doing this.
- platform: rest
name: IoTaWatt
json_attributes:
- inputs
- outputs
resource: http://192.168.68.160/status?inputs=yes&outputs=yes
value_template: '{{ value_json.inputs[0].Vrms }}v'
scan_interval: 5
- platform: template
sensors:
iotawatt_channel_1:
friendly_name_template: 'Channel {{ states.sensor.iotawatt.attributes["inputs"][1].channel }}'
unit_of_measurement: 'Watts'
value_template: '{{ states.sensor.iotawatt.attributes["inputs"][1].Watts }}'
iotawatt_channel_12:
friendly_name_template: 'Channel {{ states.sensor.iotawatt.attributes["inputs"][12].channel }}'
unit_of_measurement: 'Watts'
value_template: '{{ states.sensor.iotawatt.attributes["inputs"][12].Watts }}'
That way it doesn’t hit the rest api so much.
I only have 12 CT at the moment so I didn’t test 13 and 14.
Let me know if it works!