hi im having problems intergrating this system from JSON attribute to a figure. i have a neurio sensor and have the data coming through from an IP address for sensor sample. I can view the live data as neurio raw in lovelace and it appears like this:
- type: PHASE_A_CONSUMPTION
ch: 1
eImp_Ws: 17977336051
eExp_Ws: 242713400
p_W: 204
q_VAR: -155
v_V: 248.371 - type: NET
ch: 2
eImp_Ws: 10451620210
eExp_Ws: 8629877621
p_W: 194
q_VAR: -205
v_V: 248.376 - type: GENERATION
ch: 3
eImp_Ws: 15956047506
eExp_Ws: 43007723
p_W: 10
q_VAR: 50
v_V: 248.381 - type: CONSUMPTION
ch: 4
eImp_Ws: 17977256524
eExp_Ws: 242713371
p_W: 204
q_VAR: -155
v_V: 248.371
here is the IP sample
{“sensorId”:“0x0000C47F51051480”,“timestamp”:“2020-10-29T19:03:43Z”,“channels”:[{“type”:“PHASE_A_CONSUMPTION”,“ch”:1,“eImp_Ws”:17976724351,“eExp_Ws”:242713400,“p_W”:192,“q_VAR”:-162,“v_V”:245.560},{“type”:“NET”,“ch”:2,“eImp_Ws”:10451041896,“eExp_Ws”:8629877621,“p_W”:183,“q_VAR”:-211,“v_V”:245.565},{“type”:“GENERATION”,“ch”:3,“eImp_Ws”:15956014120,“eExp_Ws”:43007723,“p_W”:9,“q_VAR”:49,“v_V”:245.569},{“type”:“CONSUMPTION”,“ch”:4,“eImp_Ws”:17976644824,“eExp_Ws”:242713371,“p_W”:192,“q_VAR”:-162,“v_V”:245.560}],“cts”:[{“ct”:1,“p_W”:192,“q_VAR”:-162,“v_V”:245.560,“i_A”:1.135},{“ct”:2,“p_W”:0,“q_VAR”:0,“v_V”:0.268,“i_A”:1.155},{“ct”:3,“p_W”:0,“q_VAR”:0,“v_V”:0.381,“i_A”:0.212},{“ct”:4,“p_W”:9,“q_VAR”:49,“v_V”:245.569,“i_A”:0.205}]}
I need channel 3 and 4s p_W value as i need consumption and geneartion to setup my solar system.
The Config is:
sensor:
- platform: rest
resource: http://193.168.1.52/current-sample
name: neurio_raw
scan_interval: 1
value_template: ‘{{ value_json.state }}’
json_attributes:- channels
- platform: template
scan_interval: 1
sensors:
realtime_solar_gen:
friendly_name: ‘Generation’
device_class: power
unit_of_measurement: W
value_template: “{{ state_attr(‘neurio_raw.ch.3’, ‘p_w’) }}”
realtime_consumption:
friendly_name: ‘Consumption’
device_class: power
unit_of_measurement: W
value_template: “{{ state_attr(‘neurio_raw.ch.4’, ‘p_w’) }}”
I have the value template pulling through into love lace but it doesnt display the value as a live data. and keeps comming up unkown. PLEASE GUIDE ME lol