Dear all the HA community,
I’m sure you can help me regarding my issue.
I’m trying to get data from my LEGRAND EcoCompteur through the REST platform.
I did something working well into the configuration.yaml
- platform: rest
name: "House heating power"
resource: http://192.168.1.92/inst.json
value_template: '{{ value_json.data1 }}'
device_class: power
unit_of_measurement: "W"
Raw data
{
"data1":1181.000000,
"data2":289.000000,
"data3":53.000000,
"data4":51.000000,
"data5":0.000000,
"data6":0.000000,
"data6m3":0.000000,
"data7":0.000000,
"data7m3":0.000000,
"heure":21,
"minute":44,
"CIR1_Nrj":0.000000,
"CIR1_Vol":0.000000,
"CIR2_Nrj":0.000000,
"CIR2_Vol":0.000000,
"CIR3_Nrj":0.000000,
"CIR3_Vol":0.000000,
"CIR4_Nrj":0.000000,
"CIR4_Vol":0.000000,
"Date_Time":1607377448
}
Unfortunately it’s more difficult than planned regarding the second request below :
http://192.168.1.92/data.json
The problem is that the data looks like Json but finally they don’t respect the Json rules regarding conso_hc and conso_hp values. The problem seems that the value start with a zero value.
"conso_hc" : 006699756, => "conso_hc" : 6699756,
"conso_hp" : 014039296, => "conso_hp" : 14039296,
Question :
- How to get “conso_hc” and “conso_hp” values into HA ?
####################################################
http complete raw answer of the second request :
{
"option_tarifaire" : 1,
"tarif_courant" : 2,
"isousc" : 60,
"conso_base" : 0,
"conso_hc" : 006699756,
"conso_hp" : 014039296,
"conso_hc_b" : 0,
"conso_hp_b" : 0,
"conso_hc_w" : 0,
"conso_hp_w" : 0,
"conso_hc_r" : 0,
"conso_hp_r" : 0,
"type_imp_0" : 0,
"type_imp_1" : 0,
"type_imp_2" : 1,
"type_imp_3" : 1,
"type_imp_4" : 1,
"type_imp_5" : 1,
"label_entree1" : "Chauffage",
"label_entree2" : "Eau chaude",
"label_entree3" : "Eclairage ",
"label_entree4" : "Cuisine ",
"label_entree5" : "Seches serviettes ",
"label_entree_imp0" : "Eau froide adoucie",
"label_entree_imp1" : "Eau chaude",
"label_entree_imp2" : "Eau",
"label_entree_imp3" : "Eau",
"label_entree_imp4" : "Eau",
"label_entree_imp5" : "Eau",
"entree_imp0_disabled" : 1,
"entree_imp1_disabled" : 1,
"entree_imp2_disabled" : 1,
"entree_imp3_disabled" : 1,
"entree_imp4_disabled" : 1,
"entree_imp5_disabled" : 1
}