API for 123 solar

Talks about solar stuff
Post Reply
andy
Posts: 72
Joined: Wed May 04, 2016 10:25 am
Location: Ukraine
Contact:

API for 123 solar

Post by andy » Wed Apr 25, 2018 2:13 pm

Dear jeanmarc
how difficult it will be to make API (like fronius API but much simpler)
for use in mobie apps, another sites etc.?

jeanmarc
Posts: 2028
Joined: Thu Aug 29, 2013 7:16 am

Re: API for 123 solar

Post by jeanmarc » Wed Apr 25, 2018 2:38 pm

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...

extreme79
Posts: 4
Joined: Sat Jun 16, 2018 11:33 am

Re: API for 123 solar

Post by extreme79 » Sun Jun 17, 2018 11:34 am

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

jeanmarc
Posts: 2028
Joined: Thu Aug 29, 2013 7:16 am

Re: API for 123 solar

Post by jeanmarc » 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

extreme79
Posts: 4
Joined: Sat Jun 16, 2018 11:33 am

Re: API for 123 solar

Post by extreme79 » 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]

wifi75
Posts: 24
Joined: Tue Aug 27, 2019 2:26 pm

Re: API for 123 solar

Post by wifi75 » Sun Apr 19, 2020 7:48 am

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?

wifi75
Posts: 24
Joined: Tue Aug 27, 2019 2:26 pm

Re: API for 123 solar

Post by wifi75 » Sun Apr 19, 2020 7:51 am

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

jeanmarc
Posts: 2028
Joined: Thu Aug 29, 2013 7:16 am

Re: API for 123 solar

Post by jeanmarc » 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.

wifi75
Posts: 24
Joined: Tue Aug 27, 2019 2:26 pm

Re: API for 123 solar

Post by wifi75 » Sun Apr 19, 2020 4:52 pm

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

Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests