Page 1 of 1

API for 123 solar

Posted: Wed Apr 25, 2018 2:13 pm
by andy
Dear jeanmarc
how difficult it will be to make API (like fronius API but much simpler)
for use in mobie apps, another sites etc.?

Re: API for 123 solar

Posted: Wed Apr 25, 2018 2:38 pm
by jeanmarc
Hi,
i don't know the Fronius API but that's quite simple to get data, check m.php example and also "programs" 123solar/programs/programday.php?invtnum=0 programproduction.php?invtnum=0...

Re: API for 123 solar

Posted: Sun Jun 17, 2018 11:34 am
by extreme79
Hi, there's a topic that explain in detail how to get data from 123solar?
I want to send data to my domotic controller on a regular basis, next I want to integrate also with consumption data installing meterN and a modbus device, wigth the target to balance consuption based on production.

I can read on regular basis from my domotic controller or (best I think) push values from 123solar to my controller (zipato).. but first I need to learn how to get values :P

Re: API for 123 solar

Posted: Sun Jun 17, 2018 3:52 pm
by jeanmarc
Hi,
Just make a http json query on 123solar/programs/programlive.php?invtnum=1.
For mN, it depend the value you wish : metern/programs/programlive.php , programindicator.php or programtotal.php

Re: API for 123 solar

Posted: Sun Jun 17, 2018 10:24 pm
by extreme79
seems simple :)
thanks

[OT] I have nodered installed on the rpi too.. so I can crate a flow that call the url, get the json, elaborate it and update virtual devices on my domotic controller with 123solar status and main data.. mm seems funny :geek: [/OT]

Re: API for 123 solar

Posted: Sun Apr 19, 2020 7:48 am
by wifi75
jeanmarc wrote:
Sun Jun 17, 2018 3:52 pm
Hi,
Just make a http json query on 123solar/programs/programlive.php?invtnum=1.
For mN, it depend the value you wish : metern/programs/programlive.php , programindicator.php or programtotal.php
hello @jeanmarc
hello also i would need to export the metern data on hassio via api i have JSON but i am not able to do it. could you explain how to do it?

Re: API for 123 solar

Posted: Sun Apr 19, 2020 7:51 am
by wifi75
extreme79 wrote:
Sun Jun 17, 2018 10:24 pm
seems simple :)
thanks

[OT] I have nodered installed on the rpi too.. so I can crate a flow that call the url, get the json, elaborate it and update virtual devices on my domotic controller with 123solar status and main data.. mm seems funny :geek: [/OT]
can you help me?
I want to send data to Home assistant

Re: API for 123 solar

Posted: Sun Apr 19, 2020 10:45 am
by jeanmarc
All the data returns by programs are in JSON, just look at what they output. Sorry but i never use Home assistant.

Re: API for 123 solar

Posted: Sun Apr 19, 2020 4:52 pm
by wifi75
jeanmarc wrote:
Sun Apr 19, 2020 10:45 am
All the data returns by programs are in JSON, just look at what they output. Sorry but i never use Home assistant.
oh yess very easy !
It work on Home assistant! :D

only one question the json file update in real time?

this is my code:

Code: Select all

#### lettura dati da 123solar e MeterN direttamente da file json

sensor:
  - platform: rest
    resource: http://192.168.1.51/123solar/programs/programlive.php?invtnum=1
    name: Sensore potenza immediata
    value_template: '{{ value_json.G1P }}'

  - platform: rest
    resource: http://192.168.1.51/123solar/programs/programlive.php?invtnum=1
    name: Sensore tensione
    value_template: '{{ value_json.G1V }}'
 
  - platform: rest
    resource: http://192.168.1.51/123solar/programs/programlive.php?invtnum=1
    name: Sensore ampere
    value_template: '{{ value_json.G1A }}'

  - platform: rest
    resource: http://192.168.1.51/123solar/programs/programlive.php?invtnum=1
    name: Sensore picco massimo
    value_template: '{{ value_json.PMAXOTD }}' 
    
    
  - platform: rest
    resource: http://192.168.1.51/metern/programs/programlive.php    
    name: Sensore consumi
    value_template: '{{ value_json.Consumi2 }}'
    
  - platform: rest
    resource: http://192.168.1.51/metern/programs/programlive.php    
    name: Sensore prelievi
    value_template: '{{ value_json.Prelievi3 }}'     

  - platform: rest
    resource: http://192.168.1.51/metern/programs/programlive.php    
    name: Sensore immissioni
    value_template: '{{ value_json.Immissioni4 }}' 
    
  - platform: rest
    resource: http://192.168.1.51/metern/programs/programlive.php    
    name: Sensore autoconsumo
    value_template: '{{ value_json.Autoconsumo5 }}'   
    



Thank you