'Set variable value on CCU/Homegear.'

def hm_set_variable(self, name, value):

    if (name not in self._variables):
        _LOGGER.error('Variable    %s    not    found    on    %s', name, self.name)
        return
    old_value = self._variables.get(name)
    if isinstance(old_value, bool):
        value = cv.boolean(value)
    else:
        value = float(value)
    self._homematic.setSystemVariable(self.name, name, value)
    self._variables.update({name: value})
    self.schedule_update_ha_state()
