Hi All,
Just wondering if anyone can help me with formatting a template for a JSON REST GET sensor. My current config is below but is only returning a unknown value.
- platform: rest
resource: http://192.168.0.4/solar_api/v1/GetMeterRealtimeData.cgi?Scope=System
method: GET
name: "House Comsumption"
value_template: '{(value_json.Body.Data.1.PowerApparent_S_Sum /100 | float / 10)|round(2)}'
unit_of_measurement: 'kW'
force_update: true
The JSON response
{
"Body": {
"Data": {
"1": {
"Current_AC_Phase_1": 5.4400000000000004,
"Current_AC_Phase_2": 0.92000000000000004,
"Current_AC_Phase_3": 1.6000000000000001,
"Details": {
"Manufacturer": "Fronius",
"Model": "Smart Meter 50kA-3",
"Serial": "----------"
},
"Enable": 1,
"EnergyReactive_VArAC_Sum_Consumed": 1106,
"EnergyReactive_VArAC_Sum_Produced": 7632,
"EnergyReal_WAC_Minus_Absolute": 776,
"EnergyReal_WAC_Plus_Absolute": 22466,
"EnergyReal_WAC_Sum_Consumed": 22466,
"EnergyReal_WAC_Sum_Produced": 776,
"Frequency_Phase_Average": 49.899999999999999,
"Meter_Location_Current": 0,
"PowerApparent_S_Phase_1": 1308.864,
"PowerApparent_S_Phase_2": 221.72,
"PowerApparent_S_Phase_3": 386.56,
"PowerApparent_S_Sum": 1818,
"PowerFactor_Phase_1": -0.98999999999999999,
"PowerFactor_Phase_2": -0.89000000000000001,
"PowerFactor_Phase_3": -0.96999999999999997,
"PowerFactor_Sum": 1,
"PowerReactive_Q_Phase_1": 179.80000000000001,
"PowerReactive_Q_Phase_2": 95.599999999999994,
"PowerReactive_Q_Phase_3": 90.400000000000006,
"PowerReactive_Q_Sum": 174.59999999999999,
"PowerReal_P_Phase_1": 1276,
"PowerReal_P_Phase_2": 181.80000000000001,
"PowerReal_P_Phase_3": 353,
"PowerReal_P_Sum": 1810.8,
"TimeStamp": 1564741004,
"Visible": 1,
"Voltage_AC_PhaseToPhase_12": 417.10000000000002,
"Voltage_AC_PhaseToPhase_23": 417.89999999999998,
"Voltage_AC_PhaseToPhase_31": 417.60000000000002,
"Voltage_AC_Phase_1": 240.59999999999999,
"Voltage_AC_Phase_2": 241,
"Voltage_AC_Phase_3": 241.59999999999999
}
}
},
"Head": {
"RequestArguments": {
"DeviceClass": "Meter",
"Scope": "System"
},
"Status": {
"Code": 0,
"Reason": "",
"UserMessage": ""
},
"Timestamp": "-------------------------------------"
}
}
Thanks any help is appreciated.