Package: oma-helen-cli
Oma Helen CLIAn interactive CLI that logs intoOma Helenand offers functions to get contract data or electricity measurement data in JSON format.You can also retrieve your APIaccess-tokenwith theget_access_tokenfunction of the CLI in case you wish to make some other API calls that are not provided by the CLI tool (see theMaking a requestexample below). Note that the token is valid for only one hour from the login.What is Oma Helen?Oma Helen is the user portal for a Finnish electricity company, Helen Oy.How to install and useInstall frompypiand run:pipinstalloma-helen-cli
oma-helen-cliThen just enter you Oma Helen credentials and start entering commands.Tip: in order to list all the commands within the CLI, enter?Available functionsFunction nameWhat it doesget_api_access_tokenGet the access token to the Oma Helen API. With the token, you can make queries to your own contracts and data in Oma Helenget_contract_base_priceGet the monthly base price of your current electricity contractget_contract_data_jsonReturns the whole contract data as JSON. Will return all active contracts you have with Helenget_daily_measurements_jsonReturns your daily energy consumption for the on-going month of the on-going year as JSONget_market_prices_jsonReturns the prices for the Market Price Electricity contract as JSON. The JSON includes the price for last month, the current month and next month if availableget_monthly_measurements_jsonReturns your monthly energy consumption for the on-going year as JSONcalculate_the_impact_of_usage_between_datesCalculates your impact of usage (in c/kwh) between given dates for the Helen Smart Electricity Guaranteecalculate_spot_cost_between_datesCalculates the total costs (eur) between given dates of a spot price contract in an hourly precisionget_exchange_margin_price_jsonGet the margin price of the Exchange Electricity contractget_contract_energy_unit_priceGet the energy unit price (c/kwh) from your contract data. Note that this only works for fixed price contracts. For spot electricity contract, this returns 0.0get_contract_transfer_feeGet the transfer fees (c/kwh) from your contract. Note that if Helen is not your transfer company, this returns 0.0calculate_transfer_fees_between_datesCalculates total transfer fees (eur) based on your consumption between datesget_contract_transfer_base_priceGet the monthly transfer base price (eur) from your contract. Note that if Helen is not your transfer company, this returns 0.0get_all_delivery_sitesGet all delivery sites across your active contractsselect_delivery_siteSelects a delivery site by id for the CLI to use. Useful if you have multiple contracts with Helen. Useget_all_delivery_sitesto find out all your delivery sites. After selecting a delivery site, all measurements and other requested data will be about the selected delivery site.Installing from sources and running the project for local developmentFirst clone this repo.Use virtual env to keep the project isolated. Developed using Python 3.9.9In the project root folder runpython -m venv .venvActivate the venv withsource .venv/bin/activateInstall requirementspip install -r requirements.txtLaunch the CLI as a python modulepython -m helenservice.cliEnter your username and password as they are promptedType?into the CLI prompt to see all available functionsDeactivate venv when not needed:deactivate