Hi,
Since many days ans many weeks I’m triying to get datas from a simple data json file from my Legrand “Eco meter” (https://www.legrand.fr/pro/catalogue/31736-ecocompteurs-ip/ecocompteur-modulaire-ip-pour-mesure-consommation-sur-6-postes-110v-a-230v-6-modules).
Inside this smart meter you can find 2 different json files :
- http://SMART_METER_IP/inst.json
- http://SMART_METER_IP/data.json
First I used a simple solution to include datas from the inst.json with a sensor rest.
The inst.json :
{
"data1":223.000000,
"data2":3.000000,
"data3":5.000000,
"data4":151.000000,
"data5":10.000000,
"data6":505.272766,
"data6m3":50.027004,
"data7":0.000000,
"data7m3":0.000000,
"heure":11,
"minute":31,
"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":1578828670
}
And that is my sensor rest :
- platform: rest
resource: http://SMART_METER_IP/inst.json
name: Legrand Ecocompteur Puissance Instantanée
value_template: '{{ value_json.data1| round(0) }}'
device_class: power
unit_of_measurement: W
Result : Any problem with this sensor and json files
But… for the second file I can’t use the same sensor.
The command can’t find the datas inside…
Here is the data.json :
{
"option_tarifaire" : 1,
"tarif_courant" : 1,
"isousc" : 30,
"conso_base" : 0,
"conso_hc" : 009087439,
"conso_hp" : 017096852,
"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" : 1,
"type_imp_2" : 1,
"type_imp_3" : 1,
"type_imp_4" : 1,
"type_imp_5" : 1,
"label_entree1" : "Chauffage",
"label_entree2" : "Refroidissement",
"label_entree3" : "Eau chaude",
"label_entree4" : "Prises de Courant",
"label_entree5" : "Prises de Courant",
"label_entree_imp0" : "Gaz",
"label_entree_imp1" : "Eau",
"label_entree_imp2" : "Eau",
"label_entree_imp3" : "Eau",
"label_entree_imp4" : "Eau",
"label_entree_imp5" : "Eau",
"entree_imp0_disabled" : 0,
"entree_imp1_disabled" : 0,
"entree_imp2_disabled" : 1,
"entree_imp3_disabled" : 1,
"entree_imp4_disabled" : 1,
"entree_imp5_disabled" : 1
}
So obviously at first I tried the same sensor :
- platform: rest
resource: http://SMART_METER_IP/data.json
name: Legrand Ecocompteur Intensité Souscrite
value_template: '{{ value_json.isousc| round(0) }}'
unit_of_measurement: A
result : Nothing
Then I tried a solution I found on the forum with the jsonrest in the
/custom_components
folder :
- platform: jsonrest
resource: http://SMART_METER_IP/data.json
method: GET
name: legranddata
scan_interval: '00:15'
- platform: template
sensors:
# Intensité Souscrite
isousc:
value_template: '{{ states.sensor.legranddata.attributes.isousc }}'
friendly_name: Legrand Intensite Souscrite
result : The legranddata sensor is “Active” but any datas inside and the isousc sensor is empty.
Honnestly, I think I used all the ideas I had and I look forward to your help