ESPproMon Web Browser API


#1

We will use this thread to list and discuss the API available for the ESPproMon app.


#2

If you want to control your home appliances via a web browser rather than your smartphone you can use the built in API facility. All the API features described in detail here should work.

For most API calls you can see the responses in the terminal widget on the tariff page.

Once you have the server address [server_address] and your token [your_token_here] enter them in the following web browser API calls:

  1. App Connected returning true or false in your browser
    [server_address]/[your_token_here]/isAppConnected

  2. Turn ON your RF device
    [server_address]/[your_token_here]/update/V13?value=1

  3. Turn OFF your RF device
    [server_address]/[your_token_here]/update/V13?value=0

  4. Turn ON your Relay
    [server_address]/[your_token_here]/update/V2?value=1

  5. Turn OFF your RF device
    [server_address]/[your_token_here]/update/V2?value=0

  6. Check for firmware updates
    [server_address]/[your_token_here]/update/V60?value=1

  7. Clear data from table
    [server_address]/[your_token_here]/update/V18?value=26

  8. Set table refresh to 10 seconds
    [server_address]/[your_token_here]/update/V18?value=25
    followed by:
    [server_address]/[your_token_here]/update/V6?value=10

  9. Set individual cumulative tariff band 1 to 170KWH
    [server_address]/[your_token_here]/update/V18?value=1
    followed by:
    [server_address]/[your_token_here]/update/V6?value=170
    For bands 2 to 5 just replace the 1 in the first url with the band number you wish to change and enter the new KWH in the second url. See also 11 to set all costs bands in a single API call.

  10. Set individual energy cost rate 1 to 15.27 i.e. 15.27 cents / 15.27 pence etc per KWH
    [server_address]/[your_token_here]/update/V18?value=6
    followed by:
    [server_address]/[your_token_here]/update/V6?value=0.1527
    For rates 2 to 6 just replace 6 in the first url with the 7, 8, 9, 10 and 11 respectively and enter the new cost per KWH in the second url. See also 12 to set all costs cost rates in a single API call.

  11. Set all cost bands with one API call
    If your bands were say 120, 320, 500, 1000 and 1001 the url would be:
    [server_address]/[your_token_here]/update/V1?value=120,320,500,1000,1001

  12. Set all energy cost rates with one API call
    If your rates were say 0.1371, 0.1453, 0.1498, 0.1541, 0.1558 and 0.1558 the url would be:
    [server_address]/[your_token_here]/update/V5?value=0.1371,0.1453,0.1498,0.1541.0.1558,0.1558

We will followup with further examples in due course but it’s easier to make the changes via your smartphone other than perhaps API calls 11 and 12. The API calls are really for users temporarily without access to their smartphone.


#3

Ok a few more API calls and the first one is intentionally a three stage process as it will clear the EEPROM of your ESP8266 and you will need to go through the provisioning process again.

  1. Clear EEPROM not for the faint hearted
    All 3 API calls need to be processed within a few seconds or the request to clear EEPROM will timeout.
    [server_address]/[your_token_here]/update/V4?value=1
    [server_address]/[your_token_here]/update/V4?value=0
    [server_address]/[your_token_here]/update/V4?value=1

  2. Reboot your ESP
    [server_address]/[your_token_here]/update/V3?value=1