# Using the active tariff to determine the electricity being used and
# delivered for the right tariff.
active_tariff = telegram[obis_references.ELECTRICITY_ACTIVE_TARIFF]
active_tariff = int(tariff.value)
see that the int(tariff.value) is referring to a non-existing variable 'tariff'
See fix in https://github.com/Michael-Yongshi/dsmr_parser/blob/master/README.rst
see that the int(tariff.value) is referring to a non-existing variable 'tariff'