- Posts: 8
Using a different API call for rate structure data
- paulw
- Topic Author
Less
More
27 Sep 2012 14:13 #888
by paulw
Using a different API call for rate structure data was created by paulw
Is there a way I can use another source for Rate Structures other than OPENEI?
I have available another set of Tariff data through a different company that has an API and reference mechanism to many tariffs.
Any help on this would be much appreciated!
Thanks.
I have available another set of Tariff data through a different company that has an API and reference mechanism to many tariffs.
Any help on this would be much appreciated!
Thanks.
Please Log in or Create an account to join the conversation.
- pgilman
Less
More
- Posts: 5423
28 Sep 2012 09:28 #889
by pgilman
Replied by pgilman on topic Using a different API call for rate structure data
Hi paulw,
You can use SAM's scripting language SamUL to populate the input variables on the Utility Rate page with data from the database. If the data is available via HTTP, you can use the SamUL function HttpGet() to download and store the data.
Here's some sample code to give you an idea of what would be involved:
tariff_string = HttpGet(" www.company.com/rates ")
' Code to parse flat rate from tariff_string
' and store it in buy_rate variable
SetInput("ur.flat.buy_rate" , buy_rate)
OutLn("Buy rate = " + buy_rate)
Please see the SamUL documentation in Help for details about the language. There are also sample files with examples of the script that you can open from the File menu.
Is the API you mention available to the public?
Best regards,
Paul.
You can use SAM's scripting language SamUL to populate the input variables on the Utility Rate page with data from the database. If the data is available via HTTP, you can use the SamUL function HttpGet() to download and store the data.
Here's some sample code to give you an idea of what would be involved:
tariff_string = HttpGet(" www.company.com/rates ")
' Code to parse flat rate from tariff_string
' and store it in buy_rate variable
SetInput("ur.flat.buy_rate" , buy_rate)
OutLn("Buy rate = " + buy_rate)
Please see the SamUL documentation in Help for details about the language. There are also sample files with examples of the script that you can open from the File menu.
Is the API you mention available to the public?
Best regards,
Paul.
Please Log in or Create an account to join the conversation.
- paulw
- Topic Author
Less
More
- Posts: 8
28 Sep 2012 12:43 #890
by paulw
Replied by paulw on topic Using a different API call for rate structure data
Paul,
many thanks for your reply its fantastic that this is possible through SAM.
The API I was mentioning is from a company called Genability ( developer.genability.com/ ).
They provide similar service as the OPENEI tariffs, however they appear to be far more up to date and accurate.
A problem that I could see is that geneability provides the tariff information in the format that the power companies display, not the format that we need to enter into SAM.
Any advice on how to take multiple tariffs that are ($/kWh) and combine them into an effective rate at is acceptable to SAM?
many thanks for your reply its fantastic that this is possible through SAM.
The API I was mentioning is from a company called Genability ( developer.genability.com/ ).
They provide similar service as the OPENEI tariffs, however they appear to be far more up to date and accurate.
A problem that I could see is that geneability provides the tariff information in the format that the power companies display, not the format that we need to enter into SAM.
Any advice on how to take multiple tariffs that are ($/kWh) and combine them into an effective rate at is acceptable to SAM?
Please Log in or Create an account to join the conversation.
- paulw
- Topic Author
Less
More
- Posts: 8
11 Oct 2012 10:17 #891
by paulw
Replied by paulw on topic Using a different API call for rate structure data
Any word on using an API product like the one from Geneability.
It is a paid service, but they offer 1000 free API calls per month.
Let me know.
Cheers,
Paulw
It is a paid service, but they offer 1000 free API calls per month.
Let me know.
Cheers,
Paulw
Please Log in or Create an account to join the conversation.
- pgilman
Less
More
- Posts: 5423
11 Oct 2012 12:43 #892
by pgilman
Replied by pgilman on topic Using a different API call for rate structure data
Hi Paul,
You should be able to use SamUL with the Genability API to populate SAM input values with data from the Genability database. I assume that the API provides a way to send credentials to access the paid service.
Because the database is more detailed than the SAM inputs, the script will have to combine rates as appropriate.
Best regards,
Paul.
You should be able to use SamUL with the Genability API to populate SAM input values with data from the Genability database. I assume that the API provides a way to send credentials to access the paid service.
Because the database is more detailed than the SAM inputs, the script will have to combine rates as appropriate.
Best regards,
Paul.
Please Log in or Create an account to join the conversation.
- paulw
- Topic Author
Less
More
- Posts: 8
25 Oct 2012 12:27 #893
by paulw
Replied by paulw on topic Using a different API call for rate structure data
Paul,
Thanks for your continued help on this subject.
I was able to get a simple HttpGet call to return a .json that I could output to the SAM UL console.
I'm having some trouble retrieving the right information from the response so that I can parse it and set it to the buy_rate variable.
Also I was wondering if there is a way to make library references similar to the OpenEIListRates() or the OpenEIApplyRate().
My goal is to have Geneability API be in a format that is nearly as easy to access and interact with as the current OpenEI rate search built into SAM.
Thanks,
Paul
ps. I'm not a programmer so my problems could be due to my lack of knowledge of .json and api calls. If this is the case just let me know, I don't want to waste your team asking you simple programming questions, I want to get to SAM and its capability to be modified.
Thanks for your continued help on this subject.
I was able to get a simple HttpGet call to return a .json that I could output to the SAM UL console.
I'm having some trouble retrieving the right information from the response so that I can parse it and set it to the buy_rate variable.
Also I was wondering if there is a way to make library references similar to the OpenEIListRates() or the OpenEIApplyRate().
My goal is to have Geneability API be in a format that is nearly as easy to access and interact with as the current OpenEI rate search built into SAM.
Thanks,
Paul
ps. I'm not a programmer so my problems could be due to my lack of knowledge of .json and api calls. If this is the case just let me know, I don't want to waste your team asking you simple programming questions, I want to get to SAM and its capability to be modified.
Please Log in or Create an account to join the conversation.
Moderators: pgilman