'Initialize the sensor.'

def __init__(self, hass, data, name, value_template, unit_of_measurement, sensorid, elem):

    if (name is None):
        self._name = 'emoncms{}_feedid_{}'.format(sensorid, elem['id'])
    else:
        self._name = name
    self._identifier = get_id(sensorid, elem['tag'], elem['name'], elem['id'], elem['userid'])
    self._hass = hass
    self._data = data
    self._value_template = value_template
    self._unit_of_measurement = unit_of_measurement
    self._sensorid = sensorid
    self._elem = elem
    if (self._value_template is not None):
        self._state = self._value_template.render_with_possible_json_value(elem['value'], STATE_UNKNOWN)
    else:
        self._state = round(float(elem['value']), DECIMALS)
