snsary.contrib.octopus
Outputs KWh (electricity) or cubic meter (gas) consumption from a specified Smart Meter in half hour intervals. At the time of writing, data is only available for the previous day sometime on the following day (not sure exactly when). Create instances with .<fuel_type>_from_env().
.electricity_from_env()expects:OCTOPUS_ELECTRICITY_MPAN
OCTOPUS_ELECTRICITY_SERIAL
OCTOPUS_TOKEN
.gas_from_env()expects:OCTOPUS_GAS_MPRN
OCTOPUS_GAS_SERIAL
OCTOPUS_TOKEN
Module Contents
- class snsary.contrib.octopus.OctopusSensor(*, mpxn, serial_number, token, fuel_type)
Bases:
snsary.sources.PollingSensor- property name
- CONSUMPTION_URL = 'https://api.octopus.energy/v1/{fuel_type}-meter-points/{mpxn}/meters/{serial_number}/consumption/...'
- classmethod electricity_from_env()
- classmethod gas_from_env()
- sample(now, **kwargs)