FHEM Forum

FHEM => English Corner => Thema gestartet von: petitpunch am 26 Juli 2023, 12:33:13

Titel: HTTPMOD - JSON - HOW TO
Beitrag von: petitpunch am 26 Juli 2023, 12:33:13
Hello,

i'm trying to set a light ON when my electrical panels producing more than I consume.
Normally I can do this with a define notify, but in this case, i'm not able to read the value of P1METER ProdOrConso

here is the definition:

define P1METER HTTPMOD http://192.168.1.138/api/v1/data 180\

setuuid P1METER 6245acf3-f33f-266d-5423-cc86a3ed6683e38a
attr P1METER userattr get01JSON get01Regex getData requestHeader stateFormat
attr P1METER enableCookies 1
attr P1METER icon measure_photovoltaic_inst
attr P1METER enforceGoodReadingNames 1
attr P1METER reading01Name ProdOrConso
attr P1METER reading01JSON active_power_w
attr P1METER reading02JSON total_power_export_t1_kwh
attr P1METER reading03JSON total_power_export_t2_kwh
attr P1METER reading04JSON total_power_import_t1_kwh
attr P1METER reading05JSON total_power_import_t2_kwh
attr P1METER reading06JSON active_power_l1_w
attr P1METER reading07JSON active_power_l2_w
attr P1METER reading08JSON active_power_l3_w
attr P1METER requestHeader1 Content-Type: application/json
attr P1METER requestHeader2 Accept: */*
attr P1METER room ENERGIE
attr P1METER stateFormat ProdOrConso W J:total_power_import_t1_kwh Kwh N:total_power_import_t2_kwh kwh  I :total_power_export_t1_kwh kwh



Someone could help me ?

Thank you
Titel: Aw: HTTPMOD - JSON - HOW TO
Beitrag von: Prof. Dr. Peter Henning am 23 März 2024, 06:12:30
Saw this only now, and maybe it is much too late. What exactly do you mean by "not being able to read"? Is the reading ProdOrConso filled with content ?

Regards

pah